init.d works great, after a small fix of Ryuinferno script - Android General

Hi all,
Unfortunatelly, I'm not allowed to reply to developer posts anymore.
I have to admit that I was inactive quite a while, but I hope someone can reuse my quick fix
and maybe someone could move this post to it's right place.
First of all, thanks to Ryuinferno for the init.d enable script.
[MOD][APK+SCRIPT+ZIP] Enable Init.d for Any Phones w/o Need of Custom Kernels!!!
Finally it works for me very good !!!
The problem was:
/system/bin/sysinit couldn't find run-parts,
so I added the path to the PATH export, and :good:
I modified the downloaded term-init.sh just a little bit.
Changed (line 108 & line 121, line 109 & line 122 optional)
Code:
echo "export PATH=/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysinit
echo "run-parts /system/etc/init.d" >> /system/bin/sysinit
To
Code:
echo "export PATH=/su/xbin:/sbin:/system/sbin:/system/bin:/system/xbin" >> /system/bin/sysinit
echo "logwrapper run-parts /system/etc/init.d" >> /system/bin/sysinit
Have fun...
It is better to change the script before you run it,
otherwise you have to change the file /system/bin/sysinit afterwards.
kind regards
Gerry

Related

[Q] Desperately need help running CWM Shell scripts

I need help figuring out why one script runs and another does and it doesn't help with the fact that I'm still quite new to Shell Scripting, let alone running them in CWM on Android devices.
Here's my problem:
This works:
Code:
#!/sbin/sh
busybox echo "#BlahBlahBlah" >> /system/build.prop
This will not:
Code:
#!/sbin/sh
busybox sed -e '/#BlahBlahBlah/d' /system/build.prop > /system/build.prop.bak
Yet, the above WILL run inside the OS. If I boot up fully and use something like Script Manager or Busybox Installer (the script running function) and run the above... it works.
But, in CWM, it doesn't.
I'm trying to use this to make an uninstaller for certain mods that write to the build.prop. So far, my only method for doing this is to copy over a new, unmodded build.prop, which is not very elegant and only works for one type of phone.
Any help would be greatly appreciated
Kryten2k35 said:
I need help figuring out why one script runs and another does and it doesn't help with the fact that I'm still quite new to Shell Scripting, let alone running them in CWM on Android devices.
Here's my problem:
This works:
Code:
#!/sbin/sh
busybox echo "#BlahBlahBlah" >> /system/build.prop
This will not:
Code:
#!/sbin/sh
busybox sed -e '/#BlahBlahBlah/d' /system/build.prop > /system/build.prop.bak
Yet, the above WILL run inside the OS. If I boot up fully and use something like Script Manager or Busybox Installer (the script running function) and run the above... it works.
But, in CWM, it doesn't.
I'm trying to use this to make an uninstaller for certain mods that write to the build.prop. So far, my only method for doing this is to copy over a new, unmodded build.prop, which is not very elegant and only works for one type of phone.
Any help would be greatly appreciated
Click to expand...
Click to collapse
Same problem here; have you found a solution?

Need help

I have some scripts in my init.d folder, but when i check it on init.d log file.. it doesn't work. I do same as tutorial that i got here.. but it said "nonexistent directory" . Is there anyone know why?
I still confused because two of my scripts (zipalign & loopy_smoothness) are working.. but not for the other..
Here one of my tweaks :
#!system/bin/sh
echo "64" > /sys/module/lowmemorykiller/parameters/cost
echo "0,1,2,4,9,15" > /sys/module/lowmemorykiller/parameters/minfree
echo "0" > /sys/module/lowmemorykiller/parameters/debug_level
The log file said " nonexistent directory "..
Thanks before.. and sorry for my bad english..
Using Hisense E-860

ARHD 7.x random reboots - solved?

Hello, I'm a long time user but a bit of a lurker but have been flashing custom ROMs for some time. Hence my post count is <10 and cannot post in the dev forums to contribute...
I noticed other users in the ARHD 7.x thread are having random reboot issues - http://forum.xda-developers.com/showthread.php?p=39586309#post39586309 - which I was suffering from too. I've been using ARHD since the 6.x days and it's a great ROM!
The new ARHD 7.x was a bit of a let down due to the random reboots. After trying all manner of things, it seems it might be one of two things. I've reflashed and not selected a couple of tweaks in the Aroma installer. So far i've been running for a few days with no reboots.
I've not chose to apply the memory/multitasking tweak and the build.prop tweaks. Not sure which of the two was the cause....
The build.prop tweaks apply these:
I doubt the nocheckin value has anything to do with the random reboots, I'm either suspecting the deeper sleep or bypassing of the kernel error checking? Perhaps a kernel panic is causing the sudden lockup and then reboot. Perhaps the "lock up" we perceive, is the phone doing a core dump?
Code:
#!/sbin/sh
# Extra tweaks for build.prop
echo "# EXTRA TWEAKS" >> /system/build.prop
echo "# Disable Sending Usage Data" >> /system/build.prop
echo "ro.config.nocheckin=1" >> /system/build.prop
echo "# Deeper Sleep" >> /system/build.prop
echo "pm.sleep_mode=1" >> /system/build.prop
echo "# Disable Kernel Error Checking" >> /system/build.prop
echo "ro.kernel.android.checkjni=0" >> /system/build.prop
The multi-tasking tweak applies these values....
I'm not sure if it could be these values being aggressive.
Code:
#!/system/bin/sh
# ========================================
# init.d script for Android Revolution HD
# ========================================
# Tweak minfree values for better multi-tasking
echo 1536,2048,3584,5120,8704,10240 > /sys/module/lowmemorykiller/parameters/minfree
I'll have to test these in the adb shell and see how the phone performs. Will keep you posted.

[SCRIPT] Lagg Nullifier - Get rid Of That Lagg!

Hello Guys & Gals of XDA, I Bring to You My Custom Script That I dident Place in this Thread as things Get DeBumped Pretty Quick So i Placed it in Xperia Play Android Development,
This Script is Aimed to Get ridd of Laggs not Increase your FPS! - Also might not show Performance on Good Roms and Or Roms with Good Scripts,
Also a little Note:
Use the Universal Version if You Dont have 512 Mb Of Ram (Universal Removes LMK Settings)
Thread is Located Here:
http://forum.xda-developers.com/showthread.php?t=2319774
Can I run this on linaro slim beanz is the starter script fixed
ss beanz T989
hatememarkz said:
Can I run this on linaro slim beanz is the starter script fixed
ss beanz T989
Click to expand...
Click to collapse
Yea, Everything works, But use the Universal Version , Also make a backup as i dont have a remover and if the starter dosent work copy this into your build.prop:
# Pro-Tuned ADJ 1.2 by LENAROX
ro.FOREGROUND_APP_ADJ=0
ro.VISIBLE_APP_ADJ=4
ro.PERCEPTIBLE_APP_ADJ=3
ro.HEAVY_WEIGHT_APP_ADJ=2
ro.SECONDARY_SERVER_ADJ=15
ro.BACKUP_APP_ADJ=5
ro.HOME_APP_ADJ=6
ro.HIDDEN_APP_MIN_ADJ=3
ro.EMPTY_APP_ADJ=15
# Kernel Stabalizer;
dalvik.vm.checkjni=false
debug.kill_allocating_task=0
# Nitro Lagg Nullifier;
ENFORCE_PROCESS_LIMIT=false
MAX_SERVICE_INACTIVITY=false
MIN_HIDDEN_APPS=false
MAX_HIDDEN_APPS=false
CONTENT_APP_IDLE_OFFSET=false
EMPTY_APP_IDLE_OFFSET=false
MAX_ACTIVITIES=false
ACTIVITY_INACTIVE_RESET_TIME=false
MAX_RECENT_TASKS=false
MIN_RECENT_TASKS=false
APP_SWITCH_DELAY_TIME=false
MAX_PROCESSES=false
PROC_START_TIMEOUT=false
CPU_MIN_CHECK_DURATION=false
GC_TIMEOUT=false
SERVICE_TIMEOUT=false
MIN_CRASH_INTERVAL=false
Hi there, you might have seen my name, you might not, but it doesn't matter...but I come here in peace, wanting to get things clarified...
Regarding your Starter Kit, all it does is setprop, so why is
Code:
sleep 60
needed? Users will see a "jammed" screen for a minute...and another thing, to add lines to build.prop, setprop is not sufficient as most of the values will be reset after a reboot...you should have done this:
Code:
echo "ro.FOREGROUND_APP_ADJ=0" >> /system/build.prop
or something similar...
Now for your main Lagg_Nullifier_Gen_2.sh.pdf, I still see a lot of sleep commands being used....whereas the script can be completed within seconds...not every command requires you to wait that long...this is essential especially when you request users to convert this into an init.d script...it extends boot time and possible initial lags right after a reboot...and certain parts of the script contains unused lines which does nothing, like this:
Code:
while true; do
FREEMEM=`free | awk '{ print $4 }' | sed -n 2p`
FREEMEMMB=$(($FREEMEM/1024))
MFK=`cat /proc/sys/vm/min_free_kbytes`
MFKMB=$(($MFK/1024))
MFKMB1=$(($MFKMB+16))
MFKMB2=$(($MFKMB+32))
if [ "$FREEMEMMB" -lt $MFKMB1 ]
then
echo "done!"
It is just to calculate your free RAM...and if FREEMEMMB is lesser than MFKMB1, it just prints out "done!"...and nothing else...or I should say you have not integrated the script fully...another example is the drop cache lines...that is only needed after the system cache has accumulated after a certain period of usage, then it will be cleared...that was the initial purpose...so if you want users to use this script at boot, the drop cache part is not needed...
My suggestion is that your script generates another script in init.d, like V6 Supercharger to avoid conflicts...
Ryuinferno said:
Hi there, you might have seen my name, you might not, but it doesn't matter...but I come here in peace, wanting to get things clarified...
Regarding your Starter Kit, all it does is setprop, so why is
Code:
sleep 60
needed? Users will see a "jammed" screen for a minute...and another thing, to add lines to build.prop, setprop is not sufficient as most of the values will be reset after a reboot...you should have done this:
Code:
echo "ro.FOREGROUND_APP_ADJ=0" >> /system/build.prop
or something similar...
Now for your main Lagg_Nullifier_Gen_2.sh.pdf, I still see a lot of sleep commands being used....whereas the script can be completed within seconds...not every command requires you to wait that long...this is essential especially when you request users to convert this into an init.d script...it extends boot time and possible initial lags right after a reboot...and certain parts of the script contains unused lines which does nothing, like this:
Code:
while true; do
FREEMEM=`free | awk '{ print $4 }' | sed -n 2p`
FREEMEMMB=$(($FREEMEM/1024))
MFK=`cat /proc/sys/vm/min_free_kbytes`
MFKMB=$(($MFK/1024))
MFKMB1=$(($MFKMB+16))
MFKMB2=$(($MFKMB+32))
if [ "$FREEMEMMB" -lt $MFKMB1 ]
then
echo "done!"
It is just to calculate your free RAM...and if FREEMEMMB is lesser than MFKMB1, it just prints out "done!"...and nothing else...or I should say you have not integrated the script fully...another example is the drop cache lines...that is only needed after the system cache has accumulated after a certain period of usage, then it will be cleared...that was the initial purpose...so if you want users to use this script at boot, the drop cache part is not needed...
My suggestion is that your script generates another script in init.d, like V6 Supercharger to avoid conflicts...
Click to expand...
Click to collapse
Code:
FREEMEM=`free | awk '{ print $4 }' | sed -n 2p`
FREEMEMMB=$(($FREEMEM/1024))
MFK=`cat /proc/sys/vm/min_free_kbytes`
MFKMB=$(($MFK/1024))
MFKMB1=$(($MFKMB+16))
MFKMB2=$(($MFKMB+32))
this part happens to be(and it was mine) in my first version of mpengine script..just saying
Oh.. and 'ro.' means do not change value when its property was set ONCE.

INIT.D SUPPORT Kernel method *adds INIT.D folder*

HI guys
I just discovered a way to make init.d work on my rom and it should work on other roms as long as everything is followed down to the T
Basically there are 5 things you need to do
1: BootImageExtractor *links to follow* need to get it from my other laptop
2: Notepad++ *ask google*
3: Rashr *or any other apps that can flash kernels I just use this one*
4: Rooted Device
5: Rootexplorer *or any apps that let you dig deep into the root of THE android*
Ok lets start
First up is to unpack your boot.img and you should see your RAMDISK folder
now go ahead and look for init.rc and open it with notepad++ now add this code either at the very top or below the import scripts.
Code:
import /init.d.sh
You can use any name really as long as you have the same import script and name of the sh file
Now on to the next step which is to create a .sh file
Open up notepad++ and add this code in
Code:
#!/system/bin/sh
on property:sys.boot_completed=1
start sysinit
service sysinit /sbin/sysinit.sh
oneshot
class late_start
user root
group root
disabled
Now save as and use all types and name it init.d.sh and be sure its in the ramdisk folder
Having fun yet?
now last but not the least the sysinit.sh file!
same method as above but with a different code and is saved in the sbin folder
Code:
#!/system/bin/sh
mount -o remount,rw /;
mount -o rw,remount /system
# init.d support
if [ ! -e /system/etc/init.d ]; then
mkdir /system/etc/init.d
chown -R root.root /system/etc/init.d
chmod -R 755 /system/etc/init.d
fi
# start init.d
for FILE in /system/etc/init.d/*; do
sh $FILE >/dev/null
done;
And there you have it folks!
I would like to credit where I got the idea from but alas the guy who gave me the boot.img says he got it from another site and got it randomly.... so would like to thank my buddy Car *actually a human not a machine*
I already tried using the 00test script by Ryuinferno to see if it works and after two reboots I found the test log file in /data
I am new at this so please be gentle and I am still working on this because I want to integrate the scripts of Ryuinferno into the kernel *scripts being the 00test and the 00setperm* he will allow me to use them.
Again thanks XDA! my new home
Feedback please ^_^
Reserved
Where is the difference to the easy to use apps from other devs?
-CALIBAN666- said:
Where is the difference to the easy to use apps from other devs?
Click to expand...
Click to collapse
This is just an alternate method
and there are some phones who cant get init.d to work even with the universal init.d app * i know cause my device has that problem*
I am not saying those apps are not working, infact I use those when I help mates with their phones performance *its easier yes*
and this is something like kernel injection so just flashing a kernel will add init.d and would/could be useful for some devs or guys who just want to know how things tick *like me*
Ok,cool,thanx for answer bro.greeetz!
Working...
Thanks

Categories

Resources