运行“补丁 -p1 < 补丁文件”时出现“不支持 git 二进制差异”错误

问题描述

我有一个要应用于 android 内核的 .patch 文件,我这样做是通过:

patch -p1 < <patch-file>

运行后,我看到 git binary diffs are not supported 打印出补丁的以下行:

+PRODUCT_copY_FILES += \
+     hardware/ril/libquectel-ril/arm64-v8a/dir:system/bin/dir \

dir 是在补丁文件中定义的二进制文件

我应该初始化 git,添加所有文件,然后运行 ​​git apply patch-file 吗?

编辑:

在运行 git initgit addgit commit 后,我运行了 git apply <patch-file>,现在我得到:

warning: device/qcom/common/rootdir/etc/init.class_main.sh has type 100644,expected 100755
error: patch Failed: device/qcom/sdm845/sdm845.mk:87
error: device/qcom/sdm845/sdm845.mk: patch does not apply
warning: device/qcom/sepolicy/generic/vendor/common/file_contexts has type 100644,expected 100755
file.patch:37781: new blank line at EOF.
+
warning: system/core/init/selinux.cpp has type 100644,expected 100755
error: patch Failed: system/core/init/selinux.cpp:430
error: system/core/init/selinux.cpp: patch does not apply

解决方法

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

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

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