Commit de1b2b19 authored by 残页's avatar 残页 Committed by John Wu

Only store sepolicy rules into partitions in ext4 format

Fix topjohnwu#5013
When installing from recovery, previous implementation may select f2fs partitions to store sepolicy rules, but magiskinit won't mount them and unable to load sepolicy rules.
parent e3158348
......@@ -628,13 +628,13 @@ copy_sepolicy_rules() {
RULESDIR=$NVBASE/modules
elif [ -d /data/unencrypted ] && ! grep ' /data ' /proc/mounts | grep -qE 'dm-|f2fs'; then
RULESDIR=/data/unencrypted/magisk
elif grep -q ' /cache ' /proc/mounts; then
elif grep ' /cache ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/cache/magisk
elif grep -q ' /metadata ' /proc/mounts; then
elif grep ' /metadata ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/metadata/magisk
elif grep -q ' /persist ' /proc/mounts; then
elif grep ' /persist ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/persist/magisk
elif grep -q ' /mnt/vendor/persist ' /proc/mounts; then
elif grep ' /mnt/vendor/persist ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/mnt/vendor/persist/magisk
else
ui_print "- Unable to find sepolicy rules dir"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment