Skip to content

Commit

Permalink
mss: treewide: make changes regarding shellcheck
Browse files Browse the repository at this point in the history
* export some variables at common.sh
https://www.shellcheck.net/wiki/SC2034

* ignore word splitting detection when doing "toybox swapon" ...
* because double quoting $PRIORITY and $SWAPFILE breaks the operation
https://www.shellcheck.net/wiki/SC2086

Signed-off-by: chickendrop89 <[email protected]>
  • Loading branch information
chickendrop89 committed Jul 19, 2024
1 parent c03c1fa commit 8dce8ab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ if [ "$ENABLE_SWAP_PROP" = true ];
PRIORITY="-p $PRIORITY"
fi

# shellcheck disable=SC2086
toybox swapon $PRIORITY $SWAPFILE
fi
2 changes: 2 additions & 0 deletions system/bin/magiskswap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8dce8ab

Please sign in to comment.