Skip to content

Commit

Permalink
More RAM: show sysctl values as before, suppress sysctl missing warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Botspot committed Nov 3, 2024
1 parent a0f1626 commit c8f7a53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/More RAM/install
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,14 @@ if [ "$(awk '/MemTotal/ {print $2}' /proc/meminfo)" -lt $((2*1024*1024)) ];then
echo 'vm.swappiness=100
vm.vfs_cache_pressure=500
vm.dirty_background_ratio=1
vm.dirty_ratio=50' | sudo tee /etc/sysctl.d/zram.conf >/dev/null
vm.dirty_ratio=50' | sudo tee /etc/sysctl.d/zram.conf
else
#otherwise only maximize swappiness
echo 'vm.swappiness=100' | sudo tee /etc/sysctl.d/zram.conf >/dev/null
echo 'vm.swappiness=100' | sudo tee /etc/sysctl.d/zram.conf
fi

#this script used to add lines to /etc/sysctl.conf, which is not guaranteed to exist. Remove those lines if found.
sudo sed -i '/^vm\.swappiness=100$/d ; /^vm\.vfs_cache_pressure=500$/d ; /^vm\.dirty_background_ratio=1$/d ; /^vm\.dirty_ratio=50$/d' /etc/sysctl.conf
sudo sed -i '/^vm\.swappiness=100$/d ; /^vm\.vfs_cache_pressure=500$/d ; /^vm\.dirty_background_ratio=1$/d ; /^vm\.dirty_ratio=50$/d' /etc/sysctl.conf 2>/dev/null

echo
status_green "ZRAM should now be set up. Consider rebooting your device."
Expand Down

0 comments on commit c8f7a53

Please sign in to comment.