diff --git a/scripts/module_installer.sh b/scripts/module_installer.sh index 2b391f8bb..f28aa9d2d 100644 --- a/scripts/module_installer.sh +++ b/scripts/module_installer.sh @@ -172,9 +172,11 @@ fi # Copy over custom sepolicy rules if [ -f $MODPATH/sepolicy.rule -a -e $PERSISTDIR ]; then ui_print "- Installing custom sepolicy patch" + # Remove old recovery logs (which may be filling partition) to make room + rm -f $PERSISTDIR/cache/recovery/* PERSISTMOD=$PERSISTDIR/magisk/$MODID mkdir -p $PERSISTMOD - cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule + cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule || abort "! Insufficient partition size" fi # Remove stuffs that don't belong to modules diff --git a/scripts/util_functions.sh b/scripts/util_functions.sh index d3bfc121c..24edda2cd 100644 --- a/scripts/util_functions.sh +++ b/scripts/util_functions.sh @@ -727,9 +727,11 @@ install_module() { # Copy over custom sepolicy rules if [ -f $MODPATH/sepolicy.rule -a -e "$PERSISTDIR" ]; then ui_print "- Installing custom sepolicy patch" + # Remove old recovery logs (which may be filling partition) to make room + rm -f $PERSISTDIR/cache/recovery/* PERSISTMOD=$PERSISTDIR/magisk/$MODID mkdir -p $PERSISTMOD - cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule + cp -af $MODPATH/sepolicy.rule $PERSISTMOD/sepolicy.rule || abort "! Insufficient partition size" fi # Remove stuffs that don't belong to modules