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.
This commit is contained in:
残页 2021-12-11 17:58:43 +08:00 committed by John Wu
parent e31583485d
commit de1b2b19b0

View File

@ -628,13 +628,13 @@ copy_sepolicy_rules() {
RULESDIR=$NVBASE/modules RULESDIR=$NVBASE/modules
elif [ -d /data/unencrypted ] && ! grep ' /data ' /proc/mounts | grep -qE 'dm-|f2fs'; then elif [ -d /data/unencrypted ] && ! grep ' /data ' /proc/mounts | grep -qE 'dm-|f2fs'; then
RULESDIR=/data/unencrypted/magisk RULESDIR=/data/unencrypted/magisk
elif grep -q ' /cache ' /proc/mounts; then elif grep ' /cache ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/cache/magisk RULESDIR=/cache/magisk
elif grep -q ' /metadata ' /proc/mounts; then elif grep ' /metadata ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/metadata/magisk RULESDIR=/metadata/magisk
elif grep -q ' /persist ' /proc/mounts; then elif grep ' /persist ' /proc/mounts | grep -q 'ext4' ; then
RULESDIR=/persist/magisk 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 RULESDIR=/mnt/vendor/persist/magisk
else else
ui_print "- Unable to find sepolicy rules dir" ui_print "- Unable to find sepolicy rules dir"