Skip to content

Commit fd6f839

Browse files
authored
ksud/installer: /odm handling (#2513)
we move the folder out of system if it exists in real filesystem and it is not a symlink. this is already supported on init_event.rs so only handle_partition logic was needed to make it happen since KernelSU is using overlayfs, we need to move these out. Signed-off-by: backslashxx <[email protected]> --------- Signed-off-by: backslashxx <[email protected]>
1 parent 6bf2739 commit fd6f839

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

kernel/core_hook.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,7 @@ int ksu_handle_setuid(struct cred *new, const struct cred *old)
605605

606606
// fixme: use `collect_mounts` and `iterate_mount` to iterate all mountpoint and
607607
// filter the mountpoint whose target is `/data/adb`
608+
try_umount("/odm", true, 0);
608609
try_umount("/system", true, 0);
609610
try_umount("/vendor", true, 0);
610611
try_umount("/product", true, 0);

userspace/ksud/src/installer.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,8 @@ handle_partition() {
309309
return;
310310
fi
311311

312-
if [ -L "/system/$1" ] && [ "$(readlink -f /system/$1)" = "/$1" ]; then
312+
# we move the folder to / only if it is a native folder that is not a symlink
313+
if [ -d "/$1" ] && [ ! -L "/$1" ]; then
313314
ui_print "- Handle partition /$1"
314315
# we create a symlink if module want to access $MODPATH/system/$1
315316
# but it doesn't always work(ie. write it in post-fs-data.sh would fail because it is readonly)
@@ -406,6 +407,7 @@ install_module() {
406407
handle_partition vendor
407408
handle_partition system_ext
408409
handle_partition product
410+
handle_partition odm
409411

410412
if $BOOTMODE; then
411413
mktouch $NVBASE/modules/$MODID/update

0 commit comments

Comments
 (0)