我发现yocto构建系统只是在应用我的补丁,而不是在克隆的git repo上应用并提交补丁。
原始Bitbake( u-boot-ti-staging_2018.01.bb )文件。
require u-boot-ti.inc
PR = "r19"
BRANCH = "ti-u-boot-2018.01"
SRCREV = "8b2f1df4b55bc0797399a21d42ac191d44f99227"
修改后的bitbake文件,在文件中添加了 SRC_URI 。
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 )文件的内容如下。
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 ”命令一样。
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文件下实现该目标?
答案 0 :(得分:1)
默认情况下,如果未指定修补程序工具,Yocto将使用quilt
。您可以指定
PATCHTOOL = "git"
在您的食谱中,以便Yocto使用“ git am”自动应用它。
有关更多详细信息,请参见here。
注意:此功能将在应用补丁程序时开始在补丁程序的描述中添加额外的一行,例如“ %%原始补丁程序:0001-Stopping-DHCP-server-giving-new-serverip.patch ”。补丁。要摆脱它,请在“ oe-core / meta / lib / oe / patch.py ”文件下注释以下行。
https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/lib/oe/patch.py#n519