Merge pull request #14 from nathanchance/module-contexts

Backend: Only apply contexts to new modules
This commit is contained in:
Chris Renshaw authored and GitHub committed 2018-01-08 12:36:12 -04:00
commit 4e31cbd461
1 file changed
+9 -5
+9 -5
View File
@@ -93,14 +93,18 @@ 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 /$module ]; then
case $module in
*/vendor/*) mod=vendor;;
*) mod=system;;
esac;
fi;
$bb cp -rLf $module /$module;
$bb chown 0:0 /$module;
$bb chmod 644 /$module;
case $module in
*/vendor/*) mod=vendor;;
*) mod=system;;
esac;
chcon "u:object_r:${mod}_file:s0" /$module;
if [ "$mod" ]; then
chcon "u:object_r:${mod}_file:s0" /$module;
fi;
done;
cd /tmp/anykernel;
mount -o ro,remount -t auto /system;