How to Create Boot.img and ramdisk.img from ZImage? - Android Q&A, Help & Troubleshooting

Hi all,I am new to android world.I am trying to create a own kernel image.I have downloaded Kernel source for gt-s6012 and built it. I got zImage by building kernel . How can i get boot.img and ramdisk.img from this zImage. I have searched throughout Google but couldn't find a proper answer. Any clues ?

Boot.img are image where both kernel (zimage) and ramdisk are stored. You should make one with bootimg tools, and you can get ramdisk from your phone (search xda). At the other hand you can use anykernel template and it's even easier. Hope it helps

Matthew_333 said:
Boot.img are image where both kernel (zimage) and ramdisk are stored. You should make one with bootimg tools, and you can get ramdisk from your phone (search xda). At the other hand you can use anykernel template and it's even easier. Hope it helps
Click to expand...
Click to collapse
Thanks for the suggestion..Can you provide any link or procedure to make the boot.img from zImage and ramdisk.

Related

[Q]Kernal flash via Fastboot HBOOT1.5

I need to either convert a flashable .zip to a boot.img or find out how to flash a .zip kernel from fastboot I kinda softbricked my phone
timinator94 said:
I need to either convert a flashable .zip to a boot.img or find out how to flash a .zip kernel from fastboot I kinda softbricked my phone
Click to expand...
Click to collapse
kernel flashing has essentially three parts on the HTC EVO 3D.
1) the kernel binary, zImage file
2) the ramdisk
3) the kernel modules/system files (custom kernels with etc.d, etc.)
custom and stock kernels are distributing in either one of two packages:
1) boot.img = zImage + ramdisk
2) anykernel = zImage + files to extract current ramdisk and merge with zImage before flashing (dump_image, unpackbootimg, createnewbootimg, etc)
flashing a kernel through fastboot will work to load the kernel and ramdisk but will not allow the system files (modules for wifi and wimax, at minimum) to be loaded. you will have to load these files after you get the device booted.
a flashable .zip for kernels will either containg the actual boot.img as mentioned above in #1 or it will contain the zImage, mentioned above in #2.
if the flashable .zip is distributed as method #2 - anykernel - you can merge a ramdisk manually to create the boot.img. googling the terms, htc boot.img ramdisk should give a few guides on the process.
in my opinion, best method if you have "soft bricked", is to reload the boot/system partitions through a custom recovery.
hope that helps!
joeykrim said:
kernel flashing has essentially three parts on the HTC EVO 3D.
1) the kernel binary, zImage file
2) the ramdisk
3) the kernel modules/system files (custom kernels with etc.d, etc.)
custom and stock kernels are distributing in either one of two packages:
1) boot.img = zImage + ramdisk
2) anykernel = zImage + files to extract current ramdisk and merge with zImage before flashing (dump_image, unpackbootimg, createnewbootimg, etc)
flashing a kernel through fastboot will work to load the kernel and ramdisk but will not allow the system files (modules for wifi and wimax, at minimum) to be loaded. you will have to load these files after you get the device booted.
a flashable .zip for kernels will either containg the actual boot.img as mentioned above in #1 or it will contain the zImage, mentioned above in #2.
if the flashable .zip is distributed as method #2 - anykernel - you can merge a ramdisk manually to create the boot.img. googling the terms, htc boot.img ramdisk should give a few guides on the process.
in my opinion, best method if you have "soft bricked", is to reload the boot/system partitions through a custom recovery.
hope that helps!
Click to expand...
Click to collapse
Its number 2 LOL anyway to flash or convert it to a flashable .img?
timinator94 said:
Its number 2 LOL anyway to flash or convert it to a flashable .img?
Click to expand...
Click to collapse
joeykrim said:
if the flashable .zip is distributed as method #2 - anykernel - you can merge a ramdisk manually to create the boot.img. googling the terms, htc boot.img ramdisk should give a few guides on the process.
hope that helps!
Click to expand...
Click to collapse
yes, there is definitely a way. answered that in my previous post. added a link to a helpful guide from the google search i suggested.
HOWTO: Unpack, Edit, and Re-Pack Boot Images
also googling android boot.img ramdisk can be a helpful search. there are tons of guides out there.
sorry if the details i give are a bit too deep. after reading a guide or two, you might want to revisit my previous post as it gives the specific details to the boot.img structure and which files are needed. let us know if you have any specific questions to the process and which guide is most helpful!
on another note regarding general approach, personally after a bad flash, the simpliest way to recover thru flashing a kernel via fastboot is to flash the stock kernel, not a custom kernel distributed via the anykernel zImage style. once i'm back up and running, then i'd tackle flashing custom kernels, merging/splitting ramdisk with boot.img and zImage, etc.
good luck!
Tried the guide but googles download for the mkbootimg is down any mirrors?

[Help nedded] Repacking boot.img with newly compiled zImage

Hello,
I searched a lot for a tutorial showing how to repack or create a boot.img with a newly compiled zImage BUT didn't find a valid one for S3.
I'm using kubuntu 13.04 and the kernel compilation (update10) succeeded as I (painly) managed to arrange the build environment.
I then tried to use abootimg to unpack another boot.img but both the command of update or create boot.img are failing because of size mismatch ...
Can anybody help me ? It's the last step keeping me away from entering the S3 kernel development world
Try XDA Development hacking Android Chef Central etc .
jje

[Q] Rockchip kernel image file - how to build?

I have a working Kernel - http://forum.xda-developers.com/attachment.php?attachmentid=1743802&d=1361298599
but I need prepare a new one - compilation it is no problem, but how to prepare img file for taht?.
I heard that this is a Rockchip kernel image file - so I am a looking for information how to build this kind of kernel?
Procesor is RK3066.
mafamafa said:
I have a working Kernel - http://forum.xda-developers.com/attachment.php?attachmentid=1743802&d=1361298599
but I need prepare a new one - compilation it is no problem, but how to prepare img file for taht?.
I heard that this is a Rockchip kernel image file - so I am a looking for information how to build this kind of kernel?
Procesor is RK3066.
Click to expand...
Click to collapse
If that is a zImage, then you need to pack it into boot.img in order to flash.
There are many boot.img tools out there which can help you. But the thing is you will be needing your device's original boot.img (Which can be extracted from your device depending upon the partition) which contains the Ramdisk in order to be successful.
coolsandie said:
If that is a zImage, then you need to pack it into boot.img in order to flash.
There are many boot.img tools out there which can help you. But the thing is you will be needing your device's original boot.img (Which can be extracted from your device depending upon the partition) which contains the Ramdisk in order to be successful.
Click to expand...
Click to collapse
In fact it is a regular (no gziped) image not a zImage. The file after unpacking from RK3066 format starts with bytes d3 f0 21 (to unpack I'm using rkutils ).
But I don't understand why we need to make boot.img with this file and only after that, upload boot.img to the device. Normally it should be possible just to upload kernel.img to the partition where kernel is stored, no?
After kernel from the link above is uploaded to this partition, the device boots up without problem. But when we compile new kernel and upload it (after converting with rk-tools ) it is not even possible to boot the device.
Any idea what's going on? Is compiling a kernel, then converting to rk3066 format is enough ?
flowher said:
In fact it is a regular (no gziped) image not a zImage. The file after unpacking from RK3066 format starts with bytes d3 f0 21 (to unpack I'm using rkutils ).
But I don't understand why we need to make boot.img with this file and only after that, upload boot.img to the device. Normally it should be possible just to upload kernel.img to the partition where kernel is stored, no?
After kernel from the link above is uploaded to this partition, the device boots up without problem. But when we compile new kernel and upload it (after converting with rk-tools ) it is not even possible to boot the device.
Any idea what's going on? Is compiling a kernel, then converting to rk3066 format is enough ?
Click to expand...
Click to collapse
Ok, I just had a look at your link and yes, it contains the kernel.img file. So it should be the kernel image file which needs to be flashed. What you actually needed to do is, unpack that kernel image using the tools of your choice and you'll get the ramdisk, zImage etc when unpacking. If you have compiled kernel from Sources, then you need to replace the zImage with yours (Found in arch/arm/boot) if your compilation was successful without errors and repack it to form the kernel.img.
But that doesn't mean it should boot compulsorily, it may not boot depending upon various weird reasons. You may have to fix it by yourself. Nearest bet is using your device's config file (Found in /proc/config.gz) and use that to compile your kernel. You can find all infos regarding what I've mentioned in this thread:
http://forum.xda-developers.com/showthread.php?t=1748297

boot.img changes after unpack-repack without edit

I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img,
and there is no question if I use a boot.img extracted from an android3.x-version rom, but if the android version changes to 4.x, the unpack-repack process would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...
does anybody knows why?
binghemoye said:
I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img, does anybody knows why?
Click to expand...
Click to collapse
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
B.B.N. said:
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
Click to expand...
Click to collapse
There is no question if I use a boot.img extracted from an android3.x version rom, but if the android version changes to 4.x, the unpack-repack would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...

Idetifying Kernel in Boot.img

I'm new to android development
I was told I needed to swap out the kernel in the boot.img to a recovery.img
I used Android Image Kitchen to unpack both images.
I see 2 folders called ramdisk and split_img
Which one is the kernel?

Categories

Resources