pmaports/main/postmarketos-base/rootfs-etc-conf.d-zram-init
Sicelo A. Mhlongo d60f557c4a
zram-swap: support custom compression algorithm via deviceinfo
Some devices would benefit from using compression algorithms besides zstd.
Allow device maintainers to specify a more suitable algorithm using
`zram_swap_algo` deviceinfo variable.

Signed-off-By: Sicelo A. Mhlongo <absicsz@gmail.com>
Part-of: <https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/7239>
2025-10-23 09:53:06 +02:00

25 lines
921 B
Text

. /usr/share/misc/source_deviceinfo
size0="$(zram-configurator size)"
echo "zram swap: activating with size: $size0 MB"
# zstd (since linux-4.18), lz4 (since linux-3.15), or lzo.
# Size: zstd (best) > lzo > lz4. Speed: lz4 (best) > zstd > lzo
algo0="$(zram-configurator algo)"
# The following are defaults from the zram-init package:
load_on_start=yes
unload_on_stop=yes
num_devices=1
type0=swap
flag0= # The default "16383" is fine for us
mlim0= # no hard memory limit
back0= # no backup device
icmp0= # no incompressible page writing to backup device
idle0= # no idle page writing to backup device
wlim0= # no writeback_limit for idle page writing for backup device
notr0= # keep the default on linux-3.15 or newer
maxs0=1 # maximum number of parallel processes for this device
labl0=zram_swap # the label name
uuid0= # Do not force UUID
args0= # we could e.g. have set args0="-L 'zram_swap'" instead of using labl0