• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root Enhanced init.d/simulated run levels

Yoinx

Android Expert
This will enable an enhanced type of init.d, as well as a much more reliable execution of init.d. If anyone's interested. It should be able to flashed over top of any CM10.1 based rom that's currently being built for us. I only tested it on PAC though.

>>> [Link Removed as people reported issues, check newer posts] <<< this file adds the tweaks to your current rom
MD5: F6F0617F319D337918BDDBCF435DF1D8

What this will do:

Enhanced init.d built into the ramdisk. Gives the runlevels listed in /system/etc/init.d/S90user.rc (runs all .rc files at each run level to check for any matching cases, runs all other files at oncomplete for normal init.d action).

Also includes sqlite3 and zipalign binaries required for V6 supercharger, as well as the shell script for V6 supercharger /system/xbin/V6_SuperCharger*. I've also included my V6supercharger init.d script so the first boot will do so with my settings.

This will also disable the capacitive button backlights.

This also fixes the problem with /system/etc/init.qcom.post_boot.sh not executing, thus fixing mpdecision and thermald not starting on boot.


Using this in addition to the CWM image I modified will enable CWM to set it's date (minus whatever delay there was reboot) so that you stop getting backup dates in the 70s. Remember, don't this and dd the new recovery image at the same... Really, never flash something that play with the boot.img and recovery.img at the same, unless you like to cab flash. Do one, make sure everything still works, then do the other.

Note, this CWM image is not required for anything in the flashable zip to work. The flashable zip is required though to make the date set in this recovery image.

>>> [Link removed as people reported issues, check newer posts.] <<< This file replaces your current recovery with the time modified one. Requires the rom side script to do anything with the time.
MD5: af3d9eb5da008ddb97b3b0a9047608bc

Init.d adapted from http://forum.xda-developers.com/showthread.php?t=1671670

V6 supercharger as always from http://forum.xda-developers.com/showthread.php?t=991276

*DISCLAIMER*
I am not responsible for anything that happens. Your phone could melt, catch fire, ascend, or be stolen. The results could be unpredictable. I've tried to test what I could. This by no means makes this safe.

Good luck. I'm running both of these at the moment. They work for me. That doesn't mean they'll work for you.
 
So, I'm making some progress on this. I don't know if anyone is actually interested in something like this, as it's got limited uses for most people. The most obvious one would be carrying time over to recovery on shutdown (when using a modified CWM image). Which is what originally kicked me off on this quest... Which does actually work pretty well. I'm thinking about doing some checking once the boot process is complete for mpdecision and thermald and starting them if they aren't running, since mpdecision makes a HUGE difference in battery life.

The thing that I'm unsure of is this... I have to modify the boot image's ramdisk in order to play with init.rc. The boot image is overwritten with each rom flash. I'm using the anykernel updater method to update the ramdisk independent of the kernel.

So really, what I'm wodering is how often is the ramdisk on builds really changed? Is it changed often enough that using a generic ramdisk from a recent build would potentially break something? Or is it changed seldom enough that it shouldn't be a huge deal?
 
I don't often see ramdisk changes from nightly to nightly. Most changes happen at the zImage level if there is a change to boot.img at all. On rare occasion, something may get changed if a new /bin gets added into the rom, but how often does that really happen?
 
Alright, so here's what I came up with. I've included the V6 supercharger init.d with my settings, and init.d script to disable the buttons backlight, and an S90user.rc which executes commands at various stages. This mod will execute any non .rc files in the /system/etc/init.d folder when the 'oncomplete' event triggers (basically once your android homescreen launches). It will execute all .rc files in the same folder each event. executing any commands in the corresponding case section. S90user.rc has an example.

This also checks that thermald and mpdecision are running once boot completes, if they aren't it starts them. However, I've noticed that occasionally starting mpdecision manually will reboot the phone. I'm not sure why yet.

This also has an on shutdown even in S90user.rc that will write the date to /cache/timemachine which will allow CWM to set it's time (using the CWM I posted in this thread's op. If you're brave enough to try it, you only need this zip and the image there. For those who are worried... the only tweak in this CWM image is the addition of some logic in /sbin/postrecoveryboot.sh to read /cache/timemachine if it exists and set the system time. Nothing major. You still have to manually dd the image to the recovery partition though. I suggest doing this zip (since it modifies the boot.img) make sure you can still boot. Then doing the recovery. NEVER change both at the same time.


Please let me know if this helps you. It should work with any rom, but the ramdisk is taken from PAC 05/03/13 nightly. I doubt there will be many changes to it between roms/rebuilds.


This is flashable over fresh roms as well. I booted and everything appears fine. If you have issues, let me know. It may take a second reboot to get everything settled after the initial flash though.

Also. DO NOT enable init.d through other apps/methods.... you will cause yourself issues. This method has more capabilities than the usual methods.


*Link moved to OP*


*DISCLAIMER*
I am not responsible for anything that happens. Your phone could melt, catch fire, ascend, or be stolen. The results could be unpredictable. I've tried to test what I could. This by no means makes this safe.

Good luck.

Init.d adapted from http://forum.xda-developers.com/showthread.php?t=1671670

V6 supercharger as always from http://forum.xda-developers.com/showthread.php?t=991276
 
I don't often see ramdisk changes from nightly to nightly. Most changes happen at the zImage level if there is a change to boot.img at all. On rare occasion, something may get changed if a new /bin gets added into the rom, but how often does that really happen?

That's kinda what I figured. I know the kernel is also included in the boot.img and that could face some changes. I ended going with the anykernel method to insert the ramdisk. Mainly because its more flexible... but also because I couldn't manage to successfully extract and repackage a working image. In the build it looked like there was a forced offset that I couldn't manage to get to work correctly. *shrug* this method worked though.
 
do I just flash this in CWM and then reboot, open terminal and type ' sh V6* ' ?

Depends what your actually looking for. V6 I have as ask individual zip over in another thread. But yeah flashing this will work too.it will also disable your button backlight on boot and enable a modified init.d

Sent from my VS920 4G using Tapatalk 2
 
Updated the OP with (hopefully) more info. Updated links.

This also now should fix the problem with mpdecision and thermald not starting reliably.
 
Are the links in this OP the latest (or the other one)? Is the version # for modded CWM still 6.0.1.1?

Though it was my first time, I'm pretty sure I adb push'd and dd'd it correctly.

Maybe the time > /cache isn't working. When I look in /cache, it's always empty.
{EDIT: Using a different file manager and /cache isn't empty. Timemachine still not there, though.}

May try a clean ROM install, if I get the time. I'm running PACMAN RC1, BTW.
 
Are the links in this OP the latest (or the other one)? Is the version # for modded CWM still 6.0.1.1?

Though it was my first time, I'm pretty sure I adb push'd and dd'd it correctly.

Maybe the time > /cache isn't working. When I look in /cache, it's always empty.
{EDIT: Using a different file manager and /cache isn't empty. Timemachine still not there, though.}

May try a clean ROM install, if I get the time. I'm running PACMAN RC1, BTW.

After you flash the cwm you still need the other zip flashed to write the time to cache. It's a two part hack

If you don't want the v6 and button backlights parts open the zip and delete the files for them from. /system/etc. The names are obvious for those two files

Sent from my VS920 4G using Tapatalk 2
 
After you flash the cwm you still need the other zip flashed to write the time to cache. It's a two part hack

If you don't want the v6 and button backlights parts open the zip and delete the files for them from. /system/etc. The names are obvious for those two files

Sent from my VS920 4G using Tapatalk 2
I did both. The scripts are in /system/etc/init.d and I can see where you're writing $(date) > /cache/timemachine on shutdown.

It's either not happening or I didn't flash CWM correctly (I actually did screw it up at first - have to adb push the image instead of copying with windows file manager before dd'ing). That was why I was wanting to know if there's a version number or some other way of determining if I'm using the hacked CWM or the original one.
 
I did both. The scripts are in /system/etc/init.d and I can see where you're writing $(date) > /cache/timemachine on shutdown.

It's either not happening or I didn't flash CWM correctly (I actually did screw it up at first - have to adb push the image instead of copying with windows file manager before dd'ing). That was why I was wanting to know if there's a version number or some other way of determining if I'm using the hacked CWM or the original one.

while in recovery, adb shell

cat /sbin/postrecoveryboot.sh

If it's the one I modified that file should have a bit of logic in it to check for that file in cache and set the time. If it's just got the one dd command, you're on the unmodded one.

Come to think of it, while you're in recovery check to see if the file exists in /cache if you cat /cache/timemachine from recovery, it should contain the date/time when you rebooted.

Might help figure out which portion isn't working.



*edit*
Also, if you want an easier way than adb push/dd-ing yourself... I have a flashable recovery in the TWRP thread that I'm working on. If you open that zip, delete the img that's in the root of the zip and replace it with the one from this thread (renamed to match the file you deleted so that the edify script can still find it) you could just copy that zip over and flash it.
 
Sorry for the noobness here but could you please give me a step by step instruction of what to flash if I want the disabled backlights, v6, and correct cwm date
 
Sorry for the noobness here but could you please give me a step by step instruction of what to flash if I want the disabled backlights, v6, and correct cwm date

It's in the original post. Flash the zip. Download the recovery image adb push it over to the sdcard. then dd it. Hopefully it works for you, the other report was having issues.
 
Not sure what dd means. Sorry

It's a command. You may be better off doing like I had said a few posts up... grabbing the zip I posted for twrp in that thread, and just putting the image from thsi in that with the same name as the img that's in there (to overwrite it) and just flashing the first zip in this post, then that one.
 
Can't find the flashable recovery image you're talking about in TWRP THREAD. So if I'm okay with the wrong time stamp thing right now and I just want the supercharger and backlight disabled I can just flash the zip in the beginning of this thread. Is that right?

Sent from my VS920 4G using Tapatalk 2

Are you talking about the recovery image in opening post of this thread
 
Can't find the flashable recovery image you're talking about in TWRP THREAD. So if I'm okay with the wrong time stamp thing right now and I just want the supercharger and backlight disabled I can just flash the zip in the beginning of this thread. Is that right?

Sent from my VS920 4G using Tapatalk 2

Are you talking about the recovery image in opening post of this thread

Yeah the zip here is fine without the modified cwm. It just won't update the time.

I'll post a flashable zip when I get home to clear up the confusion.

Sent from my VS920 4G using Tapatalk 2
 
OP Updated with a flashable recovery.

The two files you need are enclosed in >>> File <<< in the op.

Flash the top one. Make sure your rom still boots, flash the second one. Reboot system, reboot recovery, you should have a correct timestamp. You can check this by issuing "echo $(date)" from the recovery command line, i believe, (adb shell) that's a bit quicker than doing a backup to see if it worked.
 
I'll have to do a clean flash at some point then I guess to make sure I didn't leave something out... since that's two reports of an issue with it now.


Actually, didn't take a clean flash....

I forgot an echo in /system/etc/init.d/S90user.rc so it wasn't actually echoing the time to cache like I wanted. Mine was fine on my phone, just didn't put the right modified one in the zip >.>

I also changed how I was setting the date in in CWM. I stopped calling it from /sbin/postrecoveryboot.sh and placed it into /sbin/set_recovery_time.sh and called that from init.rc on boot in an exec event.

here's the two new zips. Once I hear they work as expected, I'll update the op. Flash the first one, make sure your rom still boots. flash teh second one, then advanced > reboot to recovery and your time *should* be updated.

*links removed*
 
Back
Top Bottom