首页 > 解决方案 > 运行“patch -p1 < patch-file”时出现“git binary diffs are not supported”错误

问题描述

我有一个要应用于 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 init, git add,之后git 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

标签: gitkernelpatchandroid-kernel

解决方案


推荐阅读