Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 将br2中保留的修补程序应用于buildroot包外部_Git_Raspberry Pi_Diff_Embedded Linux_Buildroot - Fatal编程技术网

Git 将br2中保留的修补程序应用于buildroot包外部

Git 将br2中保留的修补程序应用于buildroot包外部,git,raspberry-pi,diff,embedded-linux,buildroot,Git,Raspberry Pi,Diff,Embedded Linux,Buildroot,我想对buildroot包应用一个补丁。我正在使用br2external树将我的自定义设置排除在buildroot树之外。Buildroot可以找到我的修补程序,但尝试应用时失败 我已经设置了BR2_GLOBAL_PATCH_DIR=“${BR2_EXTERNAL_PATH}/board/myboard/patches”,并将补丁放在${BR2_EXTERNAL_PATH}/board/myboard/patches/packagename/0001补丁的名称中。我通过转到buildrootre

我想对buildroot包应用一个补丁。我正在使用
br2external
树将我的自定义设置排除在buildroot树之外。Buildroot可以找到我的修补程序,但尝试应用时失败

我已经设置了
BR2_GLOBAL_PATCH_DIR=“${BR2_EXTERNAL_PATH}/board/myboard/patches”
,并将补丁放在
${BR2_EXTERNAL_PATH}/board/myboard/patches/packagename/0001补丁的名称中。我通过转到
buildroot
repo生成了补丁,将更改应用到包中,用git提交,并从上次提交创建补丁:
git格式补丁头~1
因此,修补程序如下所示:

diff --git a/package/rpi-firmware/cmdline.txt b/package/rpi-firmware/cmdline.txt
index 155a54693b..630cfa9e00 100644
--- a/package/rpi-firmware/cmdline.txt
+++ b/package/rpi-firmware/cmdline.txt
@@ -1 +1 @@
-old code line
+new code line
但是,当我运行
make
时,在修补过程中找不到要修补的文件(路径错误)

我还尝试了
rpi固件/cmdline.txt
cmdline.txt
路径


我应该在补丁文件中使用什么路径?它应该是相对于包、相对于buildroot存储库根,还是相对于全局补丁目录指向包?我照做了,但找不到这个问题的答案。

正如@sawdust提到的,不可能在buildroot包目录
buildroot/package/
中修补文件。您只能修补程序包的源代码,即下载到
output/build/
的源文件


最后,我使用了一个生成后脚本来修改复制后的文件,如中所述(option
BR2\u ROOTFS\u post\u build\u script=“${BR2\u EXTERNAL\u PATH}/board/myboard/scripts/post build.sh”

AFAIK无法使用make修补包/目录中的文件。没有特殊的.stamp_补丁文件写入每个包//子目录,以确保补丁只应用一次,不应再次应用。补丁程序通常应用于output/build//中的文件。感谢您的评论;)我可以在output/build/中修补它。我所要做的就是让补丁包在我的图像中着陆。我认为这里的问题是源代码在buildroot/package/中,而补丁程序在${BR2_GLOBAL\u patch\u DIR}中。“这里的问题是源代码在buildroot/package/中”——是的,并且在输出/build/中没有它的副本。也许您可以使用后期生成脚本修补文件的安装版本$(BINARIES_DIR)/rpi firmware/cmdline.txt?谢谢,这是我考虑的替代方案,我使用了此解决方案。您可以随时使用整个BR存储库并应用任何您想要的修补程序。举个例子,我是这样做的。
Applying 0001-name-of-patch.patch using patch:
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/package/rpi-firmware/cmdline.txt b/package/rpi-firmware/cmdline.txt
|index 155a54693b..630cfa9e00 100644
|--- a/package/rpi-firmware/cmdline.txt
|+++ b/package/rpi-firmware/cmdline.txt
--------------------------
No file to patch.  Skipping patch.