mirror of
https://github.com/armbian/build
synced 2025-09-24 19:47:06 +07:00
ZRAM config: suppress errors when kernel support is not there
This commit is contained in:
@@ -25,6 +25,8 @@ ENABLED=false
|
||||
[ -f /etc/default/armbian-zram-config ] && . /etc/default/armbian-zram-config
|
||||
# Exit if not Enabled
|
||||
[[ "$ENABLED" != "true" ]] && exit 0
|
||||
# Exit if module not Loaded
|
||||
if ! modinfo "zram" 2>/dev/null; then exit 0; fi
|
||||
|
||||
# Do not interfere with already present zram-config package
|
||||
dpkg -l | grep -q 'zram-config' && exit 0
|
||||
@@ -60,7 +62,7 @@ activate_zram_swap() {
|
||||
# swap file or partition on *capable* storage needs to be chosen and
|
||||
# defined as swap and also in /etc/default/armbian-zram-config SWAP=false
|
||||
# needs to be set.
|
||||
echo 0 >/sys/module/zswap/parameters/enabled 2>/dev/null
|
||||
[[ -f /sys/module/zswap/parameters/enabled ]] && echo 0 >/sys/module/zswap/parameters/enabled
|
||||
|
||||
# Limit Journal size to 20Mb
|
||||
sed -i "s/.*SystemMaxUse=$/SystemMaxUse=20M/" /etc/systemd/journald.conf
|
||||
|
||||
Reference in New Issue
Block a user