-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add option "increase_swappiness" for devices with limited ram
- Loading branch information
Showing
3 changed files
with
24 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This option increases swappiness to 100 to allow better performance for low ram devices | ||
|
||
increase_swappiness=0 | ||
for i in $(echo "$1" | sed 's#,# #g') | ||
do | ||
if [ "$i" == "increase_swappiness" ]; then increase_swappiness=1; fi | ||
done | ||
|
||
ret=0 | ||
|
||
if [ "$increase_swappiness" -eq 1 ]; then | ||
cat >/roota/etc/sysctl.d/99-swappiness.conf <<SWAPPINESS | ||
vm.swappiness=100 | ||
SWAPPINESS | ||
if [ ! "$?" -eq 0 ]; then ret=$((ret + (2 ** 0))); fi | ||
fi | ||
|
||
exit $ret | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters