editing boot.img - Android Software/Hacking General [Developers Only]

Ok im not sure how noobish of a question this is but I need to modify the boot.img of a ROM and have tried following this guide http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
I try the first step in Ubuntu OS and I get this
gzip: name.img: not in gzip format
cpio: premature end of archive
If anyone would help me it would be appreciated. Heck I mean i could even tell you what needs to change if you want to do it

Related

editing boot.img

Ok im not sure how noobish of a question this is but I need to modify the boot.img of a ROM and have tried following this guide http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
I try the first step in Ubuntu OS and I get this
gzip: boot.img: not in gzip format
cpio: premature end of archive
If anyone would help me it would be appreciated. Heck I mean i could even tell you what needs to change if you want to do it
use
unpack-bootimg.pl and repack-bootimg.pl

Extracting Boot/Recovery.img - Epic 4G

I have dumped both the boot and recovery partitions using dd (from /dev/block/bmlX) and wish to extract the kernel and ramdisk from these. On my old G1 I could just use the unpackbootimg script from Cyanogen's tree or use unyaffs (IIRC). However the format on this phone seems to be completely different, namely theres no android magic I can find, as the first two bytes are 00. nor is the ANDROID ASCII anywhere else in it. Both unpackbootimg and split_boot fail to extract from the image I have dumped.
Could someone shed some light on what format this phone uses for these two partitions? Or a possible way to extract the files from it?
Any help on this matter would be greatly appreciated.

mkbootimg

I have being trying to port a rom to my phone im using perl script i got to unpack the boot.img but having problem repacking i got mkbootimg not found i dont know where to place it or what commands to run to make it work can somebady please tell me what to do or tell me about another program to pack .img
Im on ubuntu
You need to put it in /bin directory and change permissions to 777....
Check this out..
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images

[Q] Need some help with grabbing system.img

Hello !
I'm trying to set up a dual boot with Ubuntu and Android on my TF101.
I'm using Frank's Tool to do so.
I know i must have the boot.img the recovery.img and the system.img files, and that is the problem : i can't manage to dump my current ROM in img format. I tried with several Recoveries, but i just can't...
All i have in the best scenario is the following :
boot.img
recovery.img
system.ext4.dup
or :
boot.img
recovery.img
system.ext4.tar.a (400+ mb) and system.ext4.tar (0 kb)
Is there any way to grab the system.img from my current ROM, of am i forced to use the one provided in OLiFE Prime (which is fully stock... :crying: )
Many thanks in advance.
What file formats are the .img files? Linux doesn't care about the extension at the end like windows does. You could name the file dog_food.blah and linux is just as happy.
If you just need dumps of the partition, then the dd command will work for system. These will probably be ext4 filesystems.
What are the file types of the olife files that you want to change? From the linux command line, you can just type "file <some system.img here>" and it will tell you. I'm guessing it will say ext4 filesystem. Those tar files you have can probably be converted to what you need.
Disclaimer, I haven't dual booted my tablet and I don't know a thing about Frank's tools.
EDIT: I spent 30 seconds looking at Frank's tools, which appear to be an nvflash interface for windows. I suppose this means you want everything in an nvflash-able format. boot.img and recovery.img will be ANDROID! packed files, while system.img will be an ext4 filesystem.
To be sure, boot.img and recovery.img will start with ANDROID! There are also some boot tools by Rayman and other sources if you want to manipulate these. I think you can grab the system with "dd if=/dev/block/mmcblk0p1 of=/Removable/MicroSD/system.img" It will take a while and will be a large file, maybe 500MB. Depending on where your sdcard is, you might have to change that bit around.
If any of this doesn't make sense, then feel free to google or ask. Good luck!

[Q] Need help with "repack-zimage.sh" - repacked file too large

Hi all,
My Samsung Stratosphere (yeah I know it is old) recently had a hw issue with the Movinand. I cannot access any devices off mmc0. I figured out i can bypass the movinand and remount the mmcblk0 partitions to my external SD card. I also figured out I need to reconfigure my init.rc file (and some others) to do this. I have used the "repack-zimage.sh" tool to extract my initramfs from my zimage kernel. The problem I am having is that the script unpacks things fine..but when I try to repack the initramfs back into zimage, the script stops and gives me the following error:
The command used was "$/ sudo bash repack-zimage.sh -p"
Error: repack-zimage.sh: piggy.gz too large (gzip -9: +689, gzip -8: +1330)
You might want to try a different combination of the -g, -r and -s options.
I ran the repack-zimage using the bash command..and am using Ubuntu 14.04 (if that helps)
The funny thing is I made no changes to any of the initramfs files..I was just testing the script to see if it would unpack and repack correctly.
The reference thread is: [script] repack-zImage.sh: Unpack and repack a zImage without kernel source, V. 5
I know the thread is old, but since I am a new member, I cannot reply within the thread..I was recommended to post here...Sorry if it is in the wrong place.
Any ideas on why the repacked file is larger and how can I modify the script or anything else to correct this issue. When this gets working, I can move onto the next part of the "fix"..and hopefully get my phone working..
Thanks!
EDIT: I was able to get the file repacked..but had to choose "-r" as an option..which means things are not repacked in the same order as the original zImage...So the question is...does it matter? Will the system know the components are "out of order" and deal with it?..or will this cause a problem in the booting sequence?

Categories

Resources