Related
DROID X2 init.d hack
This is an alternative to a certain 2nd init functionality, because with 2nd init you could do this just as easily if you know how. This is not an init. This is for the folks running stock 2.3.3 for the Droid X2, who want to "performance tune" their phone while working with what they have. This will allow you to use any init.d performance scripts on your phone. If you don't know, an "init.d" script is special in the sense that they are run when the phone is booting up. This way, when you are using your phone, you can enjoy performance benefits.
The "hack" runs the BusyBox "run-parts" binary and searches the /system/etc/init.d directory for scripts. Additionally, if for whatever reason you don't have BusyBox, it will fall back to a for loop and run that instead! This functionality is added through "install-recovery.sh" script in /system/etc which is run every time the phone boots by default. Normally this script tries to install the default recovery every time you boot your phone, so that you can't install any other recovery. I've hijacked that script for the init.d task instead. As is common practice, any script actions can be viewed in your logcat upon boot if you have USB debugging enabled.
This hack includes default enhancement scripts (outlined below). You can choose to use these scripts, or delete them and replace them with whatever you want. I would advise against running the default scripts with other tweak scripts!
Requirements:
Root - follow the guides
Bootstrap Recovery - follow the guides
Knowledge of CWMR/Bootstrap Recovery use, and how to install a zip with it
Default Enhancements:
sysctl tweaks - try to speed up OS/virtual machine/kernel
lowmem tweaks - try to limit low memory so as to keep more memory available
sd read ahead - increase KB read ahead on SD reads
cpu/governor tweaks - set scaling_min/max_freq and governor
disk scheduler - optimize disk scheduler for flash memory across all blocks
---
Changelog
0.1
Initial release to public
0.2
Tweaked scheduler and send errors to null
0.3
Fixed scheduler bug
Added additional scheduler tweaks
Changed min_free_kbytes to 32mb
Changed bdi read_ahead_kb to 2048kb
Added system r/w mount
Added sync
0.4
Added quantum to scheduler tweak
Switch to noop scheduler
Added conditionals
Change CPU tweak to support cpu1
Change scaling_min to proper freq
0.5
Split script into 3 versions
Battery - most power savings
Midrange - balanced power savings/performance
Performance - all out speed
0.6
Combined script back into one generic version
Includes separate scripts for all purposes
Enhances prior scripts functionality
Rewrote init.d hook to work in all scenarios
Included BusyBox 1.19 with installation
0.6b
Updated script to fix unique error
---
Version 0.6b FINAL
Download: http://www.multiupload.com/FI1D93TV6Y
Mirror: http://www.mediafire.com/?71geufr3754j6be
amazing! should usher in a ton more dev for the X2
Great to hear from you again navenedrob! Loved your work on the fascinate.
Sent from my DROID X2 using XDA Premium App
Will this have any ill effects with the eclipse rom?
Sent from my DROID X2 using XDA App
Its for stock roms as stated in the 1st post
Sent from my DROID X2 using XDA App
Getting ready to run this but just want to clarify:
Install like any other. zip?
Use script manager to tweak values?
How to revert, if necessary?
Remove v6 supercharger before installing?
Thanks again.
Sent from my DROID X2 using XDA Premium App
garywojdan81 said:
Getting ready to run this but just want to clarify:
Install like any other. zip?
Use script manager to tweak values?
How to revert, if necessary?
Remove v6 supercharger before installing?
Thanks again.
Sent from my DROID X2 using XDA Premium App
Click to expand...
Click to collapse
Yes
Yes
Delete scripts from /system/etc/init.d, that's it
Optional
Kanibull said:
Its for stock roms as stated in the 1st post
Sent from my DROID X2 using XDA App
Click to expand...
Click to collapse
You can use this on Eclipse ROM. That is a stock ROM. A non-stock ROM would be a stock ROM with this or 2nd init already included, CM7, or MIUI.
Thanks man. Gonna load it as soon as I get back home.
Sent from my DROID X2 using XDA Premium App
Would using this allow zepplelinrox's 98kickasskernel to work as it should?
So are these scripts already optimized or are they stock values waiting to be tweaked? Is there some kind of guide as to exactly what the numbers mean or could you recommend some? Thanks!
Sent from my DROID X2 using XDA App
ashclepdia said:
Would using this allow zepplelinrox's 98kickasskernel to work as it should?
Click to expand...
Click to collapse
Wow, yeah it should indeed.
This should be posted at droidforums and droidxforums!
I have a few questions.
Using Script Manager I had to modify/change most of my scripts because Script Manager would try to run them and simply state there were syntax errors, which was simply not the case because on my oringial droid I could verify they would run using init.d and they would work.
So my question there is what's with the syntax error in script manager, and will my original scripts work? Second, are these automatically run as root...or?
zeppelinrox said:
Wow, yeah it should indeed.
This should be posted at droidforums and droidxforums!
Click to expand...
Click to collapse
If it hasn't already been done by the time im done eating ill get to linking up to share the goodness. Thanks for quick reply zepp.
Good stuff...
I know for a fact that they will be all over this like brown on poo at droidx...
0vermind said:
I have a few questions.
Using Script Manager I had to modify/change most of my scripts because Script Manager would try to run them and simply state there were syntax errors, which was simply not the case because on my oringial droid I could verify they would run using init.d and they would work.
So my question there is what's with the syntax error in script manager, and will my original scripts work? Second, are these automatically run as root...or?
Click to expand...
Click to collapse
Which busybox version?
That Rom you where talking about
What kind of Rom would it be, would be an aosp?
zeppelinrox said:
Which busybox version?
Click to expand...
Click to collapse
v1.19.0.git.adrynalyne
Installed in /system/xbin
0vermind said:
I have a few questions.
Using Script Manager I had to modify/change most of my scripts because Script Manager would try to run them and simply state there were syntax errors, which was simply not the case because on my oringial droid I could verify they would run using init.d and they would work.
So my question there is what's with the syntax error in script manager, and will my original scripts work? Second, are these automatically run as root...or?
Click to expand...
Click to collapse
I'm not sure what Script Manager is, so I can't really answer. All I can say is that I write all my scripts by hand, and they are all common shell scripts using bash language. As long as your shell scripts are written according to those specs, then I don't think you'd have any problems.
Anyone else, remember that you can use whatever init.d scripts you want, it shouldn't really matter as long as they somewhat pertain to the phone. Feel free to delete the included scripts.
Okay I set it all up and none of the scripts ran, so I did
Code:
/system/xbin/run-parts /system/etc/init.d > /data/initd.log
in adb and got back
run-parts: applet not found
Click to expand...
Click to collapse
What am I doing wrong?
After many hours of screwing around, I figured out how to get around your busybox run-parts thing which doesn't seem to be working on my phone. In it's place I put:
Code:
if [ -e /system/etc/init.d ]
list=`ls /system/etc/init.d/*`
for script in $list
do
sh $script
done
fi
Everything is working awesome now!! They really do seem to be running at start up!
This is something I realized when the init.d hack by naven was posted, it plain didn't work for me, and after some investigation i discovered that not all busybox versions had the run-parts applet.
It has come to my attention to that many users may not have the proper hack installed, at least the ones using my scripts, I had them check in /data for the zipaplign log and it was in fact not there.
I got it working by modding navens hack. Credit goes to him for his discovery.
Here is a link to the flashable zip. If you are using my scripts, check in /data for the zipalign log, if you don't have one, just flash this zip, reboot, and check again.
http://www.sendspace.com/file/9g6ngz
Thanks!
Edit (8/31/2011): Just so there is no confusion, this is not my new Speedy script, this is just a re-hack for init.d originally discovered by naven. This will just help those of you having problems with his hack. Obviously you need to be rooted and have recovery bootstrap.
Just flashed your zip. Log file in /data
Welcome back! Thanks for your work on the X2.
Sent from my DROID X2 using xda premium
Grapejelly!!
Sent from my DROID X2 using xda premium
Worked perfectly
Sent from my DROID X2 using XDA App
Is this a new version of your script then?
Do we have to flash this the same way with recovery (aka renaming it to update.zip) like i had to go with the manual gb update?
Nevermind, figured that out.. but why am i getting a signature verification on install? Where do i turn off sig verification?
SuBDivisions said:
Nevermind, figured that out.. but why am i getting a signature verification on install? Where do i turn off sig verification?
Click to expand...
Click to collapse
There is an option under advanced I think, in recovery, to enable/disable that.....
I dont have that option, unless now there is some other recovery peice im missing.. my recovery whichis Android System Recovery (3e) only has reboot, apply update, wipe data, wipe cache.
SuBDivisions said:
I dont have that option, unless now there is some other recovery peice im missing.. my recovery whichis Android System Recovery (3e) only has reboot, apply update, wipe data, wipe cache.
Click to expand...
Click to collapse
You need to use the modified boot -strap recovery available on this forum. D/L it & install it like any other app. When you open it, just read & follow the directions on the screen & you will get to the custom recovery where all good things flash from.
Sent from my DROID X2 using xda premium
SuBDivisions said:
I dont have that option, unless now there is some other recovery peice im missing.. my recovery whichis Android System Recovery (3e) only has reboot, apply update, wipe data, wipe cache.
Click to expand...
Click to collapse
You should be flashing this thru the Bootstrap Recovery, not the default Android Recovery.
Sent from my DROID X2 using Tapatalk
Ahh HA.. See i know i was missing something.. Thanks have been given.
Zip-align logs were not showing in /data/ for me, so I flashed this, and now they do.
I'm assuming that means the rest of the scripts weren't working either?
Cool. Going to flash this but need a quick question answered.
I have Busybox 1.19.0 installed. I downloaded "Busybox" from marketplace to install 1.18.4 but which location should I chose?
Options are /system/xbin/ or /system/bin/
Thanks
Sorry found this in original init.d hack thread:
BusyBox with run-parts binary, installed in /system/xbin - If you don't have BusyBox, you can download it from the market here.
Click to expand...
Click to collapse
hapyman said:
Cool. Going to flash this but need a quick question answered.
I have Busybox 1.19.0 installed. I downloaded "Busybox" from marketplace to install 1.18.4 but which location should I chose?
Options are /system/xbin/ or /system/bin/
Thanks
Sorry found this in original init.d hack thread:
Click to expand...
Click to collapse
You should be okay on 1.19.0 now, but busybox should always always be installed in xbin.
So which init is better or the working one?
gkitab said:
So which init is better or the working one?
Click to expand...
Click to collapse
Some people find that the re-hack (this thread) works (and the original does not), others find that the original hack works just fine. A way to test is to install my Speedy Gonzales scripts, reboot the phone, and then check in /data for a zipalign log. If not, then flash this re-hack.
I am running speedy. So should I us you init when using yours and his when trying his? How can we tell if yours is working and when using his if his is working? This is getting a bit confusing. I also noticed when I flashed speedy navens old oo got left behind. So I deleted al scripts in init folder and reflashed yours and all yours are now correct.
With his init and your script. Yours scripts are in there but no zipalign in data.
Should I start over by deleting unit folder flash your unit then speedy would that be the safe bet?
Thanks for staying.
gkitab said:
I am running speedy. So should I us you init when using yours and his when trying his? How can we tell if yours is working and when using his if his is working? This is getting a bit confusing.
Thanks for staying.
Click to expand...
Click to collapse
They are two separate things entirely. I posted the re-hack for those having troubles getting scripts to run with naven's original hack. The re-hack posted in this thread doesn't contain any init.d scripts, it's purely the hack. Like I said above, a good way to test his hack is to install my scripts (which it looks like you have), and then use a file manager like Root Explorer and navigate to /data, there should be a zipalign log, if there isn't then his hack isn't working.
Edit: Well, the biggest question is if the init hack you have installed is even working. I'm assuming you have naven's... try the above, let me know if the log is there or not.
I edited my post can you please check it and let me know what you think.
I do have his with your script.
I think I should I should delete init completely and start fresh with yours and your scripts. That sounds like safest bet. Or does naven init need to be there first then yours on top then your scripts. Thanks.
I was playing around with some scripts from Caulkin on some other versions of Froyo to try and improve performance. I have read up on the init.rc script and use of the init.d folder. I have set all this up and have edited the init.rc script to run the init.d scripts, but it gets overridden by the base init.rc on reboot. I had read somewhere that you cannot directly edit the init.rc and that it will be overridden on boot from the boot.img. Can someone confirm that? I thought most roms now have the ability to use init.d out of the box, but it doesn't look like it on Brilliant Corners. Can someone confirm that? Do you know of any Froyo ROMS, other than Caulkins, that has init.d capability? Thanks
markmac said:
I have set all this up and have edited the init.rc script to run the init.d scripts, but it gets overridden by the base init.rc on reboot.
Click to expand...
Click to collapse
Are you using the run-parts program?
I had read somewhere that you cannot directly edit the init.rc and that it will be overridden on boot from the boot.img. Can someone confirm that?
Click to expand...
Click to collapse
That's correct.
Thanks for the response. I was editing the init.rc directly which obviously won't work. So i need to look into building my own boot.img or another option. I was using run-parts setup as a service. I would have thought most kernels/ROMs would support this now, but it does not appear that way.
markmac said:
So i need to look into building my own boot.img or another option.
Click to expand...
Click to collapse
You don't need to build your own new image; you can just modify the existing one by flashing. Take a look at the attachements in these 2 posts where I've done just that. Just make sure the script is idempotent if other people will use it.
Post 1
Post 2
Thanks will definitely check this out.
Looked at this. So to update the init.rc file I would have to edit and package into a boot.img file, then flash the img file with adb or nvflash correct?
markmac said:
So to update the init.rc file I would have to edit and package into a boot.img file, then flash the img file with adb or nvflash correct?
Click to expand...
Click to collapse
No. That's too much work for the user. My technique is meant to be like flashing a new kernel. No external utilities are needed. Just CWM (or, possibly, even standard recovery).
How do I remove dual core scripts... Or whatever is enabling them... I tried a couple kernels and still activated. Running eternity 1.4.2
Sent from my PG86100 using xda premium
Check your init.d folder for a file called 98dualcore, delete that. If you don't see anything, then your going to have to flash an unmodified stock kernel. Freeza has an explanation for that in his thread.
ceyo14 said:
How do I remove dual core scripts... Or whatever is enabling them... I tried a couple kernels and still activated. Running eternity 1.4.2
Sent from my PG86100 using xda premium
Click to expand...
Click to collapse
DDiaz007 said:
Check your init.d folder for a file called 98dualcore, delete that. If you don't see anything, then your going to have to flash an unmodified stock kernel. Freeza has an explanation for that in his thread.
Click to expand...
Click to collapse
Example: Ziggy's dual core kernel flash .zip file modifies thre system binaries in addition to the init.d script it adds. Kernel .zip files, imo, should not modify system binaries. System binaries should only be modified by ROMs. Of course, there is no official standard and this is just my opinion based on experience.
One main reason would be, majority of other kernel .zip files do not modify those same system binaries. So the only way to "undo" the files changed by Ziggy's kernel flash, would be to reload a ROM which replaces the three system binaries Ziggy changes.
Essentially, if you want to undo the changes made by Ziggy's kernel flash, you'll need to replace all files modified by his kernel flash. Flashing another kernel will not replace those files, but loading another ROM *should*.
Hope that helps!
wp_mod: Module to disable system write protection
This is a kernel module that disables write protection on the system partition while running the stock kernel.
HTC changed the MMC_MUST_PREVENT_WP_VIOLATION code to make it much harder to crack. I had to redo the module completely, so this is experimental. In the past, it was a simple matter of changing a variable, now we have to replace a function in the kernel so it returns something different, causing the kernel to skip over the write protection code.
I would caution against loading the module after attempting to make changes to the system partition. It could end up corrupting the filesystem. If the module is loaded at boot, there should be no worries.
This module will probably need to be updated to load with future kernels when they are released.
Please consider a donation to support ongoing development
Many thanks to those who have donated!
Download:
wp_mod for GPE Marshmallow 6.0 can be found here:
http://forum.xda-developers.com/htc-one-m8/general/root-root-marshmallow-gpe-supersu-t3242210
Sense 4.4.4 (thanks @migascalp):
http://www.mediafire.com/download/4vyqslnc4crsnto/wp_mod_3.28.401.6.zip
Sense 4.4.3 (2.22 base):
wp_mod.ko
Sense 4.4.2:
wp_mod.ko
GPE 4.4.4 (thanks to @italyforever):
wp_mod.ko
GPE 4.4.2:
wp_mod.ko
Installation:
Wait for it to be implemented in your favourite ROM
* or *
Copy the module to your device, and type
Code:
su
insmod /location-where-you-copied-it/wp_mod.ko
Changes:
April 2, 2014 - wp_mod 4.1
-only return non-existing partition number if called by generic_make_request_checks
-remove exit from module (we don't want to be able to unload it)
-clean up code
March 31, 2014 - wp_mod 4.0
-new method for HTC One m8
Source:
https://github.com/flar2/wp_mod
Module was compiled against m8 Google Play Edition source. Some symbol CRC checks had to be hexedited in the compiled module to match the stock kernel. Thanks to Michael Coppola for example of function hooking on arm: http://poppopret.org/2013/01/07/suterusu-rootkit-inline-kernel-function-hooking-on-x86-and-arm/#arm
Nice Job!!!! this is awesome
AWESOME! Thank you! Will test and see
Sent from my HTC One_M8 using XDA Premium 4 mobile app
Confirmed working here. I was able to delete stuff with titanium backup and it stuck after reboot. Thanks so much!
Sent from my M8 via XDA Premium app
So as an end user, before it gets baked into ROMs, we need to load this after each boot?
Worked here as well on the AT&T variant. I added the line to the install recovery script that chainfire uses for SuperSU and it loads it on boot now
what i did was run the insmod command in terminal emulator, made the system rw/ edited /system/etc/install-recovery.sh and added the insmod line in there Sure it would be easier if I had init.d support but I'm on stock and am too lazy to change to a custom rom
You guys are awesome.
Awesome work....Can now scratch my theming itch
Sent from my unknown using Tapatalk
gjlowe said:
So as an end user, before it gets baked into ROMs, we need to load this after each boot?
Click to expand...
Click to collapse
Nope. It'll get rolled into the kernel/scripts that are loaded at boot automagically.
M.
mattman83 said:
Nope. It'll get rolled into the kernel/scripts that are loaded at boot automagically.
M.
Click to expand...
Click to collapse
Hmmm..I ran the command in the OP and rebooted and when I try to create a directory in / it says that it is a read only file system.
graffixnyc said:
Worked here as well on the AT&T variant. I added the line to the install recovery script that chainfire uses for SuperSU and it loads it on boot now
what i did was run the insmod command in terminal emulator, made the system rw/ edited /system/etc/install-recovery.sh and added the insmod line in there Sure it would be easier if I had init.d support but I'm on stock and am too lazy to change to a custom rom
Click to expand...
Click to collapse
Can you share your zip please
Sent from my HTC One_M8 using Tapatalk
gjlowe said:
Hmmm..I ran the command in the OP and rebooted and when I try to create a directory in / it says that it is a read only file system.
Click to expand...
Click to collapse
You need to run it each time you boot, until it is correctly working as init.
mattman83 said:
Nope. It'll get rolled into the kernel/scripts that are loaded at boot automagically.
M.
Click to expand...
Click to collapse
Electronic Punk said:
You need to run it each time you boot, until it is correctly working as init.
Click to expand...
Click to collapse
Ok then, I guess @mattman83 was referring to when we have this in custom ROMs?
gjlowe said:
Ok then, I guess @mattman83 was referring to when we have this in custom ROMs?
Click to expand...
Click to collapse
Yup, I have already added it to my copy of ARHD 3.x and it is working great, so look for a release as soon as Mikes connection allows!
im on the vzw m8. we have temp 'root access' to /system/xbin. is it ok to do this as well? which will make /system writable?
-4ndr01d- said:
im on the vzw m8. we have temp 'root access' to /system/xbin. is it ok to do this as well? which will make /system writable?
Click to expand...
Click to collapse
I don't know what method they use to get root access to /system/xbin. This is probably compatible, if it loads with the Verizon kernel. Backup all your data and try it.
flar2 said:
I don't know what method they use to get root access to /system/xbin. This is probably compatible, if it loads with the Verizon kernel. Backup all your data and try it.
Click to expand...
Click to collapse
jcase has got us root access ...its only writable to /system/xbin and has to run on every boot. the app used is called WeakSauce
but i was thinking. once my phone boots up, i wait til i have root access, then download the file, place it in the correct directory, download terminal emulator and run the commands. then /system becomes writable until next reboot?
@flar2 nice job as always man!! :good:
awesome awesome awesome
looking forward to elementalx on the m8!
For users who have init.d support in their ROM. Flash this and your good to go
https://mega.co.nz/#!XINyDIrB!QcdP3sZJjgKAivkEa7iN8Jusx0e78T1rpA5PT7VGAxQ
Sent from my Note 3