Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,741,924 Members 45,464 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE][HOW-TO]Extracting A 'boot.img' From An FTF

Tip us?
 
matt4321
Old
(Last edited by matt4321; 30th March 2014 at 06:25 PM.)
#1  
matt4321's Avatar
Recognized Contributor - OP
Thanks Meter 1132
Posts: 1,521
Join Date: Dec 2011
Location: Oxford/Leicester, UK

 
DONATE TO ME
Default [GUIDE][HOW-TO]Extracting A 'boot.img' From An FTF

This is compatible with a wide variety of Xperia Devices


A guide bought to you by matt4321 and DaRk-L0rD


Here I am going to show you how to get the boot.img (kernel) out of an FTF! This procedure is most useful for Locked Bootloaders as it means we can upgrade without the need for FlashTool!

This guide assumes that you have FlashTool installed on your PC

#############################

Step 1:

You need a file extractor such as WinRar or 7zip.

Once this is done you want to open the whole FTF in the extractor. You will see a lot of .sin files!

The one we want is 'kernel.sin', not 'fotakernel.sin'.

Extract that file to somewhere appropriate on your computer, like the desktop!



#############################


Step 2:

Now you need to open FlashTool,

At the top you will see a tab that says 'Tools', click on that and select 'SIN Editor'. You will see a button that has 3 dots in the top right. This is the browse button, click on it and locate where your SIN file is.

One that is done, you need to click on 'Dump Data'.

This will dump the 'kernel.elf' to the same location of where your 'kernel.sin' is.




#############################


Step 3:

The next part is simple,

All you need to do is rename your 'kernel.elf' to 'boot.img' and put it in a flashable zip, to make the flashable zip follow the instructions by @DaRk-L0rD in the 2nd post!

Keep in mind that the kernel should be 20mb.




#############################


Step 4:

Enjoy! The kernel can be flashed via PhilZ for Locked Bootloaders and will work on both Locked and Unlocked bootloaders, since it is an official kernel it is signed by the Sony key so will be fine for Locked Bootloaders.

Nexus 7 (2013) | Nexus 5 | Motorola Xoom
Follow Me On Twitter
The Following 19 Users Say Thank You to matt4321 For This Useful Post: [ Click to Expand ]
 
DaRk-L0rD
Old
(Last edited by DaRk-L0rD; 30th March 2014 at 07:10 PM.)
#2  
DaRk-L0rD's Avatar
Recognized Contributor / Themer
Thanks Meter 4567
Posts: 1,922
Join Date: Sep 2012
Location: Isla de Muerta

 
DONATE TO ME
If you want to make a kernel's flashable zip

What you need:
1. winrar
2. Notepad++
3. The attachment: META-INF.rar
4. boot.img or kernel.elf


Procedure:

1. Extract the META-INF folder from the rar archive previously downloaded.

2. Open it and go META-INF -> google -> android and using Notepad++ edit the updater-script (right click on it and choose open with Notepad++).

3. Now you can see that the updater-script looks like this:



4. The line package_extract_file("boot.img", "/dev/block/mmcblkXXX"); should be edited ONLY for 2 reasons.
  • In case you have a kernel.elf (custom kernels) instead of a boot.img
  • To edit the mmcblkXXX partition since it's different for each device

5. At the end of this post you will find a list of the /mmcblkXXX . For each device are different to choose wisely!!

In my case is the /mmcblk0p4, so will look like this:



6. ui_print(""); , inside the " " you can add the text what you want. Remember that all the users will use this zip will be able to see what you wrote, so please be polite

For example:

Quote:
ui_print("Installing the kernel");
ui_print("matt4321");
ui_print("DaRk-L0rD");
ui_print("");
package_extract_file("boot.img", "/dev/block/mmcblk0p4");
ui_print("Enjoy");
ui_print("Hit the thanks button");
----------------In case the kernel's format is kernel.elf, you can change the line and make it look like this: ----------------

package_extract_file("kernel.elf", "/dev/block/mmcblk0p4"); (as i said you before, the partition is my case is mmcblk0p4)


Also, make sure that you leave an empty line at the end of the commands (as you can see the line number 8 is empty).

6. Now select the META-INF folder and the boot.img or the kernel.elf file, right click on them and select Add to archive.

7. Make sure that the Archive format is ZIP and the Compression method is Store

8. Now your flashable zip is ready!

9. Enjoy



List of /mmcblkXXX

Each device has different partition for the kernel. Here is a list of those we found so far:
  • Xperia SP ---- /dev/block/mmcblk0p4
  • Xperia T---- /dev/block/mmcblk0p4
  • Xperia V---- /dev/block/mmcblk0p4
  • Xperia TX---- /dev/block/mmcblk0p4
  • Xperia Z1---- /dev/block/mmcblk0p14
  • Xperia E---- /dev/block/mmcblk0p3
  • Xperia Tipo---- /dev/block/mmcblk0p3
  • Xperia S---- /dev/block/mmcblk0p3
  • Xperia Ion---- /dev/block/mmcblk0p3

Since we don't know all devices' partition, you should give us a hand.
Here is what you have to do:


Procedure:

via adb shell

Quote:
ls -l /dev/block/platform/
then pick the top one (in my case is msm_sdcc.1), so

Quote:
ls -l /dev/block/platform/msm_sdcc.1/by-name
Then which ever says 'kernel' is the one we want.
The Following 15 Users Say Thank You to DaRk-L0rD For This Useful Post: [ Click to Expand ]
 
dipesh1502
Old
#3  
dipesh1502's Avatar
Senior Member
Thanks Meter 3322
Posts: 2,268
Join Date: Sep 2013
Location: MUMbai

 
DONATE TO ME
On portal
Congrats you 2


If You Like My Work Please Consider A Small Donation


For Donating Click Here
 
please do the following:
Sign in to your PayPal account page
Go to 'Send Payment'
Enter my email id "dipesh.febrius@gmail.com"
option "Personal payment" doesn't work for India, please set "Online purchases". and check Goods or Service (preferably service)
Make the payment of the desired amount of donation you want to send.
Thank you for your kind donations!
 
DooMLoRD
Old
#4  
DooMLoRD's Avatar
Recognized Developer
Thanks Meter 38007
Posts: 13,045
Join Date: Jul 2010
Location: Noida
Took much of wrong/incorrect/partial info in this thread...
The Following User Says Thank You to DooMLoRD For This Useful Post: [ Click to Expand ]
 
DaRk-L0rD
Old
(Last edited by DaRk-L0rD; 2nd April 2014 at 12:32 PM.)
#5  
DaRk-L0rD's Avatar
Recognized Contributor / Themer
Thanks Meter 4567
Posts: 1,922
Join Date: Sep 2012
Location: Isla de Muerta

 
DONATE TO ME
Quote:
Originally Posted by DooMLoRD View Post
Took much of wrong/incorrect/partial info in this thread...
Could you give us a hand with the right/correct/total mate?
We tested all this in different Xperia devices and never had issues and that's why we made the tutorial.

If you like my work, please consider buying me a beer! Thanks in advance!
SONY XPERIA Z1 & T

MY CONTRIBUTIONS
 
matt4321
Old
#6  
matt4321's Avatar
Recognized Contributor - OP
Thanks Meter 1132
Posts: 1,521
Join Date: Dec 2011
Location: Oxford/Leicester, UK

 
DONATE TO ME
Quote:
Originally Posted by DooMLoRD View Post
Took much of wrong/incorrect/partial info in this thread...
Reiterating what DaRk-L0rD said, what can we change/how can we make it better?

Sent from my LT30p using Tapatalk

Nexus 7 (2013) | Nexus 5 | Motorola Xoom
Follow Me On Twitter
 
Rizal Lovins
Old
#7  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor
Thanks Meter 14544
Posts: 1,441
Join Date: May 2012
Location: Bandung - Sauron The Great Eye
Quote:
Originally Posted by DaRk-L0rD View Post
Could you give us a hand with the right/correct/total mate?
We tested all this in different Xperia devices and never had issues and that's why we made the tutorial.
Quote:
Originally Posted by matt4321 View Post
Reiterating what DaRk-L0rD said, what can we change/how can we make it better?

Sent from my LT30p using Tapatalk
btw you can still use with this script :

Code:
Select Code
package_extract_file("kernel.elf", "/dev/block/platform/msm_sdcc.1/by-name/Kernel");
Code:
Select Code
package_extract_file("boot.img", "/dev/block/platform/msm_sdcc.1/by-name/Kernel");
you don't need to change compressed zip to store, normal is work

Ash nazg durbatulūk, ash nazg gimbatul, ash nazg thrakatulūk agh burzum-ishi krimpatul.
One ring to rule them all, one ring to find them, one ring to bring them all and in the darkness bind them.

Closer to me? everything about me and my work!!!
DON'T PM me for any question regarding my work, please post in specific thread, anyone can help you, I WON'T respond
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
The Following 2 Users Say Thank You to Rizal Lovins For This Useful Post: [ Click to Expand ]
 
silveraero
Old
#8  
silveraero's Avatar
Senior Member
Thanks Meter 184
Posts: 1,033
Join Date: Jul 2011
Location: Ho Chi Minh City
For a long time since Xperia X10, I think we can't flash kernel using an update package to flash in CWM?
 
ibanez7
Old
#9  
ibanez7's Avatar
Recognized Themer / Recognized Contributor
Thanks Meter 4071
Posts: 1,069
Join Date: Mar 2012
Location: Bandung

 
DONATE TO ME
This guide is very simple and very interesting, especially for locked bootloader users, but with just "rename" it would not cause a very high risk? ...
sorry with my question (just want to make sure ), because I know about kernel on Xperia devices that are quite complicated (unlike the Galaxy device)

btw, thank for the very simple guide, this is very useful, especially for my rom
Let's hangout! add me as friend on social networks
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
 
matt4321
Old
#10  
matt4321's Avatar
Recognized Contributor - OP
Thanks Meter 1132
Posts: 1,521
Join Date: Dec 2011
Location: Oxford/Leicester, UK

 
DONATE TO ME
Quote:
Originally Posted by ibanez7 View Post
This guide is very simple and very interesting, especially for locked bootloader users, but with just "rename" it would not cause a very high risk? ...
sorry with my question (just want to make sure ), because I know about kernel on Xperia devices that are quite complicated (unlike the Galaxy device)

btw, thank for the very simple guide, this is very useful, especially for my rom
It's the method I have used for countless firmwares on the T, have done it for the V and TX as well. renaming it isn't totally necessary afaik, people are just more comfortable with the thought of a boot.img rather than a kernel.elf

Nexus 7 (2013) | Nexus 5 | Motorola Xoom
Follow Me On Twitter

Tags
boot.img, flashable
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes