Help editing boot script or editing boot.img

basketthis

Well-known member
Nov 22, 2010
1,470
473
0
Before I go messing up my boot files, etc, is there an easy way to do this:
- "echo 'interactive' > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor" and add this one-liner to any boot script if you want it to happen automatically on boot. [or]
- Unpack the boot.img and edit /init.qcom.post_boot.sh in the ramdisk to use 'interactive', then repack and flash_image the new boot.img.

?????
I did search on my own and try to find something on it and just can't seem to find any solid information for the LG Optimus S in particular. Everything seems to be generic Android information and a bunch of coding to see what works for each particular phone... I am lost...

Don't want to use SetCPU btw. I know the "easy" suggestion is to do that, but I would like to go for one of the other options listed.
 
Sometimes, especially this early in some places, 20 mins is not a long time to get a reply...be patient and I'm sure someone here will give you help :)
 
Sometimes, especially this early in some places, 20 mins is not a long time to get a reply...be patient and I'm sure someone here will give you help :)

LOL. Thanks for keeping me enthusiastic about it. And welcome to the forum.

I'm still convinced everyone is hung over from last night. :p;)
 
Ill do some Googling I wanna see this through to a solution.

Sweet. I've done a lot of googling and came to the conclusion that before trying anything that I am not well versed in that I would be better off asking in the place where everyone has done these things before. :)
 
Sweet. I've done a lot of googling and came to the conclusion that before trying anything that I am not well versed in that I would be better off asking in the place where everyone has done these things before. :)

I couldn't find anything specific to optimus s so I said eff it :/ sorry bro
 
You can put it in a file in /system/etc/init.d and make it executable and it should be run at boot up. If it runs too soon and is overwritten you can look in /init.rc which runs at boot up for a system script that is run. On Lego the only one was sysinit which was run by the statement "exec /system/bin/sysinit" (I think). You would rename the current sysint to something like sysinit.sh and make a new sysinit in the same place with your echo statement followed by exec /system/bin/sysinit.sh. Try this and see if it works.
 
  • Like
Reactions: basketthis
You can put it in a file in /system/etc/init.d and make it executable and it should be run at boot up. If it runs too soon and is overwritten you can look in /init.rc which runs at boot up for a system script that is run. On Lego the only one was sysinit which was run by the statement "exec /system/bin/sysinit" (I think). You would rename the current sysint to something like sysinit.sh and make a new sysinit in the same place with your echo statement followed by exec /system/bin/sysinit.sh. Try this and see if it works.

Well apparently I only need to add the single line to an existing script. I was hoping to find information regarding the procedure for this phone with the new RebornROM. Would I just do a pull on sysinit and edit it? Then push it back? How would I know if it worked?
 
After the system boots, get into Terminal Emulator and cat out the file you echoed into, scaling_governor (?), and see what's in it.
 
Would I need to issue any commands in adb shell prior to doing the pull command of the /system/bin/sysinit?
 
Executing cat on the current file system returned these results:
cat /system/bin/sysinit
#!/system/bin/sh

export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d

Is it save to add the code to this?
 
Unfortunately making a new /system/bin/sysinit did not solve the issue. :(

Was really hoping that would do it... Still looking for any input on this! I'm trying everything! :D

EDIT: Hope I didn't mess up anything in my beautiful RebornROM... :/
 
1. The point of init.d is that you add your new script to the init.d directory, so you don't have to hack existing files (which will be overwritten, for example when you update your ROM). Make sure to chmod things executable if you want them to run.

2. To unpack the ramdisk from boot.img and repack is not very difficult, if you just want to edit an init script. Here is a good overview/guide.

For the S, the boot partition is mtd0 and the base address to use for mkbootimg is 0x12200000. The cmdline is 'mem=477M console=ttyMSM2,115200n8 androidboot.hardware=thunderc'. But, it is better to go through the guide and learn how to find these things than to take my word for it. :)

If you first back up your current boot partition to a file, you can always restore your original boot partition if something goes wrong.

BTW I've posted this info a few times, and I'm sure I'm not the only one. Search is your friend!
 
  • Like
Reactions: basketthis
1. The point of init.d is that you add your new script to the init.d directory, so you don't have to hack existing files (which will be overwritten, for example when you update your ROM). Make sure to chmod things executable if you want them to run.

2. To unpack the ramdisk from boot.img and repack is not very difficult, if you just want to edit an init script. Here is a good overview/guide.

For the S, the boot partition is mtd0 and the base address to use for mkbootimg is 0x12200000. The cmdline is 'mem=477M console=ttyMSM2,115200n8 androidboot.hardware=thunderc'. But, it is better to go through the guide and learn how to find these things than to take my word for it. :)

If you first back up your current boot partition to a file, you can always restore your original boot partition if something goes wrong.

BTW I've posted this info a few times, and I'm sure I'm not the only one. Search is your friend!

I almost understand step 1. I will do more research to see if I can figure out how to script this phone. Scripting is not new to me, just android-based stuff is a new thing. I will see if I can put together a new file myself and have it run before begging for a "gimme" ;)
 
I've been reading up on creating scripts and putting them into the init.d etc... Is it true that I need a mac/linux in order to pack and unpack the boot.img or write scripts?
 
You would create them in Notepad or Wordpad on Windows and then push them to your phone using ADB after mounting /system as rw (read/write) or using Root explorer to mount it rw. Then you would make it executable with adb shell and a "chmod 775" command. You can also edit it with Root Explorer once it's there if you need to make corrections. Scripts in init.d directory are executed in alphabetical order in the boot process and remember that digits come before letters in this order, so sometimes you see file names like 11mount or 20userinit. If you know Unix line editors like edlin or edit you can use them from Terminal Emulator on you phone, also.
 
  • Like
Reactions: basketthis

Members online

Forum statistics

Threads
954,232
Messages
6,960,992
Members
3,162,953
Latest member
vwssimalino