From 04376fbe3ea6deddc9823813e71691190fad94fa Mon Sep 17 00:00:00 2001 From: osm0sis Date: Wed, 13 Sep 2023 15:54:34 -0300 Subject: [PATCH] Backend: work around KernelSU not processing modules on initial install - KernelSU currently requires the Manager app be run after first rooted to dump /data/adb/ksud, and then it will process any pending modules_update.img on the next reboot - the above is problematic since some custom kernels providing KernelSU support will require a working module system to overlay .ko kernel modules needed for feature support and sometimes the ROM won't boot without these matching - work around this KernelSU behavior by dumping ksud ourselves as-needed during the AK3 helper module installation, allowing seamless initial KernelSU kernel support installation with AK3 helper module .ko support See: https://github.com/tiann/KernelSU/issues/945 --- META-INF/com/google/android/update-binary | 4 ++++ META-INF/com/google/android/updater-script | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index 8e82432..6407acd 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -430,6 +430,10 @@ do_modules() { # this may be the initial KernelSU install or first module so setup as needed if [ -f $AKHOME/kernelsu_patched ]; then umask 077; + if [ ! -f /data/adb/ksud ]; then + cp -f /data/app/*/me.weishu.kernelsu*/lib/*/libksud.so /data/adb/ksud; + chmod 755 /data/adb/ksud; + fi; if [ ! -d /data/adb/modules ]; then mkdir -p /data/adb/modules; chmod 777 /data/adb/modules; diff --git a/META-INF/com/google/android/updater-script b/META-INF/com/google/android/updater-script index 70ac6c1..eb4d456 100644 --- a/META-INF/com/google/android/updater-script +++ b/META-INF/com/google/android/updater-script @@ -3,4 +3,4 @@ # Dummy file; update-binary is a shell script (DO NOT CHANGE) # # -# AK_BASE_VERSION=20230910 +# AK_BASE_VERSION=20230913