[Q]Repack a kernel into a boot.img? - Android Q&A, Help & Troubleshooting

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?

Related

[Q] Convert .img to .sin/.ftf

I've become somewhat of a flash-aholic recently and brick my phone quite often. Especially with all the experimentation with dual boots and kernels and such.
Is there a way to convert my backup .img files to .sin/.ftf files so that they may be flashable via flashtool? I've looked all over the internet and XDA, but can't quite get everything together to make this happen. I know that being able to flash data could be troublesome, but I get tired of having to flash stock firmware and then root, then xrecovery to get back to my backups.
And by that time, I've forgotten what I was experimenting with/where I left off and what baseband I was on.
I'm not looking for a walkthrough, but just a finger-point of in the right direction.
Checked out Doomlords posts, SIN2IMG and the such, but that's to go in the opposite direction that I need.
(I highly doubt, but) If anything, a way to flash xrecovery via flashtool without having a working rom.
unyaffs.exe
Gonna play with this in a bit.
I'll report.
Let me know if you've used this.
Still accepting all help offered.
Compile .sin
Also looking how to compile a .sin file.
Google gives me one of three types of info:
sin(sine wave) - trigonometry
.sin - Microsoft game files (Age of Empires, Rise of Nations, etc.)
and of course, sin - Christian morals
Okay....I cannot find a valid link to Jerplea's SIN reconstructor. Only dead links.
Does anyone have a copy of this? Seems like it'll be my only hope.
andrewddickey said:
Gonna play with this in a bit.
I'll report.
Let me know if you've used this.
Still accepting all help offered.
Click to expand...
Click to collapse
unyaffs worked great. Just drag and drop then you get your system, data, and cache from the corresponding .img.
Now I'm using the ConvertTool to break down the .sin but cannot figure out how to extract the .tgz that comes out. 7zip says that it cannot open it as an archive.
Wanting to look at the file structure of the .sin.
...Back to work...
Thanks to all that......uh............helped?
Hi andrewddickey,
Appears you have been successful in converting .img to .sin/.ftf
If is it true can you make a post telling how achieve this ?
Thanks in advance.
Yea I'd be interested in knowing how to do this too
Sent from my R800i using XDA App
I'm 99.999999% sure you won't be able to flash them using flashtool
Sent from my X10i using XDA App
The whole idea is a no-go.
Sorry. Hope you didn't get your hopes up.
From jerpelea
hy
unfortunately the ones that can create sin files are se
sin is an signed img file , signed with se certificat and we dont have that certificate
img file is an yaffs2 image
after 2.3 release you will not need sin files
Click to expand...
Click to collapse
From zdzihu
Hi Andrew,
Unfortunately we cannot create proper .sin files from yaffs images - .sin files are signed with SE signature and we still don't know the public/private keys.
The .sin structure is quite simple:
[sin header]
[signature1]
[signature2]
[body of the actual image]
If the rumours about bootloader unlocking are true, soon you will be able to flash backup images via fastboot
Cheers,
z
Click to expand...
Click to collapse
unless andrewddickey happens to have the RED certificate to compile the sin.
99.999999% sure you dont
soon i will post tool for that problem for win users
kernel.sin unpack and repack for cracked bootloader...
this question always puzzle me
So....
How to Convert *.img file to *.sin or *.ftf??
please....
A file with the FTF extension is merely a ZIP archive.
if *.img can convert *.sin
it's can flash sin by x10 flash tools
I want to keno,how to Convert img to sin.
thanks a lot...
看来这条路子是走不通的了,如果能的话那真是神了的说
Was an interesting idea buddy
Sent from my X10i using XDA
andrewddickey said:
The whole idea is a no-go.
Sorry. Hope you didn't get your hopes up.
From jerpelea
From zdzihu
Click to expand...
Click to collapse
You can download the msm7227.7z . Extract it and the contents are some apps and some folders.
One of them is 'sinTools'. Inside it are some applications, i think, that can help in making .sin files to sign these.
Please try and help me what to write in the command window.
Thanks in advance.
anyone found a solution yet? would be nice to be able to create your own ftf's
guess it's somehow linked with cryptographics so it's only one way, but i'm too tired to check right now.

[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?

ROMs dont have an update.zip

Hey Guys,
I'm in need of some really n00b friendly advice.
When you flash a new ROM (i.e. CM9) in CWM the tutorials tell you to flash the file named Update.zip. My problem is that I can't seem to find one in the zip file I downloaded for my xperia mini.
I downloaded FXP131, and found the zip file to contain a boot.img, which will be the kernel. And 2 other folders named META-INF and System.
I know how to flash the kernel and expect it was just left in there for easy transportation.
But where in the world is 'update.zip'?
Am I meant to unpackage the kernel then re-zip the META-INF and System folder and then call that 'Update.zip'?
I've flashed roms for some of my other devices before, but they've always used flashtool or samsungs flashtool.
Please help me guys, I don't like sounding this inexperienced
update.zip
I'm wondering if the ROM I am trying to flash needs to be renamed as update.zip in order to work. It is krook's v.6 of JB for the Lenovo K1 tablet. Since the download site has to distinguish between wifi and 3G versions, as well as nvflash versions there are a number of different filenames, however does it need to be renamed after putting it on my SD card?
Generally speaking "update.zip" is used as a generic name. For example the update.zip I just flashed is actually named "rascarlo_maguro_ota_2012-11-01.zip". When you flash a custom ROM in a custom recovery you should be able to browse & flash whichever file you need.
The FXP131.zip file that contains the boot.img and 2 other folders named META-INF and System is the "update.zip"
solved
My problem was an incomplete download. I compared file sizes, and checked md5sums and determined the correct ROM and it is now in the middle of finishing the upgrade/optimization process.
Thx

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

Categories

Resources