mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 05:38:00 +00:00
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: Conn O'Griofa >connogriofa@gmail.com>
This commit is contained in:
parent
911b6ca234
commit
f362dc154d
@ -71,7 +71,16 @@ zram_reset()
|
|||||||
|
|
||||||
list_cpu_idx()
|
list_cpu_idx()
|
||||||
{
|
{
|
||||||
|
# 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
|
local line i=0
|
||||||
|
fi
|
||||||
|
|
||||||
while read line; do {
|
while read line; do {
|
||||||
case "$line" in
|
case "$line" in
|
||||||
|
Loading…
Reference in New Issue
Block a user