应用并提交Bitbake食谱中的补丁 [英] Apply and commit a patch from bitbake recipe

查看:350
本文介绍了应用并提交Bitbake食谱中的补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现yocto构建系统只是在应用我的补丁,而不是在克隆的git repo上应用并提交补丁.

I am observing that the yocto build system is just applying my patch instead of applying and committing the patch on the cloned git repo.

原始Bitbake( u-boot-ti-staging_2018.01.bb )文件.

Original bitbake (u-boot-ti-staging_2018.01.bb) file.

require u-boot-ti.inc

PR = "r19"

BRANCH = "ti-u-boot-2018.01"

SRCREV = "8b2f1df4b55bc0797399a21d42ac191d44f99227"

修改后的bitbake文件,在文件中添加了 SRC_URI .

Modified bitbake file, added SRC_URI to the file.

require u-boot-ti.inc

PR = "r19"

BRANCH = "ti-u-boot-2018.01"

SRCREV = "8b2f1df4b55bc0797399a21d42ac191d44f99227"

SRC_URI += "file://0001-Stopping-DHCP-server-giving-new-serverip.patch \
        "

我已在文件目录下添加了补丁文件.补丁文件( 0001-Stopping-DHCP-server-giving-new-serverip.patch )文件的内容如下.

I have added a patch file under files directory. The content of the patch (0001-Stopping-DHCP-server-giving-new-serverip.patch) file is as follows.

From cf97b6053f00afd496d01a892599cd8f4b254087 Mon Sep 17 00:00:00 2001
From: Sunny Shukla <sunny.shukla@xyz.com>
Date: Wed, 19 Sep 2018 18:23:49 +0530
Subject: [PATCH] Stopping DHCP server giving new serverip

Added CONFIG_BOOTP_SERVERIP in the config file, this
stops the DHCP server gives new "serverip" address and 
overrides the current one.
---
 include/configs/am335x_evm.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/configs/am335x_evm.h b/include/configs/am335x_evm.h
index 01f0277..4b3047d 100644
--- a/include/configs/am335x_evm.h
+++ b/include/configs/am335x_evm.h
@@ -18,6 +18,8 @@

 #include <configs/ti_am335x_common.h>

+#define CONFIG_BOOTP_SERVERIP
+
 #ifndef CONFIG_SPL_BUILD
 # define CONFIG_TIMESTAMP
 #endif
-- 
2.7.4

补丁的应用就像有人在克隆的git repo顶部执行" git apply 0001-Stopping-DHCP-server-giving-new-serverip.patch "命令一样,如下所示.但是我更希望该补丁必须像有人在克隆的git repo顶部执行" git am 0001-Stopping-DHCP-server-giving-new-serverip.patch "命令一样应用.

The patch is applying like someone is executing a "git apply 0001-Stopping-DHCP-server-giving-new-serverip.patch" command on top of the cloned git repo as show below. But rather I want that the patch must be applied like someone is executing a "git am 0001-Stopping-DHCP-server-giving-new-serverip.patch" command on top of the cloned git repo.

git状态

On branch ti-u-boot-2018.01
Your branch is behind 'origin/ti-u-boot-2018.01' by 23 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   include/configs/am335x_evm.h

no changes added to commit (use "git add" and/or "git commit -a") 

我希望将此补丁应用并提交到克隆的git repo之上.如何在bitbake文件下实现该目标?

I want this patch to be applied and committed on top of the cloned git repo. How to achieve that under a bitbake file?

推荐答案

在未指定补丁工具的情况下,默认情况下,Yocto使用quilt.您可以指定

Yocto by default uses quilt when no patch tool is specified. You can specify

PATCHTOOL = "git"

在您的食谱中,以便Yocto使用"git am"自动应用它.

in your recipe, so that Yocto automatically applies it using "git am".

请参见此处了解更多信息.

注意:此功能将在应用补丁程序时开始在补丁程序的描述中添加额外的一行,例如" %%原始补丁程序:0001-Stopping-DHCP-server-giving-new-serverip.patch ".修补.要摆脱它,请在" oe-core/meta/lib/oe/patch.py​​ "文件下注释以下行.

NOTE: This functionality will start adding an extra line to the patch's description like "%%original patch: 0001-Stopping-DHCP-server-giving-new-serverip.patch" while applying the patch. To get rid of it, comment the below line under "oe-core/meta/lib/oe/patch.py" file.

https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/patch.py​​#n519

这篇关于应用并提交Bitbake食谱中的补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆