Forum switched to read-only as of 2020/06/01
Latest product reviews |
---|
![]() |
![]() |
Smartphones ![]() |
TV Connect ![]() |
![]() |
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 !


Contributor
2013/02/27

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

Moderator

Firmware Guru
2012/11/19

Hi Yatto,
many thanks for the script, looks nice especially for our old low ram tablets!
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!


Moderator

Firmware Guru
2012/11/19

One more question, for swapping a swap partition is needed?
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!


Moderator

Firmware Guru
2012/11/19

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..
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!


Contributor
2013/02/27

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.


Moderator

Firmware Guru
2012/11/19

You can be sure that I will do that.
Many Thanks for this!
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!


Moderator

Firmware Guru
2012/11/19

not me, but I made a zRam enabled XPress kernel for Netlars...
Really nice, it works fine!
We put this into the next CM10.1 release, and I will rebuild all custom kernel with zRam enabled the next days.
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!


Moderator

Firmware Guru
2012/11/19

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!
Per aspera ad astra, we rock the Tablets !
If you like our firmwares, please consider making a donation to support our work.
Thank you!
Most Users Ever Online: 803
Currently Online:
67 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Devices in use: Desktop (61), Phone (6)
Top Posters:
finless: 604
DarthJabba: 551
maikal: 394
mussonero1: 350
alex: 252
damo: 243
DanielVd: 237
Mark06: 222
Newest Members:
edds1
andreive
hans41
rickybk
soniya07
ironmangitar
Forum Stats:
Groups: 10
Forums: 185
Topics: 6037
Posts: 60500
Member Stats:
Guest Posters: 43
Members: 262194
Moderators: 5
Admins: 1
Administrators: admin
Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech
CrewRKTablets moderators: JochenKauz and Astralix