Action-Build
Action-Build copied to clipboard
android14-6.1 部分厂商源码编译失败:susfs 补丁 fs/namespace.c Hunk #1 FAILED(缺 trace/hooks/blk.h)
现象
部分 android14-6.1 机型在 SukiSU-Ultra 分支上编译失败,死在 Build Kernel FAST:
patching file fs/namespace.c
Hunk #1 FAILED at 32.
1 out of 10 hunks FAILED -- saving rejects to file fs/namespace.c.rej
...
../fs/namespace.c: error: use of undeclared identifier 'VFSMOUNT_MNT_FLAGS_KSU_UNSHARED_MNT'
../fs/namespace.c: error: call to undeclared function 'susfs_is_current_ksu_domain'
../fs/namespace.c: error: use of undeclared identifier 'CL_COPY_MNT_NS'
...
make[3]: *** [../scripts/Makefile.build:257: fs/namespace.o] Error 1
和 #294(exec.c / task_mmu.c)不是同一个问题。
原因
- susfs4ksu
gki-android14-6.1从8a3d6fd(2026-10-19)起,fs/namespace.c的 hunk 1 需要#include <trace/hooks/blk.h>作为上下文(92aab7f及更早不需要)。 - Google GKI
android14-6.1的fs/namespace.c在#include "internal.h"后有这一行,但部分厂商源码没有。 - 于是 hunk 1 整块被拒,
susfs_def.h没被引入,namespace.c编译报 undeclared。 PatchFakePatches.kts目前只处理了 SUBLEVEL ≥ 157 时blk.h的情况,没覆盖源码里本来就没有这一行的情况。
验证
对缺这一行的 fs/namespace.c,在 #include "internal.h" 后补上 #include <trace/hooks/blk.h>,再用 susfs 27e0a0e 的 namespace.c 部分做 patch --dry-run:10/10 hunk 成功;不补就是 1/10 失败。
修复
见 PR:apply 时若缺这一行就临时补上(并留标记文件),revert 时只删自己补的那一行。
EN: Since susfs4ksu 8a3d6fd, hunk #1 of fs/namespace.c (android14-6.1) needs #include <trace/hooks/blk.h> as context. Some OEM sources don't have that line, so the hunk is rejected and fs/namespace.o fails to build. Proposed fix: temporarily insert the line in PatchFakePatches.kts when absent, and remove it on revert.