mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +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
|
||||
|
||||
DEVICE=/dev/zram0
|
||||
SIZE=1G
|
||||
${ZRAM_SIZE:=1G}
|
||||
|
||||
CURRENT_SIZE=$(zramctl --raw --noheadings --output DISKSIZE $DEVICE)
|
||||
|
||||
if [ $CURRENT_SIZE != $SIZE ]; then
|
||||
if [ $CURRENT_SIZE != $ZRAM_SIZE ]; then
|
||||
swapoff $DEVICE
|
||||
zramctl $DEVICE --algorithm lz4 --size $SIZE
|
||||
zramctl $DEVICE --algorithm lz4 --size $ZRAM_SIZE
|
||||
mkswap $DEVICE
|
||||
swapon $DEVICE
|
||||
fi
|
||||
|
Loading…
x
Reference in New Issue
Block a user