aboutsummaryrefslogtreecommitdiffstats
path: root/package/system/zram-swap
diff options
context:
space:
mode:
Diffstat (limited to 'package/system/zram-swap')
-rw-r--r--package/system/zram-swap/files/zram.init13
1 files changed, 11 insertions, 2 deletions
diff --git a/package/system/zram-swap/files/zram.init b/package/system/zram-swap/files/zram.init
index 23de915c8f..431e47c8f9 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -71,8 +71,17 @@ zram_reset()
list_cpu_idx()
{
- local line i=0
-
+ # Offset by 1 if /dev/zram0 is in use by /tmp
+ if [ "$(mount | grep /dev/zram0)" ]; then
+ local line i=1
+ # Hot-add new ZRAM device (if necessary)
+ if [ ! -b /dev/zram1 ]; then
+ cat /sys/class/zram-control/hot_add
+ fi
+ else
+ local line i=0
+ fi
+
while read line; do {
case "$line" in
[Pp]rocessor*)