mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-24 19:56:37 +00:00
Make zram amount configurable with ZRAM_SIZE
Change-type: patch
This commit is contained in:
parent
32bd9efa11
commit
ce2acdca06
6
zram.sh
6
zram.sh
@ -1,13 +1,13 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DEVICE=/dev/zram0
|
DEVICE=/dev/zram0
|
||||||
SIZE=1G
|
${ZRAM_SIZE:=1G}
|
||||||
|
|
||||||
CURRENT_SIZE=$(zramctl --raw --noheadings --output DISKSIZE $DEVICE)
|
CURRENT_SIZE=$(zramctl --raw --noheadings --output DISKSIZE $DEVICE)
|
||||||
|
|
||||||
if [ $CURRENT_SIZE != $SIZE ]; then
|
if [ $CURRENT_SIZE != $ZRAM_SIZE ]; then
|
||||||
swapoff $DEVICE
|
swapoff $DEVICE
|
||||||
zramctl $DEVICE --algorithm lz4 --size $SIZE
|
zramctl $DEVICE --algorithm lz4 --size $ZRAM_SIZE
|
||||||
mkswap $DEVICE
|
mkswap $DEVICE
|
||||||
swapon $DEVICE
|
swapon $DEVICE
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user