Guest User

Untitled

a guest
Jul 18th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. root@android:/ # cat /system/etc/init.d/90zram
  2. cat /system/etc/init.d/90zram
  3. #!/system/bin/bash
  4. # auto zram activation init script with busybox search
  5. # by show-p1984
  6.  
  7. echo "[90ZRAM]: Firing up /system/etc/init.d/90zram";
  8.  
  9. if [ ! -e /sys/block/zram0/disksize ] ; then
  10. echo "[90ZRAM]: ERROR unable to find /sys/block/zram0/disksize";
  11. echo "[90ZRAM]: Is this a ZRAM kernel?";
  12. echo "[90ZRAM]: ZRAM NOT ACTIVATED. (404)";
  13. else
  14. #find busybox in /system
  15. bblocation=$(find /system/ -name 'busybox')
  16. if [ -n "$bblocation" ] && [ -e "$bblocation" ] ; then
  17. echo "[90ZRAM]: busybox found in:" $bblocation;
  18. echo "[90ZRAM]: Setting ZRAM disksize.";
  19. echo $((100*1024*1024)) > /sys/block/zram0/disksize
  20.  
  21. echo "[90ZRAM]: Starting ZRAM...";
  22. bblocation=${bblocation%/*}
  23. cd $bblocation
  24. ./busybox mkswap /dev/block/zram0
  25. ./busybox swapon /dev/block/zram0
  26.  
  27. echo "[90ZRAM]: ZRAM activated.";
  28. else
  29. echo "[90ZRAM]: ERROR! busybox not found!";
  30. echo "[90ZRAM]: Is busybox installed? Symlinks set?";
  31. echo "[90ZRAM]: ZRAM NOT ACTIVATED. (404)";
  32. fi
  33. fi
  34.  
  35. root@android:/ #
Add Comment
Please, Sign In to add comment