我试着在下面的包中的watchog.c文件中添加一些检查,但是得到补丁失败的错误如下,手动补丁运行良好,没有任何问题,而且补丁是从这个包的文件创建的,所以没有版本不匹配或旧版本的问题。
https://sourceforge.net/projects/watchdog/files/watchdog/5.13/
ERROR: Command Error: exit status: 1 Output:
Applying patch watchdog.patch
patching file src/watchdog.c
Hunk #2 succeeded at 948 with fuzz 1.
Hunk #3 FAILED at 1057.
1 out of 3 hunks FAILED -- rejects in file src/watchdog.c
Patch watchdog.patch does not apply (enforce with -f)
ERROR: Function failed: patch_do_patch我试着搜索答案,但是
Bitbake recipe not applying patch as expected
Why does this patch applied with a fuzz of 1, and fail with fuzz of 0?
Hunk #1 FAILED at 1. What's that mean?
Above posts mention about pkg or improper patch issue, which doesnt look to be for my pkg, requesting for help on this.
diff --git a/src/watchdog.c b/src/watchdog.c
index 8a09632..bb4a189 100644
--- a/src/watchdog.c
+++ b/src/watchdog.c
@@ -570,6 +570,7 @@
struct stat s;
struct icmp_filter filt;
filt.data = ~(1<<ICMP_ECHOREPLY);
+ int check = FALSE;
#if USE_SYSLOG
char *opts = "d:i:n:Ffsvbql:p:t:c:r:m:a:";
@@ -947,6 +948,11 @@
(void) fclose(fp);
}
+ check = check_product();
+ if(check == TRUE)
+ {
+ setup_files();
+ }
/* set signal term to set our run flag to 0 so that */
/* we make sure watchdog device is closed when receiving SIGTERM */
signal(SIGTERM, sigterm_handler);
@@ -1051,6 +1057,11 @@
do_check2(check_bin(act->name, timeout, 1), act->name, rbinary, NULL);
#endif
+ if(check == TRUE)
+ {
+ do_check(test_files(), repair_bin, NULL);
+ }
+
/* finally sleep some seconds */
usleep(tint * 500000); /* this should make watchdog sleep tint seconds alltogther */
/* sleep(tint); */.bbappend文件
# changes for patching the disk IO check
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
FILESEXTRAPATHS_append := "${THISDIR}/files"
SRC_URI += " \
file://watchdog.patch \
"上面的"SRC_URI“和"SRC_URI_machineoverride”逐一尝试,都不起作用。
SRC_URI_machineoverride += "file://watchdog.patch"发布于 2020-07-02 18:33:13
问题可能是您的SRC_URI中有两次file://watchdog.patch,而bitbake会尝试应用它两次。因此,第二个失败了。
尝试删除SRC_URI_machineoverride行。
发布于 2020-07-02 20:01:32
您当前的修补程序文件与https://sourceforge.net/projects/watchdog/files/watchdog/5.13/中找到的源文件不匹配
我已经手动从https://sourceforge.net/projects/watchdog/files/watchdog/5.13/向文件添加了更改,补丁如下所示。
--- a/src/watchdog.c 2020-07-02 13:57:45.771971643 +0200
+++ b/src/watchdog.c 2020-07-02 13:57:55.979985941 +0200
@@ -567,6 +567,7 @@
pid_t child_pid;
int oom_adjusted = 0;
struct stat s;
+ int check = FALSE
#if USE_SYSLOG
char *opts = "d:i:n:Ffsvbql:p:t:c:r:m:a:";
@@ -1053,6 +1054,10 @@
do_check2(check_bin(act->name, timeout, 1), act->name, rbinary, NULL);
#endif
+ if(check == TRUE)
+ {
+ do_check(test_files(), repair_bin, NULL);
+ }
/* finally sleep some seconds */
usleep(tint * 500000); /* this should make watchdog sleep tint seconds alltogther */
/* sleep(tint); */https://stackoverflow.com/questions/62693983
复制相似问题