mirror of
https://github.com/immortalwrt/immortalwrt
synced 2025-01-08 12:08:13 +08:00
zram-swap: bail out early if the kernel doesn't support swap
Since KERNEL_SWAP is only enabled by default for !SMALL_FLASH targets, we need
to check if the current kernel supports swap before trying to configure
zram-swap, as opkg can't check for kernel dependencies.
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
(cherry picked from commit 565dfeb128
)
This commit is contained in:
parent
8bbf5bc4b0
commit
ab610f5af3
@ -150,6 +150,11 @@ zram_compact()
|
||||
|
||||
start()
|
||||
{
|
||||
[ -e /proc/swaps ] || {
|
||||
logger -s -t zram_start -p daemon.crit "kernel doesn't support swap"
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ $( grep -cs zram /proc/swaps ) -ne 0 ]; then
|
||||
logger -s -t zram_start -p daemon.notice "[OK] zram swap is already mounted"
|
||||
return 1
|
||||
|
Loading…
Reference in New Issue
Block a user