summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended
diff options
context:
space:
mode:
authorSinan Kaya <okaya@kernel.org>2021-04-23 20:03:25 +0000
committerKhem Raj <raj.khem@gmail.com>2021-04-23 21:41:26 -0700
commitcb1cf053785bcb5670b2eca7051aa11f29ef80b1 (patch)
tree7cb4a27ed5d81d05656bba70f348a7faa3e39c57 /meta-oe/recipes-extended
parenta7d0d878542ec24d718972423b34c59aa5bd2498 (diff)
downloadmeta-openembedded-cb1cf053785bcb5670b2eca7051aa11f29ef80b1.tar.gz
zram: add support for mem_limit
Some targets might be interested in limiting how big zram can grow. If the variable is set in /etc/default/zram file, configure it in mem_limit sysfs attribute. Signed-off-by: Sinan Kaya <okaya@kernel.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-extended')
-rwxr-xr-xmeta-oe/recipes-extended/zram/zram/zram-swap-init5
1 files changed, 5 insertions, 0 deletions
diff --git a/meta-oe/recipes-extended/zram/zram/zram-swap-init b/meta-oe/recipes-extended/zram/zram/zram-swap-init
index ccc3aafe3..28082f7ff 100755
--- a/meta-oe/recipes-extended/zram/zram/zram-swap-init
+++ b/meta-oe/recipes-extended/zram/zram/zram-swap-init
@@ -24,3 +24,8 @@ modprobe -q zram || true
24 24
25zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $device 25zramctl -a ${ZRAM_ALGORITHM} -s ${memzram}KB $device
26mkswap -L "zram-swap" $device 26mkswap -L "zram-swap" $device
27
28devname="${device##*/}"
29if [ ! -z ${ZRAM_SIZE_LIMIT+x} ]; then
30 echo ${ZRAM_SIZE_LIMIT} > /sys/block/$devname/mem_limit
31fi