From de1b2b19b0b8614a6f70f617d15e647dac298413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AE=8B=E9=A1=B5?= <31466456+canyie@users.noreply.github.com> Date: Sat, 11 Dec 2021 17:58:43 +0800 Subject: [PATCH] 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. --- scripts/util_functions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index 431065929..baa18c336 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -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"