From 6e14f5cfe98785ed74b4fe6eff97a662cac4c00b Mon Sep 17 00:00:00 2001 From: osm0sis Date: Fri, 23 Mar 2018 13:29:20 -0300 Subject: [PATCH] Backend: fix modules support regression for /vendor thanks @nathanchance for the quick heads-up --- META-INF/com/google/android/update-binary | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/META-INF/com/google/android/update-binary b/META-INF/com/google/android/update-binary index a5c6f48..0b466a0 100755 --- a/META-INF/com/google/android/update-binary +++ b/META-INF/com/google/android/update-binary @@ -116,18 +116,22 @@ if [ "$(file_getprop /tmp/anykernel/anykernel.sh do.modules)" == 1 ]; then mount -o rw,remount -t auto /vendor 2>/dev/null; cd /tmp/anykernel/modules; for module in $(find . -name '*.ko'); do - if [ ! -e $root/$module ]; then + case $module in + */system/*) modtarget=$root/$module;; + *) modtarget=/$module;; + esac; + if [ ! -e $modtarget ]; then case $module in */vendor/*) mod=vendor;; *) mod=system;; esac; fi; - mkdir -p $root/$(dirname $module); - $bb cp -rLf $module $root/$module; - $bb chown 0:0 $root/$module; - $bb chmod 644 $root/$module; + mkdir -p $(dirname $modtarget); + $bb cp -rLf $module $modtarget; + $bb chown 0:0 $modtarget; + $bb chmod 644 $modtarget; if [ "$mod" ]; then - chcon "u:object_r:${mod}_file:s0" $root/$module; + chcon "u:object_r:${mod}_file:s0" $modtarget; fi; done; cd /tmp/anykernel;