Skip to content
Snippets Groups Projects
Commit f362dc15 authored by Conn O'Griofa's avatar Conn O'Griofa Committed by John Crispin
Browse files

zram-swap: CONFIG_PROCD_ZRAM_TMPFS compatibility


Enable CONFIG_PROCD_ZRAM_TMPFS compatibility via two changes to list_cpu_idx():
* detect if /tmp is being used by /dev/zram0; if yes, offset initial value by 1 to skip first zram device.
* hot-add /dev/zram1, if not already present.

Signed-off-by: default avatarConn O'Griofa <&gt;connogriofa@gmail.com>
parent 911b6ca2
No related branches found
No related tags found
No related merge requests found
...@@ -71,8 +71,17 @@ zram_reset() ...@@ -71,8 +71,17 @@ zram_reset()
list_cpu_idx() 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 { while read line; do {
case "$line" in case "$line" in
[Pp]rocessor*) [Pp]rocessor*)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment