Guest User

Untitled

a guest
Jun 23rd, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.14 KB | None | 0 0
  1. #!/system/bin/sh
  2. # imoseyon mods
  3.  
  4. # disable logger - performance boost & save memory (hopefully)
  5. rm /dev/log/main
  6.  
  7. # file system speedups
  8. busybox mount -o remount,noatime,barrier=0,nobh /system
  9. busybox mount -o remount,noatime,barrier=0,nobh /data
  10. busybox mount -o remount,noatime,barrier=0,nobh /cache
  11.  
  12. # aggressive memory management
  13. echo "3000,4000,10000,10000,20000,20000" > /sys/module/lowmemorykiller/parameters/minfree
  14.  
  15. # overclock (example)
  16. #sh /data/imoseyon/oc.sh
  17.  
  18. SAMPLING_RATE=$(busybox expr `cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency` \* 750 / 1000)
  19. echo 95 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
  20. echo $SAMPLING_RATE > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
  21.  
  22. # sysctl tweaks
  23. sysctl -p /data/imoseyon/sysctl.conf
  24.  
  25. # zipalign system if necessary (example)
  26. # sh /data/imoseyon/zipalign_system.sh
  27.  
  28. # enable crond
  29. # crond calls getpwnam (user database search)
  30. mount -o remount,rw `grep /system /proc/mounts | cut -d' ' -f1` /system
  31. echo "root:x:0:0::/data/cron:/system/bin/sh" > /etc/passwd
  32. mount -o remount,ro `grep /system /proc/mounts | cut -d' ' -f1` /system
  33. # crond has "/bin/sh" hardcoded
  34. mount -o remount,rw rootfs /
  35. ln -s /system/bin/ /bin
  36. if [ ! -d /tmp ]; then
  37.   mkdir /tmp
  38.   mount -t tmpfs tmpfs /tmp
  39. fi
  40. mount -o remount,ro rootfs /
  41. /system/xbin/startcron.sh
  42.  
  43. # clean-up - needed for some ROMs
  44. pkill /system/bin/telnetd
  45. mount -o remount,rw -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
  46. rm /system/bin/pgrep
  47. rm /system/bin/telnetd
  48. rm /system/bin/crond
  49. mount -o remount,ro -t yaffs2 `grep /system /proc/mounts | cut -d' ' -f1` /system
  50.  
  51.  
  52. # sleep a while and then start killing annoying processes registered to zygote
  53. # sleep 10
  54. #sh /data/imoseyon/killapps.sh
  55.  
  56. # if swapfile exists, enable swap and adjust other settings
  57. if [ -f /data/swap ]; then
  58.   swapon /data/swap
  59.   echo "100,200,20000,20000,20000,25000" > /sys/module/lowmemorykiller/parameters/minfree
  60.   sysctl -w vm.swappiness=40
  61. fi
  62.  
  63. # sd card speed boost
  64. if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]; then
  65.   echo 1024 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
  66. fi
Add Comment
Please, Sign In to add comment