Backend: fix modules support regression for /vendor

thanks @nathanchance for the quick heads-up
This commit is contained in:
osm0sis committed 2018-03-23 13:29:55 -03:00
1 parent e686f1f76c
commit 6e14f5cfe9
1 file changed
+10 -6
+10 -6
View File
@@ -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;