[Q] Rockchip kernel image file - how to build? - Android Q&A, Help & Troubleshooting

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

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?

[Q]Repack a kernel into a boot.img?

I've been learning some development lately and I have a few questions to ask about the boot.img and kernel and things...
As far to my knowledge, it contains the kernel and the ramdisk, correct?
But what about a .sin file? That is also a kernel, isn't it?
But does it contain the ramdisk? Or is ramdisk included in the kernel itself?
For example, what would happen if I only flashed a .sin file on an empty boot partition?
Would the thing boot?
If yes, does that mean there IS ramdisk in the .sin file?
Furthermore, how would I be able to repack the .sin kernel into a boot.img? Just renaming obviously wouldn't do it... But, would anything?
What I'm trying to do:
From an Xperia FTF FW file, I extracted the kernel in .sin file format.
Now, with ready-to-go META-INF and system folders, I came to a dead end where I can't get the boot.img.
The reason for that is that I'm trying to make a Gingerbread ROM. All other ROMs out there (for this phone) are ICS, therefore the kernel wouldn't be compatible.
I COULD just flash the .sin kernel with a PC, but that isn't practical...
Any ideas what could be done?
Sorry for the tricky and unreadable post, but I've been searching the internet for the past 3 hours. No results found...
Thanks!
--someone755
EDIT: Just thought of this:
Better yet; is there a way to use fastboot or adb to pull the boot.img from the device?

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...

How to Create Boot.img and ramdisk.img from ZImage?

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.

reduce bootimage size

I used Cm 13 sources to build a bootimage for my device and everything compiled without any serious error, but i got a very large boot image 8 megabytes. I tried flashing it via TWRP but it constantly gave me error saying bootimage too large for the device.
I also forced flash the bootimage that resulted into a bricked any help would be great
My device is Samsung vibrant
Now im currently compiling the entire rom
try
http://k.japko.eu/boot-img-manipulation.html
or
Okay, first off, let me tell you I'm not at all familiar with your device...so, instead of specifically answering your questions (which would be dangerous/irresponsible of me to have you do something for which I cannot be sure of or vouch since I don't have experience with your device), I'll try to give you some general information (it does seem like you have a good grasp of many of the concepts for getting where you want to go, so maybe I can just fill-in some gaps ).
1. Regarding renaming initlogo.rle to initlogo.rle.old: I'm not sure that doing that will change the splash screen or break something when it goes to look for the initlogo.rle file (a special image file). As you've probably researched, these files are a bit odd and are not just simple image files we're all used to dealing with. I've never successfully been able to create a new initlogo.rle file on my previous attempts a few years back.
2. When you re-pack a bootable image file (boot.img or recovery.img), you need:
- re-pack the updated ramdisk to a new ramdisk.gz file
- rebuild the .img file using mkbootimg utility, specifying the kernel file and the updated ramdisk.gz file
- it's might also be important / necessary to specify the base boot address using the --base <address> parameters when issuing the mkbootimg command where <address> is the base boot address of your device; your bootable image split/unpacking utility should tell you what it sees that the base address is; here is the information I saw when I unpacked the boot.img file that you supplied in your first post:​
[email protected] ~/boot-img-split-tools/ameen
$ ../split_boot.pl boot.img
Page size: 2048 (0x00000800)
Kernel size: 9600396 (0x00927d8c)
Ramdisk size: 1313051 (0x0014091b)
Second size: 0 (0x00000000)
Board name:
Command line: 'console=ttyS0,115200 rw init=/init loglevel=5'
Base address: (0x40000000)
Writing boot/boot.img-kernel ... complete.
Writing boot/boot.img-ramdisk.cpio.gz ... complete.
Unpacking ramdisk... complete.
[email protected] ~/boot-img-split-tools/ameen​
- not having properly set the base boot address might explain why your device didn't boot
- not properly re-packing the ramdisk might explain why your device didn't boot
- not properly rebuilding the bootable image (using the mkbootimg utility)​
3. I kind of understand what you were trying to do by changing the the .md5 file...I'm guessing that you calculated a new MD5 sum of the new boot.img file thinking that would help CWM restore it; that probably doesn't matter unless you've got the MD5/checksum verification enabled; asking/using CWM to restore / install your boot.img is an interesting and non-traditional way of doing that
4. Is the CWM custom recovery specifically built for your device? I did a quick search for it and couldn't find anything. You do indeed need a custom recovery that is built specifically for your device and it's hardware & partition / filesystem layouts and sizes. Just want to make sure that you were aware of that...using the "wrong" custom recovery might be "problematic" (bad).
Edit: I think I might have found which one you used? http://forum.xda-developers.com/showthread.php?t=2189640
5. If you had previously booted into custom recovery on your "broken" device, you still should be able to re-flash or re-launch the custom recovery in the same way that you originally did, yes? The boot and recovery partitions should be separate--so, if you only messed with the boot partition, then you should be okay--unless you've got an incompatible custom recovery that overwrote important things (like your recovery partition...).
I hope that helps...I know I didn't touch on all of your questions...that's probably enough for this post and for what follow-up questions you might have .
Cheers!
source
http://androidforums.com/threads/help-with-boot-img.963358/
I dont have much knowledge about building bootimage but while i was compiling the bootimage i got an error saying no rule to make busybox flash image. So i just copied those file from kernel sources to the out directoru i dont know if that was the problem. Also i had tried using omni 6 sources a few days back i got the right bootimage size but none of my bootimages would bootup my device. Everytime id flash the omni bootimages i got a buggy twrp recovery(faded colors, unreadable text and bootloops. Also regarding the recovery you mentioned there were some dev that built omni lollipop for my device i used TWRP 2.8 to flash all the bootimages

Categories

Resources