mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-22 16:07:39 +00:00
update copy_preinit_files
This commit is contained in:
parent
d54baadbed
commit
9a00b7b942
@ -568,16 +568,12 @@ run_migrations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
copy_preinit_files() {
|
copy_preinit_files() {
|
||||||
local PREINITDIR=$(magisk --path)/.magisk/preinit
|
local PREINITDIR=$MAGISKTMP/.magisk/preinit
|
||||||
if ! grep -q " $PREINITDIR " /proc/mounts; then
|
if [ ! -d $PREINITDIR ]; then
|
||||||
ui_print "- Unable to find preinit dir"
|
ui_print "- Unable to find preinit dir"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! grep -q "/adb/modules $PREINITDIR " /proc/self/mountinfo; then
|
|
||||||
rm -rf $PREINITDIR/*
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Copy all enabled sepolicy.rule
|
# Copy all enabled sepolicy.rule
|
||||||
for r in $NVBASE/modules*/*/sepolicy.rule; do
|
for r in $NVBASE/modules*/*/sepolicy.rule; do
|
||||||
[ -f "$r" ] || continue
|
[ -f "$r" ] || continue
|
||||||
@ -585,10 +581,9 @@ copy_preinit_files() {
|
|||||||
[ -f $MODDIR/disable ] && continue
|
[ -f $MODDIR/disable ] && continue
|
||||||
[ -f $MODDIR/remove ] && continue
|
[ -f $MODDIR/remove ] && continue
|
||||||
[ -f $MODDIR/update ] && continue
|
[ -f $MODDIR/update ] && continue
|
||||||
local MODNAME=${MODDIR##*/}
|
cat $r
|
||||||
mkdir -p $PREINITDIR/$MODNAME
|
echo
|
||||||
cp -f $r $PREINITDIR/$MODNAME/sepolicy.rule
|
done > $PREINITDIR/0/sepolicy.rule
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#################
|
#################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user