SpazeDog / mounts2sd

Android SD-Ext Script+App
GNU General Public License v3.0
76 stars 27 forks source link

ZRAM settings has no effect on ZRAM #40

Open pejakm opened 9 years ago

pejakm commented 9 years ago

Android 4.2.2, stock based (prestigio phone).

This is a quick fix for the script:

--- mounts2sd.sh.orig   2015-04-10 17:30:24.653286825 +0200
+++ mounts2sd.sh    2015-04-10 17:21:33.030236383 +0200
@@ -112,6 +112,7 @@ touch
 seq
 date
 swapon
+swapoff
 mkswap
 insmod
 readlink
@@ -974,6 +975,9 @@ ProcessMemory() {
                         fi

                     elif $_test -b /dev/block/zram0 || ( $_test -e /system/lib/modules/zram.ko && $_insmod /system/lib/modules/zram.ko ); then
+                        $_swapoff /dev/block/zram0;
+                        $_sleep 0.5;
+                        $_echo 1 > /sys/block/zram0/reset;
                         $_echo "$(($(($(($lMemory * $lSize)) / 100)) * 1024))" > /sys/block/zram0/disksize
                         lDevice=/dev/block/zram0 && $_mkswap $lDevice >/dev/null

You need to stop zram first, reset its value, then start it again with new value (this is what this patch do). However, UI still reports ZRAM as "disabled", apparently the app itself needs a fix.

dbergloev commented 9 years ago

Did I not already to this in the script? I will add this when I get the time, but I actually want to remove most of the work from the script and have it be handled by the app itself. There is no reason for ZRAM to be handled by a startup script and the same goes for things like readahead and other things. I think the script should handle nothing more than handling the mount part as this needs to be done before the system boots. I just need to find a good way to have the app do all of the data transfers as this also should not be handled during boot, but instead during settings changes with a progressbar. But not sure that I will have time for this until after the summer.

The app however displays ZRAM status fine on my devices. But it would be great to have the RootFW library updated. The new version contains specific ZRAM/SWAP tools.

pejakm commented 9 years ago

This is worked out nicely in Performance Control, but I prefer Mounts2SD more. Anyway, I'm really glad you haven't gave up on this project, I'm looking forward to further fixes and features. :)