Latest product reviews
ARCHOS 50 Diamond
ARCHOS GamePad2
ARCHOS
Smartphones
ARCHOS
TV Connect
ARCHOS 101 XS

A A A
Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?

ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288

 Please donate to support OMA and CrewRKTablets firmware work, thank you !

sp_Feed sp_TopicIcon
Zram Settings Fix
Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
1
2014/01/09 - 15:47
sp_Permalink sp_Print sp_EditHistory

This Script must be placed in /etc/init.d  with a "high" number : "90Zram"

If the kernel supports Zram (youhave to Add CONFIG_ZRAM=y; CONFIG_SWAP=y) the CM Zram Settings will work !

In build prop you must have the string "persist.service.zram="

0  = Disabled

10 = 10% of total ram

18 = 18% of total ram

etc. etc.

this string is modded by CM Zram Settings....

 

I tested on Crewrktablets_CM_10_1_Rel 1.2.4

Have Fun !

Yatto

 

#!/system/bin/sh
#
# ZRAM activation
#
# Copyright (C) 2012 The CyanogenMod Project
#      Author: Humberto Borba <humberos@gmail.com>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

### Zram Reset
busybox echo 0 > /sys/block/zram0/disksize
busybox echo "[ZRAM]: DISABLING";
busybox echo 1 > /sys/block/zram0/reset
busybox echo "[ZRAM]: OFF";
###

ZRAM="persist.service.zram"

if [ "$(getprop $ZRAM)" = "0" ]; then

    busybox echo "[ZRAM]: NOT ACTIVATED.";
    exit 1

else

    busybox echo "[ZRAM]: INIT";

    if ! busybox test -e /sys/block/zram0/disksize ; then

        busybox echo "[ZRAM]: ERROR unable to find /sys/block/zram0/disksize";
        busybox echo "[ZRAM]: NOT ACTIVATED IN KERNEL.";
        exit 1

    else

        ZRAM_VALUE="$(getprop $ZRAM)"
        busybox echo "[ZRAM]: ZRAM_VALUE $ZRAM_VALUE";

       
       
        DISKSIZE_VALUE="$(getprop $DISKSIZE)"
        MEMTOTAL="$(grep MemTotal /proc/meminfo | awk ' { print $2 } ')"
        busybox echo "[ZRAM]: MEMTOTAL $MEMTOTAL";
        let "DISKSIZE_VALUE=MEMTOTAL*ZRAM_VALUE/100*1024"
       
        busybox echo "[ZRAM]: DISKSIZE $DISKSIZE_VALUE";

        if (( "$DISKSIZE_VALUE" > 0 )) ; then

            busybox echo "[ZRAM]: Setting ZRAM disksize.";
            busybox echo $DISKSIZE_VALUE > /sys/block/zram0/disksize

            busybox echo "[ZRAM]: Starting ZRAM.";
            busybox mkswap /dev/block/zram0
            busybox swapon /dev/block/zram0
            busybox echo "[ZRAM]: ACTIVATED.";

        else

            busybox echo "[ZRAM]: Invalid Disk Size.";
            exit 1

        fi

    fi

fi

exit 0

The following users say thank you to yattodettaman for this useful post:

netlars
Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
2
2014/01/09 - 16:13
sp_Permalink sp_Print

Hi Yatto,

many thanks for the script, looks nice especially for our old low ram tablets!

Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
3
2014/01/09 - 16:30
sp_Permalink sp_Print

You're Right !

On my Mediacom 810c (M803HC) zram is very useful !

to check how zram is working find "Zram Status" on google play !

 

Remember to add to the kernel ZRAM and SWAP ! Id does not work only with ZRAM, without SWAP

 

regards

 

Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
4
2014/01/09 - 16:51
sp_Permalink sp_Print

One more question, for swapping a swap partition is needed?


Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
5
2014/01/09 - 17:06
sp_Permalink sp_Print

No Swap partition is not needed.

Only swap support (kernel driver) is needed

CONFIG_SWAP=y

 

CONFIG_ZRAM=y
CONFIG_ZRAM_DEBUG=y

this line is not activated : # CONFIG_MTD_SWAP is not set

 

Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
6
2014/01/09 - 17:16
sp_Permalink sp_Print sp_EditHistory

Fine..

do you know what happens if a ZRAM enabled kernel is used on a Rom without ZRAM support?

I'll only ask because if we make this changes to our kernel base, then it would be bad if we had to have two kernel defconfigs and kernel builds, one for ZRAM enabled build and one for the older ones.

 

I think that it makes no difference, but only to be sure..

Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
7
2014/01/09 - 17:22
sp_Permalink sp_Print sp_EditHistory

If you have a kernel with zram enabled, but you have a rom without zram support, simply you don't use zram. It's like you have Zram disabled in cm10.1 zram settings with the kernel with zram support

 

if you look at the script, there are two lines

busybox mkswap /dev/block/zram0
busybox swapon /dev/block/zram0

 

If you don't run these command it's like you dont'have zram kernel. The Ram is not allocated.

I think you can make a base kernel with zram support.

 

Try and test.

;)

 

Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
8
2014/01/09 - 17:28
sp_Permalink sp_Print

You can be sure that I will do that.

 

Many Thanks for this!

Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
9
2014/01/09 - 17:32
sp_Permalink sp_Print sp_EditHistory

Let me know how it works !

;)

 

Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
10
2014/01/10 - 08:45
sp_Permalink sp_Print

Tryed ?! :D

Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
11
2014/01/10 - 09:31
sp_Permalink sp_Print

not me, but I made a zRam enabled XPress kernel for Netlars...

 

Really nice, it works fine!Laugh

We put this into the next CM10.1 release, and I will rebuild all custom kernel with zRam enabled the next days.

Avatar
yattodettaman

Contributor
Forum Posts: 36
Member Since:
2013/02/27
sp_UserOfflineSmall Offline

Thanks Received: 13
12
2014/01/10 - 10:15
sp_Permalink sp_Print

Good.

I'm happy you like Zram.

:D

The following users say thank you to yattodettaman for this useful post:

JochenKauz
Avatar
JochenKauz

Moderator

Firmware Guru
Forum Posts: 450
Member Since:
2012/11/19
sp_UserOfflineSmall Offline

Thanks Received: 76
13
2014/01/13 - 23:08
sp_Permalink sp_Print

Hi Yatto,

now I can give a personal feedback.

I have installed the CM10.1 with my new zRam enabled homebrew kernel on the Odys NeoX8.

And what could I say, it's amazing!! Never seen it so responsible, it works like a charm.

Great work!

Forum Timezone: Europe/Paris

Most Users Ever Online: 749

Currently Online: Gnostyk, jblanco711, kizzar07, Otura
218 Guest(s)

Currently Browsing this Page:
1 Guest(s)


Devices in use: Desktop (196), Phone (24), Tablet (2)

Top Posters:

Oma7144: 5790

globula_neagra: 2424

finless: 604

DarthJabba: 551

exelletor: 450

JochenKauz: 450

cracktech: 432

maikal: 394

Newest Members:

Pierre77777

Krikke46

gilesrm

CrunCher

Topgun777

almanori76

Forum Stats:

Groups: 10

Forums: 185

Topics: 5916

Posts: 58878

 

Member Stats:

Guest Posters: 43

Members: 256584

Moderators: 5

Admins: 1

Administrators: admin

Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech


CrewRKTablets moderators: JochenKauz and Astralix