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

Mods BootBuddy - Run Boot Scripts from SDcard (a safe alternative to init.d) [Root only]

So the issue is that the latest versions of busybox do not have sh support
As well as some older versions
i upgraded from a version that had sh support
so i had an empty sh applet that was symlinked to busybox which no longer functioned
So adding a working sh applet (i copied mine from bin)
And removing (busybox) from the (busybox sh) lines from the bootybuddy bootscript in /data
Solved everything for me

you can look at the busybox applet manager
or in terminal emulator type

su
busybox

this will display all the applets your version of busybox supports as well as if they are simlinked or not

So now i have bootbuddy working
i wanted to integrate it to the system an add more control to it

so i made the bootbuddy boot script run from /system/bin instead of /data
added a second applet with a slightly exec path

now my bootybuddy_scripts folder on my ext sd contains 3 folders
bb1
bb2
control
run scripts go in either bb1 or bb2
the control folder has several sh scripts that allow you to turn bb1 or bb2 On or Off or simply Run them now.
So this allows a second profile and abilty to switch between the 2 or turn them off
if anybody wants to try it.I can upload it somewhere
Its set for the sd path of the LgMotion and is a manual install( copy-paste set permissions)

NOTE
it seems that adding .bak to your scripts in your bootbuddy_scripts folder DOES NOT stop it from being executed. Just so you need to be careful
 
  • Like
Reactions: Sepero
Upvote 0
NOTE
it seems that adding .bak to your scripts in your bootbuddy_scripts folder DOES NOT stop it from being executed. Just so you need to be careful
That is correct. Boot buddy will try to run any file in its folder (and any file extension). You have to move scripts out of the folder to stop them from running.

I'm glad to hear you got the problem solved. It sounds like you have gotten to know how Boot buddy works Very Very well. I don't know anyone that has studied BB as indepth as you have. Congratulations on all your modifications.
 
  • Like
Reactions: scary alien
Upvote 0
thanks for the script
It is very valuable to me
i play with tons of init.d scripts,I often run them in realtime but found that run at boot can cause different results
Bootbuddy can make these tests safer

I was thinking about playing with a script or two for people without knowledge of adb or revovery
or just another option for repair

like put a script and a launcher in a folder
bootup and bootbuddy fixes a deleted launcher
or replaces a borked build.prop,uninstalls a bootlooping app.
Just an idea on another way this script can be used
 
Upvote 0
could this be easily modified to work with a device like the Alcatel One Touch Fierce? we have no custom recovery, and this seems like the way to go if we are ever going to at least get a second init without bricking our phones.

-edit-
Awesome, running shell scripts on boot like a boss! Made a few minor changes to your installer and now it works like a charm on my device.
 
  • Like
Reactions: Sepero
Upvote 0
here is copy of the modified bootbuddy
gives you 3 profile options
the abilty to run 1,2 or all 3 or turn bootbuddy completly off
it runs from your system so it will persist through a factory reset ( data wipe)
There is no installer
but is very easy
paste 3 files to system/bin
1 folder to ext sd
add 3 lines to
etc/install-recovery.sh or system/bin/sysinit
(some phones have sysinit some dont) i think most phones will run install-recovery.sh
simply make one if you dont have it already.
instructions included

scripted for mountpoints of LgMotion

if your phone is different you will need to modify the 3 files that go in /system/bin to point to your ext sd

once done open your boot_buddy_scripts folder on your ext sd
open the on_off_run folder
use root browser,root explorer or any script manager to (turn on) any or all of the 3 profile choices.
reboot, if sucessfull you will see a text file from bootbuddy on your sd card

these changes were modeled to resemble a tweak system i made about a year ago
and is the oerfect addition to this http://androidforums.com/motion-4g-...odified-init-d-sysctl-system.html#post6520829
 

Attachments

  • Modified_BootBuddy.zip
    5.3 KB · Views: 76
  • install-recovery.zip
    191 bytes · Views: 85
Upvote 0
The installer attempts to automatically find the sdcard location using this line
Code:
[ -n $EXTERNAL_ADD_STORAGE ] && EXTERNAL_STORAGE=$EXTERNAL_ADD_STORAGE
Basically saying- Use whatever is listed in $EXTERNAL_STORAGE, but if $EXTERNAL_ADD_STORAGE is set, use that instead.

Unfortunately, a lot of devices have some tricky or unknown ways to identify the sdcard. The install script could be modified and replace the above line with this
Code:
EXTERNAL_STORAGE="/mnt/external/sdcard"
Change "/mnt/external/sdcard" to the mount location of your real sdcard, and the install may run just fine on any device.

Rhino889a and DNRDustin know enough to get it set up.

EDIT:
I almost, forgot- If your system doesn't respond to the file "/system/etc/install-recovery.sh", then Boot Buddy still won't work. Since your phone is an LG, there's a good chance it will work.
 
  • Like
Reactions: scary alien
Upvote 0
The installer attempts to automatically find the sdcard location using this line
Code:
[ -n $EXTERNAL_ADD_STORAGE ] && EXTERNAL_STORAGE=$EXTERNAL_ADD_STORAGE
Basically saying- Use whatever is listed in $EXTERNAL_STORAGE, but if $EXTERNAL_ADD_STORAGE is set, use that instead.

Unfortunately, a lot of devices have some tricky or unknown ways to identify the sdcard. The install script could be modified and replace the above line with this
Code:
EXTERNAL_STORAGE="/mnt/external/sdcard"
Change "/mnt/external/sdcard" to the mount location of your real sdcard, and the install may run just fine on any device.

Rhino889a and DNRDustin know enough to get it set up.

My LG Optimus F6 has:
Internal>/storage/sdcard0
External>/storage/external_SD

This is not "standard" is it?
 
Upvote 0
The standard on regular Linux is to mount drives under /mnt, but for Android, I'm not sure Google has even issued a standard (though they really should).

Anyway, the line to insert would look like this
Code:
EXTERNAL_STORAGE="/storage/external_SD"
I forgot one thing (I'll go back to my previous post and add it in). If your system doesn't respond to the file "/system/etc/install-recovery.sh", then Boot Buddy still won't work. Since your phone is an LG, there's a good chance it will work.
 
  • Like
Reactions: scary alien
Upvote 0
Or you could modify the actual bb file in data/
you couldnt go wrong.

The top is telling it the path where to send the log

next is the telling the path to mount
then the path to execute

change the last 2 paths to your phone

Note for booting
my L9 will run install-recovery.sh
But i found in System/vendor is script the runs at boot .Which bootbuddy and init.d scripts can started with.
this file might be on other phones i dont know
If your kernel execs sysinit that can be used .
i think i was able to use post_boot b.sh before
 

Attachments

  • boot_buddy.sh.zip
    383 bytes · Views: 61
  • Like
Reactions: scary alien
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones