应用并提交来自 bitbake 配方的补丁

Apply and commit a patch from bitbake recipe

我观察到 yocto 构建系统只是在应用我的补丁,而不是在克隆的 git 存储库上应用和提交补丁。

原始 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 \
        "

我在files目录下添加了补丁文件。补丁(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 apply 0001-Stopping-DHCP-server-giving-new-serverip.patch”命令在克隆的 git 仓库之上,如下所示。但是我希望必须像某人执行“git am 0001-Stopping-DHCP-server-giving-new-serverip.patch”一样应用补丁命令位于克隆的 git 仓库之上。

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 存储库之上应用和提交此补丁。如何在 bitbake 文件下实现?

Yocto 在未指定补丁工具时默认使用 quilt。您可以指定

PATCHTOOL = "git"

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

有关详细信息,请参阅 here

注意:此功能将开始向补丁的描述添加额外的一行,例如“%%original patch: 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