Help editing boot script or editing boot.img

text editors

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.

Just one thought, while I love Lichans instructions (havn't tested them sadly), I feel inlined to point out one thing. Though this may be obvious to at least some.

Notepad in particular is notorious for using well lets just say 'unorthodox' word wrap and character separators. Because of this a lot of code written in a unix/linux/or programming editor is going to format things very weirdly and you won't be able to properly read things. Personally I recommend a good c/c++ editor (I use devc++ from bloodshed for most of this type of work) but you could also look at gedit for windows.

Otherwise notepad might work for you, but I usually have too many headaches when I use notepad.

EDIT: Since android is built using java, if you intend on working on more android code I would probably recommend an editor that is gauged for java rather than c/c++ - I have my editors already on my PC from being an admin on a mud, all that code is lpc. The main difference is some editors include different libraries. Having said that a c/c++ editor will still work, it just comes down to personal preference
 
Last edited:
  • Like
Reactions: basketthis
I would still like to figure this out however I noticed after running interactive for a couple of days that the battery life seems to be worse...

I see what you're saying with the notepad issue. I will give this a shot. Seems that all the info is here but with me being new to all this I have been a little hesitant. And I'm still not certain that I know how to undo this once I do it. lol
 
undo

And I'm still not certain that I know how to undo this once I do it. lol

Can't speak for everything, but aslong as you make a nandroid and can reboot to recovery you should be able to restore from it to undo anything
 
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 can probably do from Windows/cygwin. I don't know enough about it (I borrow a Windows machine to run LG Mobile Update and that's about it) but if you have the SDK and adb working then you can probably figure the rest out. You would need either GNU cpio or mkbootfs, along with mkbootimg compiled on top of your standard cygwin stuff.

(OR, you could do the mkbootfs/mkbootimg stuff on your phone ... the AnyKernel updater does this, so for instance if you download one of the picasticks kernel zips, in the kernel directory you will see the ARM binaries the updater uses. You can just copy these files to your phone, chmod them executable and run them.)

Personally, if it were me I'd just run Linux in a VM. I dunno what Windows/cygwin does exactly, but for instance, the ramdisk is a rootfs image, and just unpacking it onto a non-UNIX fs and repacking it and expecting it to "just work" would make me nervous.

EDIT/ADD:

Re: writing scripts, you can do that with anything.

Assuming your phone is rooted, you have busybox which means you have vi. Just adb shell to your phone and use vi (if you have never used vi, it will only take you 5 minutes to learn basics like :w to save, :q to quit, i to go into insert mode, ESC to exit insert mode).

Or you can adb push/pull files and edit in Notepad or whatever. To me that would get old fast. You can use dos2unix, vi or sed to get rid of the CR characters (^M) that Notepad will put in your text files.
 
Last edited:
  • Like
Reactions: basketthis
VMware

You can probably do from Windows/cygwin. I don't know enough about it (I borrow a Windows machine to run LG Mobile Update and that's about it) but if you have the SDK and adb working then you can probably figure the rest out. You would need either GNU cpio or mkbootfs, along with mkbootimg compiled on top of your standard cygwin stuff.

(OR, you could do the mkbootfs/mkbootimg stuff on your phone ... the AnyKernel updater does this, so for instance if you download one of the picasticks kernel zips, in the kernel directory you will see the ARM binaries the updater uses. You can just copy these files to your phone, chmod them executable and run them.)

Personally, if it were me I'd just run Linux in a VM. I dunno what Windows/cygwin does exactly, but for instance, the ramdisk is a rootfs image, and just unpacking it onto a non-UNIX fs and repacking it and expecting it to "just work" would make me nervous.

EDIT/ADD:

Re: writing scripts, you can do that with anything.

Assuming your phone is rooted, you have busybox which means you have vi. Just adb shell to your phone and use vi (if you have never used vi, it will only take you 5 minutes to learn basics like :w to save, :q to quit, i to go into insert mode, ESC to exit insert mode).

Or you can adb push/pull files and edit in Notepad or whatever. To me that would get old fast. You can use dos2unix, vi or sed to get rid of the CR characters (^M) that Notepad will put in your text files.

Aye, that would do, personally I wouldn't recommend cygwin but using a VM should work nicely. VMware player recently added the ability to create VMs natively and is free. Personally what I do before installing a new linux distro first is run it as a VM anyway, so you could just download the installer for something like Ubuntu or OpenSuSE and create a VM rather than actually installing it.

The main issue with cygwin that I've found is in removing it later, it doesn't do well at removing all it's files if you do decide to remove and going back to remove things manually while possible get's old really quick.

EDIT: While VM Ware player won't remove your VMs usually on uninstall either, these are saved in a single directory and are much easier to delete if you decide rather than tracking down the cygwin files.
 
Last edited:
  • Like
Reactions: basketthis

Trending Posts

Members online

Forum statistics

Threads
957,913
Messages
6,974,916
Members
3,163,937
Latest member
mideola1717