diff --git a/common.sh b/common.sh index 4dc5199..2a094a9 100755 --- a/common.sh +++ b/common.sh @@ -13,12 +13,12 @@ # Copyright (C) 2024 chickendrop89 -MODPATH="/data/adb/modules/magisk-swapspace" -SWAPPROP="$MODPATH/swap.prop" -SWAPFILE="$MODPATH/swap" +export MODPATH="/data/adb/modules/magisk-swapspace" +export SWAPPROP="$MODPATH/swap.prop" +export SWAPFILE="$MODPATH/swap" -VFS_CACHE_PRESSURE_SYSCTL_ENTRY="vm.vfs_cache_pressure" -SWAPPINESS_SYSCTL_ENTRY="vm.swappiness" +export VFS_CACHE_PRESSURE_SYSCTL_ENTRY="vm.vfs_cache_pressure" +export SWAPPINESS_SYSCTL_ENTRY="vm.swappiness" cprint(){ printf "- magisk-swapspace: %s \n" "$1" diff --git a/service.sh b/service.sh index 07ce494..d38851f 100755 --- a/service.sh +++ b/service.sh @@ -51,5 +51,6 @@ if [ "$ENABLE_SWAP_PROP" = true ]; PRIORITY="-p $PRIORITY" fi + # shellcheck disable=SC2086 toybox swapon $PRIORITY $SWAPFILE fi diff --git a/system/bin/magiskswap b/system/bin/magiskswap index 0697ea4..29b29e2 100755 --- a/system/bin/magiskswap +++ b/system/bin/magiskswap @@ -91,6 +91,8 @@ createSwapSpace(){ # Use the toybox version of the "swapon" applet as it has the priority switch cprint "mounting swapfile (It will take a while)" + + # shellcheck disable=SC2086 toybox swapon $PRIORITY $SWAPFILE modifyProp ENABLE-SWAP true