[Q]Nozomi(Xperia S) - extracting boot.img problem - Sony Xperia P, U, Sola, Go

Greetings, oh mighty people on XDA!
I am trying to change the FreeXperia screen (.rle file) on the CM 9.1.0 Rom for Xperia S (Nozomi) and i have run into a brick-wall
Whenever i'm trying to extract my boot.img using Dsixda's kitchen(cygwin - i'm a windows user) i get this:
Code:
Android 'magic' header not found at start of boot.img
Checking if it exists elsewhere ...
Warning: Android header not found in boot.img (unsupported format)
Error: kernel offset (page size) is 0
Press Enter to continue
Also found out that Xperia S is not on the kitchen's supported devices list, so here is the question:
how can i unpack and pack my boot.img using windows 7 (64-bit)?

You can extract it with 7-zip, the boot.img is an ELF file. Repacking will be difficult from there without a complete POSIX toolchain.

can't extract it with 7zip, it's said that file was not supported ...

use ultra iso or winrar ... just a wild
guess
Sent from my Xperia U using Tapatalk 2

Related

[DEV][TOOL] Kernel Kitchen {X8/W8}

[size=+2]PLEASE USE THIS THREAD (LINK) FROM NOW ON. I WILL NOT MONITOR THIS THREAD ANYMORE [/size]
INTRODUCTION
So we all know dsixda's XDA ROM Kitchen
Then how about a kitchen for Kernels ??
What started out just as my personal directory where I kept all my kernel and ramdisk tinkering scripts, has now turned into a project (which is far from finished right now )
This does NOT enable you to compile the kernel binary (aka zImage).
This enables you to edit ramdisk and change bootsplash images and helps kernel developers to deploy their compiled kernel in a usable form.
FEATURES
As of now what we can do with the Kernel Kitchen is
Fully menu driven interface (like dsixda kitchen)
Extract zImage and ramdisk from boot.img file
Create boot.img from zImage and ramdisk
Extract zImage and ramdisk from any ftf file that contains kernel.sin (Xperia 2010, 2011, 2012)
Create flashable ftf from zImage and ramdisk (Xperia 2010 only)
Create compressed ramdisk binary from ramdisk folder
Extract ramdisk files from ramdisk binary
Convert png image to rle format (used in android boot splash images)
Convert rle boot splash to png file (so that you can edit it)
Proposed upcoming features
Automatic script to change boot splash in a kernel with your favourite png file
STYLE CODE :
bold are supported only in linux
italics are supported in linux and windows+cygwin
underline are supported in windows native (without cygwin)
(if more than one style is used, it supports all respective platforms)
REQUIREMENTS
This tool is primarily meant for linux users (preferably Uubuntu).
But it works perfectly well on windows+cygwin too
Some portions of the kitchen have support for native windows (without even cygwin)
Rest all requirements are mentioned in the readme
WHAT ARE ITS USES ?
1.The primary purpose (for which this project started out in the first place) is to provide a easy kernel deployment tool for wannabe kernel devs.
A lot of us can compile a kernel from source but that is just the zImage and cannot be used as such on the phone. We need to package it with a ramdisk ad deploy it thorough a proper method (flashtool for Xperia, ODIN for samsund, and fastboot for other phones)
​2.You canedit ramdisk properties (by editing default.prop)
Changing ro.secure=1 to ro.secure=0 makes your ramdisk insecure and enables easy root access ​3.The most immediate and popular use that i can see right now is changing the boot logo to your liking
the boot logo is called logo.rle or initlogo.rle and is placed in the root of ramdisk folder.
When you split kernel, you can find the rle file which you can convert into png, do necessary editing and convert back into rle and pack up the ramdisk and create a new kernel
​4.Other than that, you can change the recovery system
for eg. you can include Doom's Touch recovery system inside your favourite kernel
or you can include the xRecovery inside CM7 kernel so that you can flash amend zips.
Changing the recovery is ofcourse a little more complicated for average users, and i'll write a short tuto for that soon enough ​DOWNLOAD AND USAGE
The sources can be found on www.github.com/championswimmer/kernel-tools
For linux (and cygwin) users I recommend the install git and run this command to get a copy of my repository
Code:
git clone https://github.com/championswimmer/kernel-tools.git
Or in general, all linux and windows users can just get a zipball of my repo here
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All usage information can be found on this elaborate readme
In short all you have to do is cd to the appropriate folder and run this
Code:
./menu
CREDITS
None of this was possible without the helps and works of DoomLord, Azuzu, bin4ry, FXP, defer, blagus, nobodyAtall, the_laser, Androxyde
These works are directly included in my project
DoomLord's kernel.sin and ftf creator (windows version)
These works are used in their modified/repackaged form
DoomLord's png and rle interconversion tool (windows version)
DoomLord's perl script to split kerel.sin
And big thanks to nobodyAtall for pointing me the appropriate linux binaries (or i would have kept pouring wine over windows exe files)
Thanks to ImageMagick developers for the awesome tool
SOURCES USED
1. to565 and from565 source code (part of Android Open Source Project)
2. mkbootimg and mkbootfs standalone sources (part of AOSP)
3. abootimg sources (by Gilles Grandou)
This will help some people to began development...nice sharing
Sent from my E15i using xda premium
milenkokg said:
This will help some people to began development...nice sharing
Sent from my E15i using xda premium
Click to expand...
Click to collapse
thanks,
and for a head-start into "how to compile a kernel"
see this
http://forum.xda-developers.com/showpost.php?p=24885347&postcount=19
thanks champswimer...
I'm waiting your rom update..
Hmmm...i may just be a big of fool enough to try this
nice...
"The guy who ported xperia s firmware to x10" is in x8 block
Amazing!
We may be seeing some new kernels around here soon!
Its developers like you that make a difference
Sent from my Xperia™ PLAY using TapatalkHD
IrishStuff09 said:
Amazing!
We may be seeing some new kernels around here soon!
Its developers like you that make a difference
Sent from my Xperia™ PLAY using TapatalkHD
Click to expand...
Click to collapse
i am certainly interested if someone donates me an old/used X8
I love developing for older models anyways (cause for top mdels therea rea already top devs and i'm not too rich to use smartphones, my x10 was my gift, not bought )
btw guys please keep a tab on my thread on x10 forum as i monitor that closely, (ofcourse i monitor the x8 and mini threads too)
this was mainly for informing you guys,
as i have mentioned, i'll soon move this into chef central as soon as the boot.img area is finished
Linux Mint 12
I have small problem.With Linux Mint 12 . I extracrt kernel.sin in input folder and i run the terminal and write were going to extract him, but they nothing found in kernel.sin.The output folder its empty
danibosev said:
I have small problem.With Linux Mint 12 . I extracrt kernel.sin in input folder and i run the terminal and write were going to extract him, but they nothing found in kernel.sin.The output folder its empty
Click to expand...
Click to collapse
could you give me a screenshot of terminal ???
btw you need to use KERNEL.FTF file, not KERNEL.SIN file
For me too same result...it was empty even I use with ftf files....
But use alternative unpack-kernelsin.pl it can decompiled well but unpack was empty folder only..
Sent from my E15i using XDA
((( RedDeviL ))) said:
For me too same result...it was empty even I use with ftf files....
But use alternative unpack-kernelsin.pl it can decompiled well but unpack was empty folder only..
Sent from my E15i using XDA
Click to expand...
Click to collapse
how about using the argument ???
and please give screenshots of the terminal
((( RedDeviL ))) said:
For me too same result...it was empty even I use with ftf files....
But use alternative unpack-kernelsin.pl it can decompiled well but unpack was empty folder only..
Sent from my E15i using XDA
Click to expand...
Click to collapse
the name of file should be kernel.ftf
abcd.ftf will not work
Sent from my X10S using xda premium
Yes, i download .ftf file in input folder but output folder again its empty ( i do it maybe 5-10 times)
is the name "kernel.ftf" ???
if it is suppose nAa-R20-U15.ftf then change it to kernel.ftf
no other name than kernel.ftf will work
and i have made some fixes, so please redownload the kitchen and try
btw are you on linux or cygwin or mac os ????
I use Linux.I rename the file to kernel.ftf an again nothing.Output it empty
do you have perl installed ???
can you copy paste me the oputput you are seeing on the console screen ???
I have perl 5 installed
Here the output :
Supported Devices:
Xperia X10 (GB update, custom kernels for unlocked bootloaders)
Xperia 2011 devices (Arc, Neo, Play, Mini, Mini Pro, Ray, Pro)
could not open boot img file: kernel.sin
mv: cannot stat `kernel.sin*': No such file or directory
mv: cannot stat `*.cpio.gz': No such file or directory
mv: cannot stat `*kernel': No such file or directory
mv: cannot stat `*header': No such file or directory
mv: cannot stat `kernel.sin-ramdisk': No such file or directory
danibosev said:
I have perl 5 installed
Here the output :
Supported Devices:
Xperia X10 (GB update, custom kernels for unlocked bootloaders)
Xperia 2011 devices (Arc, Neo, Play, Mini, Mini Pro, Ray, Pro)
could not open boot img file: kernel.sin
mv: cannot stat `kernel.sin*': No such file or directory
mv: cannot stat `*.cpio.gz': No such file or directory
mv: cannot stat `*kernel': No such file or directory
mv: cannot stat `*header': No such file or directory
mv: cannot stat `kernel.sin-ramdisk': No such file or directory
Click to expand...
Click to collapse
does your ftf file contain kernel.sin ?
Sent from my X10S using xda premium

[Q] Help flashing custom zImage on nAa-jb-03

Hi All,
A totally newbie question. I have compiled the naA-jb kernel at my end (no changes, just recompiled) and have the zImage file. I want to flash this on my U20i device now. However, I cannot find a way to do it. I read about fastboot, but it seems that X10 mini pro does not support fast boot. I tried the search key press, and connecting to PC for fast boot). In Flashtool the button to install the Kernel is always greyed out. Is there any way in which I can flash the kernel? My X10 mini pro is running naA-jb-03 kernel. I'm using Windows 8. Thanks.
Well I was able to solve the issue by using the Android Kernel Kitchen by championswimmer. Basically revolved around extracting the existing ftf file and creating a new kernel.sin file using the kitchen. Then replaced the kernel.sin in the original ftf. If there is any other way, you are welcome to answer.
New in nAa-jb-05
With nAa-jb-05 the above method will not work. This is so because it introduces lz4 compression for zImage and the ramdisk. Working on a way to get over this and will post an update.
So one way to do is as follows:
1. In flashTool, Use Extractors -> ELF and select the kernel.sin file from the original ftf.
2. It will output 2 files kernel.elf.Image and kernel.elf.2
3. Take kernel.elf.2 and use lz4 to decompress using the -d option.
4. Above step will output the ramdisk cpio file.
5. Use the existing method of Kernel tools to gz the cpio file and place your compiled zImage to get kernel.sin.
6. Use bundle creator in flashTool to create ftf.
Structure of nAa-jb-05
OK just to keep things in my mind clear:
1. Extract kernel.sin file from the ftf file using winrar or 7-zip
2. This kernel.sin file contains the kernel zImage and the ramdisk
3. In the nAa-jb-05 version of the kernel.sin file, the ramdisk (which is cpio'ed already) is compressed using lz4 compression. The zImage is also compressed using lz4, but that is during the kernel compilation time.
4. To extract the zImage and the ramdisk from the kernel.sin file, we can use the FlashTool. Fire up the Sin Editor and select the kernel.sin file. You can now click on the "Dump Data" button. This will dump the kernel.elf file and the kernel.partinfo file.
5. Now the kernel.elf (~ 8 MB in nAa-jb-05) can be extracted using the "Extractors -> Elf" option in FlashTool.
6. 2 files will be dumped from the ELF, the kernel zImage by the name kernel.elf.Image and the kernel.elf.2 file which is the lz4 compressed ramdisk.
7. If you open up the kernel.elf.Image file in a hex editor, you will be able to see the standard [0x00 0x00 0xa0 0xe1] pattern.
8. If you open up the kernel.elf.2 file you will see the lz4 magic sequence 0x184C2102 (little endian).
9. Now you can decompress the kernel.elf.2 using lz4 (you will need to compile on linux/(Ubuntu) from source). Also note that the magic number should be 0x184C2102 and not 0x184C2103 during the compilation stage.
10. Once decompressed you get the ramdisk.cpio.
11. You should be good from here.
I will follow-up with the "stich-up" up to "kernel.sin" with modified/re-compiled zImage method shortly.
Stitch-up related:
1. If modifying the init-ramdisk contents make sure to cpio and then do a lz4 compression.
2. Put it in the input folder of kernel-tool-master by championswimmer.
3. Place the compiled zImage (by selecting lz4 during compilation, config) in the input folder too.
4. Create a kernel.sin file using the kernel-tool-master
5. Use the kernel.sin file created above, to create ftf file using the Bundle creation option in FlashTool.
If changing version string kernel recompile
Also, take care that in case you modify the kernel during compilation, (such that you change the version string etc.), then you will need to recompile all the loadable kernel modules again. In this case, you would be required to re-compile the wireless modules again.
As a side-note, there is no need to use the build_wifi script for building the kernel modules. These are legacy, not required for 05 version of the kernel. modules_install should be good enough.
AW: [Q] Help flashing custom zImage on nAa-jb-03
QueryType said:
As a side-note, there is no need to use the build_wifi script for building the kernel modules. These are legacy, not required for 05 version of the kernel. modules_install should be good enough.
Click to expand...
Click to collapse
Are you interested in joining our Team? Please PM...
Sent from my U20i using xda app-developers app

[Resolved][Q] How to modify default.prop in nAa Kernel

Hi All,
Due to specific APP requirement, I need to modify some settings in kernel.
Here are all the settings I need to modify in default.prop:
ro.secure=1
ro.debuggable=0
persist.service.adb.enable=0
Here are the methods I already try:
1. Android Kernel; Kitchen 0.3.1 (http://forum.xda-developers.com/showthread.php?t=1659584)
Fail at extract kernel.sin, cannot found RamDisk
2. dsixda's Android Kitchen 0.224 (http://forum.xda-developers.com/showthread.php?t=633246)
Fail at extract kernel.sin, cannot found RamDisk
3. kernel.sin unpacker by DooMLoRD (http://forum.xda-developers.com/showthread.php?t=1262656)
Fail at extract kernel.sin, cannot found RamDisk
4. Tools in Xperia FlashTool
Fail...
The kernel.sin was extract from 2.6.32.61-nAa-jb-06.ftf. (http://forum.xda-developers.com/showthread.php?t=2136471)
I already start studying how to compile nAa kernel...
Is there any easier way to apply this change?
Thanks!
Resolved.
It's because LZ4 compress format.
Here are the steps to Unpack nAa Kernel / Modify default.prop / Repack Kernel FTF
1. Decompress nAaKernel.ftf
You will got Kernel.sin
2. FlashTool => Tools -> Sin Editor => Select Kernel.sin => Extract data
You will got kernel.elf and kernel.partinfo
3. FlashTool => Tools -> Extrators => Elf => Select kernel.elf => Unpack
You will got kernel.elf.2 and kernel.elf.Image
kernel.elf.2 = ramdisk binary which compressed by LZ4!
kernel.elf.Image = zImage
4. Rename kernel.elf.Image to zImage
5. Rename kernel.elf.2 to ramdisk.lz4 and use LZ4 tools to decompress it
You will got a new ramdisk binary which was known as ramdisk.cpio
6. Rename ramdisk which extracted in step.5 to ramdisk.cpio
7. Copy ramdisk.cpio and zImage to ubuntu system.
8. Extract ramdisk.cpio and you will see default.prop
Make any modify you need.
9. Compress ramdisk folder to ramdisk.cpio
Here are the commands:
find . | cpio -o --format=newc > ramdisk.cpio
10. Compress ramdisk.cpio by GZip
Here is the command:
gzip ramdisk.cpio
11. Use Kernel Kitchen to create kernel.sin
Put ramdisk.cpio.gz and zImage in input folder under Kernel Kitchen.
Create kernel.sin by this tools.
12. FlashTool => Tools => Bundle Creation => select kernel.sin and loader.sin => Create your FTF
13. Flash into your device!
Although Puzzle & Dragons still cannot works on X10 mini with MiniCM10...
But I tried and learned something. :laugh:
thanks for explaining the process
it is very useful for me .
ramdisk.gpio decompress & compress
I tried to follow all steps, but isn´t work for me :'(
What I did:
1) decompress E15_2.6.32.60-nAa-05.ftf with 7z under windows: I get kernel.sin and loader.sin (OK)
2) extract data from kernel.sin with flashtool (0.9.16) under windows: I get kernel.elf and kernel.partinfo (OK)
3) extract elf from kernel.elf with flashtool (0.9.16) under windows: I get kernel.elf.2 & kernel.elf.Image (OK)
4) renamed kernel.elf.2 to ramdisk.lz4, and kernel.elf.Image to zImage; both under windows with f2 (OK)
5) decompress ramdisk.lz4 (3662KB) under windows (fastcompression . blogspot.com . es/p/lz4.html): I get ramdisk (4608KB) (it supposed to be renamed, so I expect it´s ok)
6) renamed ramdisk to ramdisk.cpio under windows with f2 (OK). Copy to ubuntu (QUESTION: zImage is used in ubuntu only in kernel kitchen???)
7) extract ramdisk.cpio (4718592- not command in the post): I used cpio -i -F ramdisk.cpio (9216 blocks); 4 new elements> default.prop init (files) android modules (directories)
8) I want to check I can extract & compress ramdisk (and make a "new" kernel), so I don´t do any modification
9) with only those 4 elements in the directory (default.prop init (files) android modules (directories)), I make ramdisk: find . | cpio -o --format=newc > ramdisk.cpio (PROBLEM: alert message "ramdisk.cpio has been increased, 4718080 new bytes has not been copied" other line "27647 blocks")
Original ramdisk.cpio was 4718582, but the new one is 14155264... 3 times more!!! I think the problemis here, but I don´t know how to resolve it
I have done the rest of the manual
10) kernel.sin created with kernel kitchen 0.2.3 under ubuntu (last kitchen version gives me an error, because in despite of choose create kernel.sin from zImage and ramdisk, it tries to do a ftf from kernel -not available- and ramdisk)
11) ftf creation under windows with X10 flashing tool 0.5.0.0 (flashtool 0.9.16 force me to write what device is for, but the cell is blocked, so I cann´t do it) OK
12) I tried to flash it, but it was aborted, so I expect ftf was incorrect
Sorry for wrote all: I thik the problem is extracting and compresing randisk.cpio, but I prefer to write everithing to be sure and be as clear as possible.
Any help will be great!

[TOOL][SHARE] Boot.img tools (unpack,repack,ramdisk)

Note: I'm just sharing the work of the XDA Member CNexus.Here's a little introduction by him :
CNexus said:
I have not seen this posted anywhere, so I thought I would post it here. This is NOT purely my work, and I do not take credit for it as such.
Included in the attached ZIP are the following files:
boot_info - prints information about the boot.img passed to it, including the base address and ramdisk address. This tool prints out everything needed to repack the boot.img correctly.
split_boot - More commonly known as split_bootimg.pl, this rips apart the boot.img to extract the ramdisk and zImage. It has been modified by me to split the boot.img into a separate folder (specified by the file name of the boot.img passed to it) and to extract the ramdisk into a sub-folder as well (extracts the cpio from the gz and then extracts the actual files from the cpio archive)
unpack_ramdisk - unpacks the given ramdisk file.
Code:
Usage: unpack_ramdisk
repack_ramdisk - repacks the ramdisk from the given directory (found online and modified slightly to take a directory)
Code:
Usage: repack_ramdisk [outputFile]
mkbootimg - mkbootimg binary that creates a boot.img file from the given ramdisk and zImage. Updated to a version compiled by me to support the --ramdiskaddr option (ramdisk address) so that even nonstandard boot.img's can be repacked correctly (Use with boot_info for best results).
umkbootimg - included for convenience. Not made by me. Original thread here.
unpack - wrapper script made by me for the umkbootimg binary^ to unpack the boot.img into a separate directory and then unpack the ramdisk into a sub-directory.
Note: These tools were made for Linux. They may also work on Cygwin, but I have not personally tested them.
ANYONE is free to use / modify / kang these files as they see fit. No need to ever ask or do anything more than download.
Enjoy.
Click to expand...
Click to collapse
Download the required files from the original thread.
Original Thread : http://forum.xda-developers.com/showthread.php?t=2319018
1+
Sent from my GT-S5360 using Tapatalk 2

[Q]

hello
i want to create custom boot image.i am using cygwin bash shell and android kitchen.
i extract boot.img with Android Kitchen 0.194 Tools for boot images <unpack/re-pack/etc.>
it show like this
Working folder found
Kernal found at offset 2048 in boot.img
Making folder BOOT-EXTRACTED ....
Extracting kernal ...
Extracting ramdisk ...
Error : NO ramdisk folder found!
Press Enter to counting
How i solve Error:NO ramdisk folder found.
Are you have trouble extracting from the phone or extracting the .img file into something editable? I see at the top of the first page here that there is an update to the Kitchen. Maybe the newer version supports your phone better?

Categories

Resources