From 927beebd8bb96fbff43585e7676710f80a89e57b Mon Sep 17 00:00:00 2001 From: Ziyang Zhou Date: Thu, 5 Oct 2023 22:18:09 +0800 Subject: [PATCH] fix booting Change-Id: Ic19ca983445914155c020abc459b4615eaceba75 --- netbpfload/NetBpfLoad.cpp | 8 ++++++-- .../com_android_server_connectivity_ClatCoordinator.cpp | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/netbpfload/NetBpfLoad.cpp b/netbpfload/NetBpfLoad.cpp index ed7d048..284721d 100644 --- a/netbpfload/NetBpfLoad.cpp +++ b/netbpfload/NetBpfLoad.cpp @@ -353,12 +353,14 @@ int main(int argc, char** argv, char * const envp[]) { // kernel does not have CONFIG_BPF_JIT=y) // BPF_JIT is required by R VINTF (which means 4.14/4.19/5.4 kernels), // but 4.14/4.19 were released with P & Q, and only 5.4 is new in R+. - if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n")) return 1; + if (writeProcSysFile("/proc/sys/net/core/bpf_jit_enable", "1\n")) + ALOGE("write 1 to /proc/sys/net/core/bpf_jit_enable FAILED"); // Enable JIT kallsyms export for privileged users only // (Note: this (open) will fail with ENOENT 'No such file or directory' if // kernel does not have CONFIG_HAVE_EBPF_JIT=y) - if (writeProcSysFile("/proc/sys/net/core/bpf_jit_kallsyms", "1\n")) return 1; + if (writeProcSysFile("/proc/sys/net/core/bpf_jit_kallsyms", "1\n")) + ALOGE("write 1 to /proc/sys/net/core/bpf_jit_kallsyms FAILED"); } // Create all the pin subdirectories @@ -383,9 +385,11 @@ int main(int argc, char** argv, char * const envp[]) { ALOGE("If this triggers reliably, you're probably missing kernel options or patches."); ALOGE("If this triggers randomly, you might be hitting some memory allocation " "problems or startup script race."); + #if 0 ALOGE("--- DO NOT EXPECT SYSTEM TO BOOT SUCCESSFULLY ---"); sleep(20); return 2; + #endif } } diff --git a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp index c125bd6..0621893 100644 --- a/service/jni/com_android_server_connectivity_ClatCoordinator.cpp +++ b/service/jni/com_android_server_connectivity_ClatCoordinator.cpp @@ -130,6 +130,7 @@ static void verifyClatPerms() { #undef V2 + fatal = false; // HACKED if (fatal) abort(); } -- 2.49.0