[FIX] Run init.d scripts at startup (corrected sysinit along with run-parts)

Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
[ info ]

the reason i created this thread is that many custom kernels for our X10 are having the feature of running init.d scripts at startup, BUT the problem is that some ROMS dont have the necessary/correct files in place for executing those scripts...

so i am attaching a easy to flash update.zip which contains these missing files required for full functionality of executing startup scripts...

use the following files only if u are not able to execute init.d startup scripts on ur current ROM


[ requirements ]

  1. rooted device with recovery installed
  2. kernel/other modifications which support init.d script execution (via sysinit) [exec /system/bin/sysinit]


[ download link ]

update.zip flashable via xRecovery-0.3-GBready (amend syntax)
init.d-autorunner-v01.zip


[ additional info ]

  • i have added the following things in the update.zip:
    1. corrected /system/bin/sysint file
    2. run-parts binary in /system/xbin/run-parts (which is basically busybox 1.16.2 binary)
    3. test/example script /system/etc/init.d/99test
  • CM7-FreeXperia ROM already supports this execution so no need to flash it on that ROM
  • if ur startup script is not correctly working then u need to make sure that u have the correct permissions on the script (just tick all 9 boxes using RootExplorer permissions pop-up)


let me know how it goes!


icon8.gif


ENJOY!
 

Attachments

  • init.d-autorunner-v01.zip
    283.5 KB · Views: 15,302
Last edited:

aZuZu

Inactive Recognized Developer
Jan 19, 2011
638
941
43
Zagreb
Hey doom and other devs
How many copies of busybox we will have in roms :D

I mean why not just add special folder rtm ( run-time module ) and place our busybox there...
That would ensure that it is not overwritten and replaced by market or some external thing...

If you take look now we have devs placing busybox in /recovery/sh /xbin/sh /bin/busybox etc, etc ...
Let's not forget busybox has size 700 kB that is like almost 1 MB of wasted space per copy...

And all sh scripts can run using #!/path_to/busybox sh and let's not forget that run-parts are created by update-script in xbin or bin folder :D so making new copy of busybox as run-parts not needed :D

And sysinit can be as service in init file :D

service sysinit /path_to/busybox run-parts /system/etc/init.d
 
Last edited:
  • Like
Reactions: colossus

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Hey doom and other devs
How many copies of busybox we will have in roms :D

I mean why not just add special folder rtm ( run-time module ) and place our busybox there...
That would ensure that it is not overwritten and replaced by market or some external thing...

If you take look now we have devs placing busybox in /recovery/sh /xbin/sh /bin/busybox etc, etc ...
Let's not forget busybox has size 700 kB that is like almost 1 MB of wasted space per copy...

And all sh scripts can run using #!/path_to/busybox sh and let's not forget that run-parts are created by update-script in xbin or bin folder :D so making new copy of busybox as run-parts not needed :D

And sysinit can be as service in init file :D

service sysinit /path_to/busybox run-parts /system/etc/init.d

aZuZu u will have to check all busybox binaries... wht i found was NOT ALL busybox binaries support run-parts (u can check it ur self)...
there are symlinks created using update-script which are wrong... u should be using busybox --s -install command always...

anyways the problem is that some devs use busybox in /system/bin /system/xbin
some include busybox in ramdisk (/sbin)...

so simplest solution for run-parts is to use a small "<400kb" binary which handles this well...


BTW i already use the sysinit service for my other kernels (Arc/Play/etc...) ;) [which is much more advanced]

the solution posted here is a generic one which should work for MOST kernels...

P.S.: having a small 400Kb file is not going to waste 350MB+ space of ur /system partition
 
Last edited:
  • Like
Reactions: colossus

tkymgr

Senior Member
Nov 11, 2010
92
418
Narashino
www.gorochan.net
aZuZu u will have to check all busybox binaries... wht i found was NOT ALL busybox binaries support run-parts (u can check it ur self)...
there are symlinks created using update-script which are wrong... u should be using busybox --s -install command always...

anyways the problem is that some devs use busybox in /system/bin /system/xbin
some include busybox in ramdisk (/sbin)...

so simplest solution for run-parts is to use a small "<400kb" binary which handles this well...


BTW i already use the sysinit service for my other kernels (Arc/Play/etc...) ;) [which is much more advanced]

the solution posted here is a generic one which should work for MOST kernels...

P.S.: having a small 400Kb file is not going to waste 350MB+ space of ur /system partition

Hi my friend,

I think your idea is also based

so I want to try this script :D

Cheers,
tkymgr
 

Attachments

  • run-parts.zip
    689 bytes · Views: 572
  • Like
Reactions: Prodigy

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    [ info ]

    the reason i created this thread is that many custom kernels for our X10 are having the feature of running init.d scripts at startup, BUT the problem is that some ROMS dont have the necessary/correct files in place for executing those scripts...

    so i am attaching a easy to flash update.zip which contains these missing files required for full functionality of executing startup scripts...

    use the following files only if u are not able to execute init.d startup scripts on ur current ROM


    [ requirements ]

    1. rooted device with recovery installed
    2. kernel/other modifications which support init.d script execution (via sysinit) [exec /system/bin/sysinit]


    [ download link ]

    update.zip flashable via xRecovery-0.3-GBready (amend syntax)
    init.d-autorunner-v01.zip


    [ additional info ]

    • i have added the following things in the update.zip:
      1. corrected /system/bin/sysint file
      2. run-parts binary in /system/xbin/run-parts (which is basically busybox 1.16.2 binary)
      3. test/example script /system/etc/init.d/99test
    • CM7-FreeXperia ROM already supports this execution so no need to flash it on that ROM
    • if ur startup script is not correctly working then u need to make sure that u have the correct permissions on the script (just tick all 9 boxes using RootExplorer permissions pop-up)


    let me know how it goes!


    icon8.gif


    ENJOY!
    2
    reserved reserved
    1
    Hey Doom, Is this already implemented in Z's CM7 2.3.5 rom?

    i dont remember...

    test it out...

    if init.d scripts are getting executed w/o using this FIX then its already implemented ;)
    1
    Hey doom and other devs
    How many copies of busybox we will have in roms :D

    I mean why not just add special folder rtm ( run-time module ) and place our busybox there...
    That would ensure that it is not overwritten and replaced by market or some external thing...

    If you take look now we have devs placing busybox in /recovery/sh /xbin/sh /bin/busybox etc, etc ...
    Let's not forget busybox has size 700 kB that is like almost 1 MB of wasted space per copy...

    And all sh scripts can run using #!/path_to/busybox sh and let's not forget that run-parts are created by update-script in xbin or bin folder :D so making new copy of busybox as run-parts not needed :D

    And sysinit can be as service in init file :D

    service sysinit /path_to/busybox run-parts /system/etc/init.d
    1
    Hey doom and other devs
    How many copies of busybox we will have in roms :D

    I mean why not just add special folder rtm ( run-time module ) and place our busybox there...
    That would ensure that it is not overwritten and replaced by market or some external thing...

    If you take look now we have devs placing busybox in /recovery/sh /xbin/sh /bin/busybox etc, etc ...
    Let's not forget busybox has size 700 kB that is like almost 1 MB of wasted space per copy...

    And all sh scripts can run using #!/path_to/busybox sh and let's not forget that run-parts are created by update-script in xbin or bin folder :D so making new copy of busybox as run-parts not needed :D

    And sysinit can be as service in init file :D

    service sysinit /path_to/busybox run-parts /system/etc/init.d

    aZuZu u will have to check all busybox binaries... wht i found was NOT ALL busybox binaries support run-parts (u can check it ur self)...
    there are symlinks created using update-script which are wrong... u should be using busybox --s -install command always...

    anyways the problem is that some devs use busybox in /system/bin /system/xbin
    some include busybox in ramdisk (/sbin)...

    so simplest solution for run-parts is to use a small "<400kb" binary which handles this well...


    BTW i already use the sysinit service for my other kernels (Arc/Play/etc...) ;) [which is much more advanced]

    the solution posted here is a generic one which should work for MOST kernels...

    P.S.: having a small 400Kb file is not going to waste 350MB+ space of ur /system partition