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