[App] [ 4.0+] [ROOT] Boot Shell - Execute Shell Commands and scripts at Boot [V 3.5]

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
Boot Shell allows you to save Linux Shell commands and execute them at boot. The Pro version allows to execute complete shell scripts at boot.


You can also save your favourite Linux commands and execute them at your will.
It can also eliminate the need of using init.d scripts for basic needs such as setting CPU parameters at boot such as, CPU Frequencies, governors, and also IO Governers,enable/disable Fastcharge, GPU Overclock etc.



REQUIREMENTS -
->ROOT
->BUSYBOX

Pro Version Extras -
-Ability to Execute Scripts at boot
-View outputs and errors after command execution
-Inbuilt Text/Script Editor


For any queries or problems please feel free to E-mail me at [email protected]

Try not to execute a resource intensive task or scripts at boot, it can slow down your device startup.


Explanation for Permissions -

-> Read/Write USB Storage - Allow the Shell commands to read/write on Device Storage
-> SuperUser Permission - To Execute Shell Commands
-> Run at Startup - To be able to execute Shell commands at Boot


Credits:

-> CMDProcessor Library, for making Root easy, and to @Androguide.fr for sharing it.

-> @nikwen - For being a very helpful and active contributor in the Java for Android App Development section, and for clearing my initial programming doubts.

Changelog-
8/2/14 -
Initial Release
10/2/14 -
Added notification to confirm execution of commands at boot.
Execution of commands at boot time should be faster now.

12/02/14 -
Added option to enable/disable execution of commands at boot.
Added link to XDA thread in settings.

21/02/14 -
Uploaded to play store
Added option to export saved commands as txt file to sdcard
Fixed a command delete bug
Added help documentation
25/02/14-
Fixed up some strings
Added more feedback options in settings
07/03/2014-
Fixed a bug with exporting of commands
Added a cancel option to command edit dialog
Minor code cleanup
21- Mar - 2014
-Major Overhaul
-Ability to Execute Scripts at boot [Pro Version]
-View outputs and errors after command execution [Pro Version]
-Inbuilt Text/Script Editor [Pro Version]
Please try to download from Google Play as it will help me to keep record of number of downloads, app crashes, etc.


For those who do not use Gapps download V3.0 from the attachments below.

P.S. - If you are coming from the Beta Version of the app, the signature for the app has changed so you will have to uninstall the old version to be able to install the new one. To backup your commands, please backup app data using titanium backup or helium, uninstall, reinstall from play store and restore app data. I am really sorry for this inconvenience.
 
Last edited:

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
Some useful Shell Commands

USB FAST CHARGE Enable:
Code:
echo 1 > /sys/kernel/fast_charge/force_fast_charge
USB FAST CHARGE Disable:
Code:
echo 0 > /sys/kernel/fast_charge/force_fast_charge
SET GPU CLOCK:
Code:
echo x > /sys/devices/system/cpu/cpu0/cpufreq/gpu_oc
where x is your desired GPU Frequency or frequency step

SET CPU GOVERNER
Code:
echo interactive > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
replace interactive with your desired governer

LOAD A KERNEL MODULE
Code:
insmod /system/lib/modules/module_name
TCP CONGESTION ALGORITHM
Code:
/system/xbin/sysctl -w net.ipv4.tcp_congestion_control=reno
replace reno with your desired value

SET CPU MIN FREQUENCY
Code:
echo 350000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
replace 350000 (350 MHz)with your desired frequency

SET CPU MAX FREQUENCY
Code:
echo 1500000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
replace 1500000(1.5 Ghz) with your desired frequency

SET READ AHEAD BUFFER
Code:
echo 1024 > /sys/block/mmcblk0/queue/read_ahead_kb
replace 1024 with your desired value(in KB)

SET I/O SCHEDULER
Code:
echo row > /sys/block/mmcblk0/queue/scheduler
replace row with your desired governer
 
Last edited:

Dovidhalevi

Senior Member
Jun 26, 2012
2,729
1,171
0
OK, how does this baby work? That is, what executes the commands? When (linux boot, zygote startup, dalvik up and running)??
How does this relate to selinux?

I have scripts in /data/local/userinit.d/ which are supposed to be run by the init.d system. The only one I know that runs is link2sd's script if I move it to there. Others, apparently do not run, even in cm-10.2 with permissive selinux. I have tasker run them, successfully, when it begins its "listening."

The lead question here is critical! If the app must be present at boot (it is an apk, however!), then it needs be on internal storage or better, on system! If the app needs be present only for its UI, it can be on sdcard or linked (link2sd). It is a user app but maybe it needs place something on system or /etc/init.d/ to operate?
 

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
OK, how does this baby work? That is, what executes the commands? When (linux boot, zygote startup, dalvik up and running)??
How does this relate to selinux?

I have scripts in /data/local/userinit.d/ which are supposed to be run by the init.d system. The only one I know that runs is link2sd's script if I move it to there. Others, apparently do not run, even in cm-10.2 with permissive selinux. I have tasker run them, successfully, when it begins its "listening."

The lead question here is critical! If the app must be present at boot (it is an apk, however!), then it needs be on internal storage or better, on system! If the app needs be present only for its UI, it can be on sdcard or linked (link2sd). It is a user app but maybe it needs place something on system or /etc/init.d/ to operate?
The commands saved on this app are executed in the same way they are executed by a Linux Shell Emulator, or a Terminal on a Native Linux system. The only difference is it save the commands you enter and executes them as soon as the device finishes booting. You can also save commands to a favourite list , which will not be executed at boot, but allows you to manually execute them as you wish.

Edit: - Info: - It uses busybox to execute shell commands

The app works fine when placed on the internal storage of the device, though I am not sure about if it will work if placed on SD Card but in theory it should work, no need to place it on the /system partition.

It cannot run whole shell scripts only single commands, but you can save as many commands as you like

Just make sure you enter a valid command and that you kernel or device supports it.
 

Dovidhalevi

Senior Member
Jun 26, 2012
2,729
1,171
0
The commands saved on this app are executed in the same way they are executed by a Linux Shell Emulator, or a Terminal on a Native Linux system. The only difference is it save the commands you enter and executes them as soon as the device finishes booting. You can also save commands to a favourite list , which will not be executed at boot, but allows you to manually execute them as you wish.

Edit: - Info: - It uses busybox to execute shell commands

The app works fine when placed on the internal storage of the device, though I am not sure about if it will work if placed on SD Card but in theory it should work, no need to place it on the /system partition.

It cannot run whole shell scripts only single commands, but you can save as many commands as you like

Just make sure you enter a valid command and that you kernel or device supports it.
Thanks for the info. In other words, would work as I use tasker now but with a much easier UI for scripts entry. Not really a substitute for /etc/init.d functionality because would get run later but otherwise, quite nice. Note that current cm-11 ROMs (for my old LG P500 at any rate) are quite slow getting startup services going.
 
  • Like
Reactions: gh0stslayer

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
Thanks for the info. In other words, would work as I use tasker now but with a much easier UI for scripts entry. Not really a substitute for /etc/init.d functionality because would get run later but otherwise, quite nice. Note that current cm-11 ROMs (for my old LG P500 at any rate) are quite slow getting startup services going.
Yup, not really a substitute for complex init.d scripts, and yes quite similar to the way tasker does shell commands at boot.
But it should be more than enough for some simple CPU, I/O and kernel tweaking etc.
 

Dovidhalevi

Senior Member
Jun 26, 2012
2,729
1,171
0
Yup, not really a substitute for complex init.d scripts, and yes quite similar to the way tasker does shell commands at boot.
But it should be more than enough for some simple CPU, I/O and kernel tweaking etc.
... and maybe a tasker plugin to execute "favorites" entered to this app?
 

Dovidhalevi

Senior Member
Jun 26, 2012
2,729
1,171
0
Hmmm, I will have to look into it. I have no knowledge about how to develop plugins for tasker :silly: but I can try, no promises though. :eek:

But can't you already add commands in tasker and schedule their execution ?
It is excruciatingly difficult to enter this stuff on the phone's keyboards. So if I have a "favorite"command in this app and later on decide to use it in tasker, I would not be to happy with struggling to enter it a second time :)

BTW, most of what I have entered as script are in bash script files. Can these be run by the app or only single line commands?
 

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
It is excruciatingly difficult to enter this stuff on the phone's keyboards. So if I have a "favorite"command in this app and later on decide to use it in tasker, I would not be to happy with struggling to enter it a second time :)

BTW, most of what I have entered as script are in bash script files. Can these be run by the app or only single line commands?
Single line commands only, you can add the next line of bash script as another command .

Edit:
If you wanna use the same command else where , click on the command select edit and copy the command from the textbox. No need to enter it again. :D
Sent from my Galaxy Nexus using Tapatalk
 

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
Hello everyone, Boot Shell is now available on Play Store. Please find it here
https://play.google.com/store/apps/details?id=com.kislay.bootshellcommand



The signature for the app has changed so you will have to uninstall the old version to be able to install the new one. To backup your commands, please backup app data using titanium backup or helium, uninstall, reinstall from play store and restore app data. I am really sorry for this inconvenience.
 

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
Version 1.2 is now up-
Changes -
-Fixed a bug with exporting commands to SD Card
-Added a cancel option to command edit dialog
-Minor Code Cleanup

Please feel free to drop your feedback/ comments/ ratings
Email if you need any help, guidance or wanna report a bug.
 

gh0stslayer

Senior Member
Nov 3, 2010
302
286
0
Bangalore
New major update -

Changelog-

Version 2.0 -> 21- Mar - 2014
-Major Overhaul
-Ability to Execute Scripts at boot [Pro Version]
-View outputs and errors after command execution [Pro Version]
-Inbuilt Text/Script Editor [Pro Version]

Pro Version Link - Boot Shell Pro