Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP matt4321

30th March 2014, 02:07 PM   |  #1  
matt4321's Avatar
OP Recognized Contributor
Flag Oxford/Leicester, UK
Thanks Meter: 1,405
 
1,844 posts
Join Date:Joined: Dec 2011
Donate to Me
More
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.
Last edited by matt4321; 30th March 2014 at 07:25 PM.
The Following 23 Users Say Thank You to matt4321 For This Useful Post: [ View ]
30th March 2014, 02:13 PM   |  #2  
DaRk-L0rD's Avatar
Recognized Contributor / Themer
Isla de Muerte
Thanks Meter: 5,280
 
2,082 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Angry
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.
Last edited by DaRk-L0rD; 30th March 2014 at 08:10 PM.
The Following 17 Users Say Thank You to DaRk-L0rD For This Useful Post: [ View ]
2nd April 2014, 12:35 PM   |  #3  
dipesh1502's Avatar
Recognized Themer
Flag MUMbai
Thanks Meter: 3,758
 
2,389 posts
Join Date:Joined: Sep 2013
Donate to Me
More
On portal
Congrats you 2
2nd April 2014, 01:17 PM   |  #4  
DooMLoRD's Avatar
Recognized Developer
Flag Noida
Thanks Meter: 39,117
 
13,127 posts
Join Date:Joined: Jul 2010
Took much of wrong/incorrect/partial info in this thread...
The Following User Says Thank You to DooMLoRD For This Useful Post: [ View ]
2nd April 2014, 01:21 PM   |  #5  
DaRk-L0rD's Avatar
Recognized Contributor / Themer
Isla de Muerte
Thanks Meter: 5,280
 
2,082 posts
Join Date:Joined: Sep 2012
Donate to Me
More
Quote:
Originally Posted by DooMLoRD

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.
Last edited by DaRk-L0rD; 2nd April 2014 at 01:32 PM.
2nd April 2014, 01:31 PM   |  #6  
matt4321's Avatar
OP Recognized Contributor
Flag Oxford/Leicester, UK
Thanks Meter: 1,405
 
1,844 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by DooMLoRD

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
2nd April 2014, 03:36 PM   |  #7  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor
Flag Bandung - The Girl Next Door
Thanks Meter: 15,017
 
1,471 posts
Join Date:Joined: May 2012
More
Quote:
Originally Posted by DaRk-L0rD

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

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:
package_extract_file("kernel.elf", "/dev/block/platform/msm_sdcc.1/by-name/Kernel");
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
The Following 2 Users Say Thank You to Rizal Lovins For This Useful Post: [ View ]
2nd April 2014, 07:58 PM   |  #8  
silveraero's Avatar
Senior Member
Flag Ho Chi Minh City
Thanks Meter: 185
 
1,049 posts
Join Date:Joined: Jul 2011
For a long time since Xperia X10, I think we can't flash kernel using an update package to flash in CWM?
4th April 2014, 03:11 AM   |  #9  
ibanez7's Avatar
Recognized Themer / Recognized Contributor
Flag Bandung
Thanks Meter: 4,779
 
1,153 posts
Join Date:Joined: Mar 2012
Donate to Me
More
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
4th April 2014, 11:37 AM   |  #10  
matt4321's Avatar
OP Recognized Contributor
Flag Oxford/Leicester, UK
Thanks Meter: 1,405
 
1,844 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by ibanez7

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

Post Reply Subscribe to Thread

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

Advanced Search
Display Modes