Re: [OpenWrt-Devel] [PATCH v2] zram-swap: set a high priority for the swap

2015-05-29 Thread Juan Orti Alcaine
Sorry, this is the good one. I sent the wrong patch in my previous email.

2015-05-29 22:00 GMT+02:00 Juan Orti Alcaine :
> The zram swap must be activated with a higher priority than
> disk-based swap, so it is used before any other.
> This patch activates the zram-based swap with a priority of 100.
>
> ---
> v2:
>   Fallback to no priority when swapon doesn't support it.
>
> Signed-off-by: Juan Orti Alcaine 
> ---
>  package/system/zram-swap/files/zram.init | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/package/system/zram-swap/files/zram.init 
> b/package/system/zram-swap/files/zram.init
> index 23de915..44f75dd 100644
> --- a/package/system/zram-swap/files/zram.init
> +++ b/package/system/zram-swap/files/zram.init
> @@ -100,7 +100,7 @@ start()
> zram_reset "$zram_dev" "enforcing defaults"
> echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
> $zram_dev )/disksize"
> mkswap "$zram_dev"
> -   swapon "$zram_dev"
> +   swapon -p 100 "$zram_dev" || swapon "$zram_dev"
> } done
>  }
>
> --
> 2.4.1
>



-- 
Juan Orti
https://miceliux.com

GPG key: https://miceliux.com/pub/pubkey.asc
GPG fingerprint: 61F0 8272 6882 BCA6 3A35  88F6 B630 4B72 DEEB D08B
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] zram-swap: set a high priority for the swap

2015-05-29 Thread Juan Orti Alcaine
The zram swap must be activated with a higher priority than
disk-based swap, so it is used before any other.
This patch activates the zram-based swap with a priority of 100.

---
v2:
  Fallback to no priority when swapon doesn't support it.

Signed-off-by: Juan Orti Alcaine 
---
 package/system/zram-swap/files/zram.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 23de915..44f75dd 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -100,7 +100,7 @@ start()
zram_reset "$zram_dev" "enforcing defaults"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
$zram_dev )/disksize"
mkswap "$zram_dev"
-   swapon "$zram_dev"
+   swapon -p 100 "$zram_dev" || swapon "$zram_dev"
} done
 }
 
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCH v2] zram-swap: set a high priority for the swap

2015-05-29 Thread Juan Orti Alcaine
The zram swap must be activated with a higher priority than
disk-based swap, so it is used before any other.
This patch activates the zram-based swap with a priority of 100.

---
v2:
  Fallback to no priority when swapon doesn't support it.

Signed-off-by: Juan Orti Alcaine 
---
 package/system/zram-swap/files/zram.init | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/system/zram-swap/files/zram.init 
b/package/system/zram-swap/files/zram.init
index 23de915..b26ee0d 100644
--- a/package/system/zram-swap/files/zram.init
+++ b/package/system/zram-swap/files/zram.init
@@ -100,7 +100,7 @@ start()
zram_reset "$zram_dev" "enforcing defaults"
echo $(( $zram_size * 1024 * 1024 )) >"/sys/block/$( basename 
$zram_dev )/disksize"
mkswap "$zram_dev"
-   swapon "$zram_dev"
+   swapon -p 100 "$zram_dev"
} done
 }
 
-- 
2.4.1
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel