修补程序产生“找不到要在输入行4752上修补的文件”错误

问题描述

我正在使用补丁将更改应用于安装在mnt上的fs,但出现此错误:

patch --binary -f -d mnt -p2 < rootfs.patch
.
.
.
can't find file to patch at input line 4752
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/root/usr/lib/systemd/system/iptables.service b/root/usr/lib/systemd/system/iptables.service
|index 5441e45..b1e447e 100644
|--- a/root/usr/lib/systemd/system/iptables.service
|+++ b/root/usr/lib/systemd/system/iptables.service
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored

我已经检查过该文件确实存在,所以我认为它不应该出现此错误。但是,错误本身令人困惑,因为4752行不属于该补丁程序部分。修补程序文件如下所示:

4738 --- /dev/null
4739 +++ b/root/usr/lib/systemd/system/arp@.service
4740 @@ -0,0 +1,13 @@
.
.
.
4752 ### Just some more service script code here
4753 +
4754 diff --git a/root/usr/lib/systemd/system/iptables.service b/root/usr/lib/systemd/system/iptables.service
4755 index 5441e45..b1e447e 100644
4756 --- a/root/usr/lib/systemd/system/iptables.service
4757 +++ b/root/usr/lib/systemd/system/iptables.service

请注意,iptables.service直到4757才开始。

所以我认为错误可能是指向arp@.service的,但这是补丁中的新文件,因此该文件不必存在。

以前有人遇到过这种情况吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...