1. Download our Official Android App: Forums for Android!

Root Boot_Buddy - Run Boot Scripts from SDcard (root users)

Discussion in 'Android Devices' started by Sepero, Dec 20, 2012.

  1. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    (The NEW BootBuddy thread can be found here)

    INTRODUCTION:
    Boot Buddy will allow you to run Linux shell scripts when your Android device is booting up. It will run your scripts early in the boot process, before the home screen appears.

    The intended audience is generally intermediate to advanced users, and those who want to play with shell scripting on their device.


    FEATURES:
    BootBuddy is similar to init.d scripts, but with a core difference that it stores boot scripts on your SDcard instead of the internal system. This allows for several interesting enhancements. Feature listing-

    • Boot Buddy is designed from the start to run scripts right from your SDcard. Just download any scripts to your boot_buddy_scripts directory and they're ready to run. (No more screwing around with permissions and files in your /system/etc/init.d/*)
    • SDcard storage allows you to copy a script to another device, or multiple devices easily.
    • If you have a script that is malfunctioning, just boot your device with the sdcard out, and put the sdcard back in after your device reaches home screen. No Problem!
    • Boot Buddy's author has several years of scripting and programming experience. It is streamlined, fast, and doesn't perform worthless functions like repeatedly logging the authors name and time (*hint to a t-init author*).
    • Clear goals of making operation simple, intuitive, and clean.
    • If you're currently using an "init.d" solution, BootBuddy can integrate seamlessly with it.
    • If you try BootBuddy and you don't like it, the installer also works as an uninstaller for easy clean removal.
    • BootBuddy is Open Source GNU GPL. Open for anyone to modify and improve upon.
    As a developer, I make software to operate the way I would want if I were an end user, because I actually do use it, and I am an end user like you.


    REQUIREMENTS:




    INSTALL:

    1. Start Script Manager, and allow/grant root access.
    2. Navigate to the bb_install.sh file.
    3. Tap on the file to show the menu options.
    4. At the top, highlight the "Su" icon.
    5. On the top-left, tap "Run".
    The script will run quickly and create a folder on your sdcard named "boot_buddy_scripts". In that folder, you put the scripts you want to run at system boot. A log file will be kept at /data/boot_buddy.log

    If you need your scripts to run in order, they are ordered by filename using the busybox "sort" program. They will run in alphabetical order using this format 0-9A-Za-z.


    YOUR FIRST SCRIPTS: (OPTIONAL)
    Here are a couple example scripts you may use.

    The Android /system is normally mounted with read-only permissions by default. We will change that with the first script listed below. It will cause /system to be remounted to read-write permissions during boot.

    The second script will create a file at every boot named /mnt/sdcard/sys_mount_info.txt. That txt file will give us information about how /system is currently mounted.

    1. Download the file 00rw_system.sh into your boot_buddy_scripts folder.
    2. Download the file 99sys_mount_info.sh into your boot_buddy_scripts folder.
    3. Reboot your phone.
    That's it, you just installed 2 new scripts and had them run at boot. It's Really just that simple to add startup scripts to your system.

    To verify they are running, use any text viewer to open the file /mnt/sdcard/sys_mount_info.txt. It may show more than one line of text. There should be a line similar to this:
    /dev/block/(device specific text) /system (fstype) rw,(more text)

    The rw means that /system was successfully remounted as read-write during boot.

    At any time you can delete either script if you choose. Easy!


    UNINSTALL:
    If for any reason you find you don't want or don't like Boot Buddy, you can cleanly uninstall it using the installer bb_install.sh. These instructions are almost identical to installing. (All match the installation steps, except step 4)

    1. Start Script Manager, and allow/grant root access.
    2. Navigate to the bb_install.sh file.
    3. Tap on the file to show the menu options.
    4. Type --uninstall in the text area labeled Arguments.
    5. At the top, highlight the "Su" icon.
    6. On the top-left, tap "Run".
    Boot Buddy will be uninstalled. It will not remove the contents of your boot_buddy_scripts folder. If you have an "init.d" system installed, it will cleanly remove only Boot Buddy parts and leave the rest.


    ADVANCED NOTES:
    Boot Buddy will Not cause harm to your system, but it may not work on custom roms. Also, it may fail to detect the real location of your SDcard. It requires that /system/etc/install-recovery.sh is run during the boot process, and that file will be created if it does not exist. Also the file /data/boot_buddy.sh will be created. The script /system/etc/install-recovery.sh will run /data/boot_buddy.sh. The script /data/boot_buddy.sh will run the scripts on your sdcard. The file /data/boot_buddy.log will log any script output.

    Leave feedback on your results!!! :)

    For Windows and Mac users- If you download the installer to your pc first, do not edit the installer with a text editor. Your computer will add hidden markers at the ends of each line that will prevent the installer from running. If you want to edit it, you should do so on a Linux pc or directly on your Android device.

    BootBuddy source code: http://github.com/Sepero/bootbuddy


    USER SCRIPTS MADE FOR BOOT BUDDY:
    (Mention your script and get listed here)


     

    Advertisement

  2. twogbsd

    twogbsd Android Expert
    Rank:
    None
    Points:
    193
    Posts:
    2,014
    Joined:
    Oct 17, 2012

    So this is like init.d?
     
  3. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    Yes. The main difference is that scripts go on your SDcard, instead of storing in the internal system of your device.

    I invite everyone with a little scripting experience to look at the bb_install.sh code. It is very straight forward and should be relatively clear to read.
     
    twogbsd likes this.
  4. THE W

    THE W Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    2,092
    Joined:
    Mar 10, 2012

    Mar 10, 2012
    2,092
    242
    163
    Detroit
    I get this when I run the script
    What am I doing wrong?
     

    Attached Files:

  5. pl4life52

    pl4life52 Android Enthusiast
    Rank:
    None
    Points:
    43
    Posts:
    315
    Joined:
    Jul 10, 2011

    Jul 10, 2011
    315
    38
    43
    Amityville, NY
    which script manager did you download?
     
  6. THE W

    THE W Android Expert
    Rank:
    None
    Points:
    163
    Posts:
    2,092
    Joined:
    Mar 10, 2012

    Mar 10, 2012
    2,092
    242
    163
    Detroit
    I got it to work. I used script manager free. When I tapped on the file in the root browser it gave me options on what to open the file as and I chose script and then it went to the menu where you select "su" and run.

    I deleted the file and redownloaded it, followed the instructions again and it worked fine.
     
  7. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    First thing, do not worry about Boot Buddy harming your system. It is designed to be very safe. It's good you reported this. I'll work to help you resolve it in PM and we can post the solution here afterwards.

    EDIT:
    I see my post came late. Good to see that it worked out for you. Just an incomplete download.
     
  8. twogbsd

    twogbsd Android Expert
    Rank:
    None
    Points:
    193
    Posts:
    2,014
    Joined:
    Oct 17, 2012

    *Cough* Bump *Cough*
     
  9. OverByter

    OverByter Resident Slide Rule Guru
    Rank:
    None
    Points:
    213
    Posts:
    4,000
    Joined:
    Dec 12, 2010

    Dec 12, 2010
    4,000
    922
    213
    Male
    Disabled
    CT, USA
    Would you tell me what the major differences are between your product and something like mounts2sd? I just downloaded that yesterday and have been looking into it. Thanks, OB
     
  10. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    Hey OverByter. :) I assume this link is what you're referring to. I actually never heard of mount2sd before you brought it to my attention. After looking it over, it looks like it performs some really neat things. Unfortunately, it can't really be compared to Boot Buddy.

    The reason is because Boot Buddy doesn't move apps, cache, data, or anything by default. It simply runs scripts when your phone boots up. You might ask, "What scripts?". Well, immediately after installing, it will run No scripts at all. :p The scripts to go with Boot Buddy are an addon. It's like Boot Buddy enables a script plugin system.

    It might help to think of the "Startup" folder on Windows, except Boot Buddy only runs shell scripts, not apps. (But it might be possible to have a script that starts an app)

    If someone writes a script to be run at every boot, Boot Buddy is a very easy way to enable that to happen. The script only needs to be copied into the Boot Buddy sdcard folder, and that's it. Until the script is removed, it will run everytime the device is started.

    I hope that explains it. Cheers :D
     
    twogbsd and OverByter like this.
  11. orangejuicebox

    Rank:
    None
    Points:
    16
    Posts:
    60
    Joined:
    Aug 10, 2011

    Aug 10, 2011
    60
    5
    16
    Los Angeles, CA
    I'm trying to run the boot Buddy script to install it but when I run it... It says busy box was not found.. What do I do to solve this problem
     
  12. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    Thanks for letting me know your problem. I recently updated Boot Buddy and I introduced a small syntax error. It has been corrected. Sorry for the inconvenience. :eek:
     
  13. orangejuicebox

    Rank:
    None
    Points:
    16
    Posts:
    60
    Joined:
    Aug 10, 2011

    Aug 10, 2011
    60
    5
    16
    Los Angeles, CA
    I also get the busy box not found problem
     
  14. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16





    i got the same ....deleted.....downloaded.......deleted.....downloaded....

    Used script manager free and rom toolbox to run script....still nothing.....also downloaded file with several different browsers.....??????:thinking:
     
  15. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    orangejuicebox sent me a PM saying that it's working for them now
     
  16. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16
    this is what i get....
     
  17. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16
    errrrrr this.....tryuing to attach a screen shot...well it says this....


    exec /system/xbin/sh '/mnt/sdcard/external_sd/bb_install.sh'
    xternal_sd/bb_install.sh' <
    sh: applet not found


    ????/
     
  18. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    @HarunATL
    Did you install an alternative BusyBox from the play store?
     
  19. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16
    Actually i did then thought better of it and un in stalled. Was that a bad idea?
     
  20. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16
    Do i need to unroot/root now?
     
  21. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
    HarunATL I received your PM. I'm glad you got it working.

    After downloading the Opera browser, you were able to successfully download the script and run it on your phone.

    Google Chrome and the Default Android browser do not appear to download files properly from the host (www.mediafire.com). The downloaded files are malformed.

    Downloaded files best with Firefox or Opera browsers.
     
    sammyz likes this.
  22. HarunATL

    HarunATL Newbie
    Rank:
    None
    Points:
    16
    Posts:
    11
    Joined:
    Dec 30, 2012

    Dec 30, 2012
    11
    1
    16
    I just wanted to thank you publicly for the help that you have,given me.So far so good as long as i dont run into the "insufficient memory "monster when i install my apps .Very cool.Thank you.
     
    Sepero likes this.
  23. Astro Creep

    Astro Creep Newbie
    Rank:
    None
    Points:
    16
    Posts:
    29
    Joined:
    Sep 18, 2012

    Sep 18, 2012
    29
    1
    16
    So i have everything installed and both scripts seem to be running. My goal was to move apps from my sd to external sd, i moved Need For Speed to the boot_buddy folder in external sd, but its still in sd/android/data too, so now im taking up more space. what am i doing wrong?
     
  24. Sepero

    Sepero Linux Guru
    Thread Starter
    Rank:
    None
    Points:
    163
    Posts:
    963
    Joined:
    Aug 26, 2010

    Aug 26, 2010
    963
    593
    163
  25. Tokenpoke

    Tokenpoke Android Expert
    Rank:
    None
    Points:
    313
    Posts:
    3,110
    Joined:
    Feb 10, 2011

    Feb 10, 2011
    3,110
    1,156
    313
    Male
    Arborist (tree man)
    Miami, FL
    Ok. Dl via opera to get past the < error and got this..

    Error resolving interpreter:/system/xbin/sh does not exist
    Using default shell
    exec sh '/mnt/sdcard/Download/bb_install.sh'
    /sdcard/Download/bb_install.sh' <
    /mnt/sdcard/Download/bb_install.sh[7]: sed: not found
    /mnt/sdcard/Download/bb_install.sh[23]: [: 0: unexpected operator/operand
    You're not root


    Yes, its rooted.
     
Tags:

Share This Page

Loading...