Search This thread

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
LK for Xperia T

LT30p Only - Unlocked Bootloader Required

WARNING 1: This modification makes changes
to the devices partition table. I (lilstevie) am not
responsible for any damage to your device or
data loss that may occur.

WARNING 2: ICS kernels currently do not boot
with this modification at this point in time. This
can only be used with JB kernels including those
from the alpha and leaked releases. At the time
of writing the TWRP 2.4.1.1 FOTA image has
everything required to boot without any changes.


Since getting the Xperia T the biggest annoyance is only having one bootable partition.
To combat this issue I have spent some time porting the Little Kernel bootloader. This
allows booting different kernels for recovery and boot as well as a full implementation
fastboot.

Features:
  • Separate boot and recovery partition.
  • Full fastboot implementation including fastboot boot (with correctly formatted boot.img)
  • Ability to load both Android boot image and sony elf formats.
  • Boot to recovery, and boot to recovery from userspace (requires patched kernel).

Known Issues:
  • No display until kernel has booted – This is also the case with S1Boot.
  • Cannot reboot into another boot mode without kernel patch.
  • No LEDs to indicate status.
  • ICS 3.0 kernels will not boot.

Usage:

After 1 second from pressing the power button LK will listen for input on the volume keys for 2-5 seconds:
  • Volume Up -> boot recovery.
  • Volume Down -> boot fastboot.

Credits:
  • Rebellos -- Inital work on getting eMMC and buttons working.
  • Dees_Troy -- extract_elf_ramdisk served as a base for elf parsing.
  • cdesai -- Bug fixes and hosting bootloader on his github.
  • Various others for support, if you think your name should be here
    and that I have forgotten all about you let me know.

How to install LK:
  1. Download LittleKernel-1.0-FINAL.zip
  2. Copy LittleKernel-1.0-FINAL.zip to device
  3. Boot into recovery
  4. Install LittleKernel-1.0-FINAL.zip

How to install LK ready kernel:
  1. Download JB_Kernel_LK.zip
  2. Copy JB_Kernel_LK.zip to device
  3. Boot into recovery
  4. Install JB_Kernel_LK.zip
 

Attachments

  • LittleKernel-1.0-FINAL.zip
    350 KB · Views: 458
  • JB_Kernel_LK.zip
    9.4 MB · Views: 453
Last edited:

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
Versions:

Version 1.0:
  • Initial Release.

MD5Sums:
  • LittleKernel-1.0-FINAL.zip - fd550025493533db904ecb5bc299ac9b
  • JB_Kernel_LK.zip - cc185b728e28865fe6323f4cc96e17a0


Building a boot image for lk should be done with the
following boot image settings:
  • Base Address: 0x80200000
  • Ramdisk Address: 0x81400000
  • Page Size: 2048
  • Cmdline: “user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 kgsl.mmutype=gpummu”


Copyleft:
 
Last edited:

tilal6991

Inactive Recognized Developer
Dec 25, 2010
1,607
2,581
Sweet. I saw the patch on gerrir and was wondering how it worked. Will have a try.

The only thing I'm wondering is whether there is a way to reverse the changes to the partition table.

Sent from my Xperia T using Tapatalk 2
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Very interesting... Awesome work guys...

And good to see cdesai around ;)



I am still unclear on few things though..


Ok so from what I understand you are still depending on s1boot as primary bootloader. Then once the primary bootloader passes boot sequence to main kernel (mmcblk0p4) you have little kernel which will intercept it and then function as a bootloader? Which can then accept these commands or in turn boot a secondary kernel (fotakernel) or mmcblk0p16 which will now act as boot partition for the OS?

My concern is how are you making space for that mmcblk0p16? Are you repartitioning internal sdcard?

Sent from my LT30p using xda app-developers app


Sweet. I saw the patch on gerrir and was wondering how it worked. Will have a try.

The only thing I'm wondering is whether there is a way to reverse the to the partition table.

Sent from my Xperia T using Tapatalk 2

I think flashing a standard full stock firmware should restore partition table


Sent from my LT30p using xda app-developers app
 
Last edited:
  • Like
Reactions: lilstevie

cdesai

Inactive Recognized Developer
Jan 16, 2011
2,296
4,089
IN YOUR HEAD
There is 300mb free space at the end of the emmc, and this makes a new 30mb partition after the sdcard.

Like you said DooMLoRD, s1boot is still used, and it loads lk which in turn loads p16 as kernel, and p11(FOTA) as recovery.

There's still enough space left to add more kernels, and some sort of a boot menu to multi boot :)
 

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
Ok so from what I understand you are still depending on s1boot as primary bootloader. Then once the primary bootloader passes boot sequence to main kernel (mmcblk0p4) you have little kernel which will intercept it and then function as a bootloader? Which can then accept these commands or in turn boot a secondary kernel (fotakernel) or mmcblk0p16 which will now act as boot partition for the OS?

We can't actually replace S1Boot due to code signatures, and S1Boot is actually multiple bootloader stages in 1. Other devices would have pbl sbl and appsboot.mbn, Sony have combined them all into 1, LK is only a replacement for appsboot, thankfully between each stage everything that was turned on gets turned on for the purpose of appsboot (such as mmu) get turned off again before the next stage which allows us to do this without major hacks. Essentially what we are doing is adding an extra boot stage.

mmcblk0p16 which has been added to the end indeed does act as the new boot partition. I did originally plan to add another extra partition for boot, but after talking to Dees_Troy we worked out a situation where we could utilise FOTAKernel for recovery and not impact installation of TWRP from goomanager.

My concern is how are you making space for that mmcblk0p16? Are you repartitioning internal sdcard?

I do understand this concern, however I did notice that all Xperia T's that I have encountered so far (I checked with ~10 peoples devices) and they all have 300±25MB of unused, and unpartitioned space at the end of their eMMCs, I do not delete or resize any partitions. This is the script I run when installing lk if you are interested in seeing how it is done.

I think flashing a standard full stock firmware should restore partition table

Utimately this is what eased my feelings towards modifying the partition table, I understand people get a little bit funny about things that cannot be easily reverted, and in this case flashing a stock ftf or using EMMA to reflash back to stock will undo the changes to the partition table.
 
  • Like
Reactions: Sine. and peetr_

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
Please contact me if you have any of the following devices with a bootloader unlock: Xperia TX, TL (Are any of these unlocked?) and V. I would like to add support for these devices but as I do not have any of them I will need some testers.

EDIT: Xperia V is off the table for the moment as there isn't enough free space to remap the kernel partition.
 
Last edited:
  • Like
Reactions: funiewski

travis82

Senior Member
Jan 8, 2011
1,537
1,694
41
Marysville, Washington
parted /dev/block/mmcblk0 unit MB print free
Model: MMC MAG2GA (sd/mmc)
Disk /dev/block/mmcblk0: 15634MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
0.02MB 0.13MB 0.11MB Free Space
1 0.13MB 2.23MB 2.10MB TA
2 2.23MB 3.80MB 1.57MB Boot
3 3.80MB 5.37MB 1.57MB Boot2
5.37MB 6.29MB 0.92MB Free Space
4 6.29MB 27.3MB 21.0MB Kernel
5 27.3MB 28.3MB 1.05MB TZ
28.3MB 29.4MB 1.05MB Free Space
6 29.4MB 32.5MB 3.15MB modemst1
32.5MB 33.6MB 1.05MB Free Space
7 33.6MB 36.7MB 3.15MB modemst2
36.7MB 37.7MB 1.05MB Free Space
8 37.7MB 40.9MB 3.15MB fsg
9 40.9MB 46.1MB 5.24MB ramdump
10 46.1MB 54.5MB 8.39MB ext4 apps_log
11 54.5MB 71.3MB 16.8MB FOTAKernel
12 71.3MB 1359MB 1288MB ext4 System
13 1359MB 1621MB 262MB ext4 Cache
14 1621MB 3769MB 2147MB ext4 Userdata
15 3769MB 15634MB 11866MB ext4 SDCard

Makes me wanna do what I did with the Note and redo the partition format and add a bit more space to the sdcard partition. So lets say we use CM rom. Couldn't we just remove the fota partition a boot partition, ram dump, apps log, etc.. and add the extra to the sd or data partition.

So the main question is I guess what partitions does the phone need to run aosp so we can use the extra space somewhere more useful?
 
Last edited:

cdesai

Inactive Recognized Developer
Jan 16, 2011
2,296
4,089
IN YOUR HEAD
parted /dev/block/mmcblk0 unit MB print free
Model: MMC MAG2GA (sd/mmc)
Disk /dev/block/mmcblk0: 15634MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
0.02MB 0.13MB 0.11MB Free Space
1 0.13MB 2.23MB 2.10MB TA
2 2.23MB 3.80MB 1.57MB Boot
3 3.80MB 5.37MB 1.57MB Boot2
5.37MB 6.29MB 0.92MB Free Space
4 6.29MB 27.3MB 21.0MB Kernel
5 27.3MB 28.3MB 1.05MB TZ
28.3MB 29.4MB 1.05MB Free Space
6 29.4MB 32.5MB 3.15MB modemst1
32.5MB 33.6MB 1.05MB Free Space
7 33.6MB 36.7MB 3.15MB modemst2
36.7MB 37.7MB 1.05MB Free Space
8 37.7MB 40.9MB 3.15MB fsg
9 40.9MB 46.1MB 5.24MB ramdump
10 46.1MB 54.5MB 8.39MB ext4 apps_log
11 54.5MB 71.3MB 16.8MB FOTAKernel
12 71.3MB 1359MB 1288MB ext4 System
13 1359MB 1621MB 262MB ext4 Cache
14 1621MB 3769MB 2147MB ext4 Userdata
15 3769MB 15634MB 11866MB ext4 SDCard

Makes me wanna do what I did with the Note and redo the partition format and add a bit more space to the sdcard partition. So lets say we use CM rom. Couldn't we just remove the fota partition a boot partition, ram dump, apps log, etc.. and add the extra to the sd or data partition.

So the main question is I guess what partitions does the phone need to run aosp so we can use the extra space somewhere more useful?
Modifying the existing partition table isn't a good idea, and even if you plan on doing that, it would be safer if you don't touch anything below system.

FOTAKernel partition is currently used to store recovery (though the kernel partition has a recovery as well).
Boot[2] contains the bootloader(s), so you can't remove them - you'll end up with a brick.

ramdump isn't used on production devices from what i know, so it could be used to store something else (since TX and V do not have any free space at the end of the partition table, while T does)

So what could be done is flash lk to Kernel, kernel to FOTAKernel, and a trimmed down recovery to ramdump, which is doable without modifying the existing partition table.
 

cmajetic

Senior Member
Sep 6, 2011
1,513
623
Vienna
AW: [Bootloader] LK for Xperia T

Thank you very much. 2 questions:

1: does your patched kernel include TWRP 2.4.1.1 or 2.4.1.0 and we have to do it through goomanager?

2: when I backup stock jb, wipe and flash cm i don't lose TWRP? because cm10 has cwm in the boot.img and with this method it won't override my current recovery?

thanks

Gesendet von meinem LT30p mit Tapatalk 2
 

travis82

Senior Member
Jan 8, 2011
1,537
1,694
41
Marysville, Washington
Modifying the existing partition table isn't a good idea, and even if you plan on doing that, it would be safer if you don't touch anything below system.

FOTAKernel partition is currently used to store recovery (though the kernel partition has a recovery as well).
Boot[2] contains the bootloader(s), so you can't remove them - you'll end up with a brick.

ramdump isn't used on production devices from what i know, so it could be used to store something else (since TX and V do not have any free space at the end of the partition table, while T does)

So what could be done is flash lk to Kernel, kernel to FOTAKernel, and a trimmed down recovery to ramdump, which is doable without modifying the existing partition table.

Sounds great. I like having separate kernel and recovery partitions. I hate that kernel and recovery is in one image.
 
Last edited:

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
Thank you very much. 2 questions:

1: does your patched kernel include TWRP 2.4.1.1 or 2.4.1.0 and we have to do it through goomanager?

2: when I backup stock jb, wipe and flash cm i don't lose TWRP? because cm10 has cwm in the boot.img and with this method it won't override my current recovery?

thanks

Gesendet von meinem LT30p mit Tapatalk 2

At present my boot.img that I supplied has TWRP 2.4.1.0 in it due to packaging in the wrong ramdisk, my kernel should have no recovery in it at all as this allows recovery to live on its own partition, TWRP 2.4.1.1 that installs on to FOTA when you run goomanager is set up for this method of booting.

As for CM, I've been working with cdesai to get this merged into cm10.1, if successful CM will no longer be built like that but rather be a rom that uses lk as the bootloader with seperate kernel and recovery
 
  • Like
Reactions: waynekirby

cmajetic

Senior Member
Sep 6, 2011
1,513
623
Vienna
AW: [Bootloader] LK for Xperia T

At present my boot.img that I supplied has TWRP 2.4.1.0 in it due to packaging in the wrong ramdisk, my kernel should have no recovery in it at all as this allows recovery to live on its own partition, TWRP 2.4.1.1 that installs on to FOTA when you run goomanager is set up for this method of booting.

As for CM, I've been working with cdesai to get this merged into cm10.1, if successful CM will no longer be built like that but rather be a rom that uses lk as the bootloader with seperate kernel and recovery

okay but I have a problem. goomanager does download successful and says installation successful but when I enter recovery it is still 2.4.1.0, tried several times now...

Gesendet von meinem LT30p mit Tapatalk 2
 

lilstevie

Senior Recognized Developer
Apr 17, 2009
1,339
1,040
okay but I have a problem. goomanager does download successful and says installation successful but when I enter recovery it is still 2.4.1.0, tried several times now...

Gesendet von meinem LT30p mit Tapatalk 2

I had this problem the other day, you need to be root for it to work, what I did was downloaded 2.4.1.1 linked here under the heading "Download - FOTAKernel Image" then flash it with lk fastboot using the command "fastboot flash recovery openrecovery-twrp-2.4.1.1-mint.img"
 

cmajetic

Senior Member
Sep 6, 2011
1,513
623
Vienna
AW: [Bootloader] LK for Xperia T

I had this problem the other day, you need to be root for it to work, what I did was downloaded 2.4.1.1 linked here under the heading "Download - FOTAKernel Image" then flash it with lk fastboot using the command "fastboot flash recovery openrecovery-twrp-2.4.1.1-mint.img"

i am rooted but okay I will try it the way you mentioned, thanks

Gesendet von meinem LT30p mit Tapatalk 2
 

Top Liked Posts

  • There are no posts matching your filters.
  • 19
    LK for Xperia T

    LT30p Only - Unlocked Bootloader Required

    WARNING 1: This modification makes changes
    to the devices partition table. I (lilstevie) am not
    responsible for any damage to your device or
    data loss that may occur.

    WARNING 2: ICS kernels currently do not boot
    with this modification at this point in time. This
    can only be used with JB kernels including those
    from the alpha and leaked releases. At the time
    of writing the TWRP 2.4.1.1 FOTA image has
    everything required to boot without any changes.


    Since getting the Xperia T the biggest annoyance is only having one bootable partition.
    To combat this issue I have spent some time porting the Little Kernel bootloader. This
    allows booting different kernels for recovery and boot as well as a full implementation
    fastboot.

    Features:
    • Separate boot and recovery partition.
    • Full fastboot implementation including fastboot boot (with correctly formatted boot.img)
    • Ability to load both Android boot image and sony elf formats.
    • Boot to recovery, and boot to recovery from userspace (requires patched kernel).

    Known Issues:
    • No display until kernel has booted – This is also the case with S1Boot.
    • Cannot reboot into another boot mode without kernel patch.
    • No LEDs to indicate status.
    • ICS 3.0 kernels will not boot.

    Usage:

    After 1 second from pressing the power button LK will listen for input on the volume keys for 2-5 seconds:
    • Volume Up -> boot recovery.
    • Volume Down -> boot fastboot.

    Credits:
    • Rebellos -- Inital work on getting eMMC and buttons working.
    • Dees_Troy -- extract_elf_ramdisk served as a base for elf parsing.
    • cdesai -- Bug fixes and hosting bootloader on his github.
    • Various others for support, if you think your name should be here
      and that I have forgotten all about you let me know.

    How to install LK:
    1. Download LittleKernel-1.0-FINAL.zip
    2. Copy LittleKernel-1.0-FINAL.zip to device
    3. Boot into recovery
    4. Install LittleKernel-1.0-FINAL.zip

    How to install LK ready kernel:
    1. Download JB_Kernel_LK.zip
    2. Copy JB_Kernel_LK.zip to device
    3. Boot into recovery
    4. Install JB_Kernel_LK.zip
    9
    New version uploaded
    It supports dual booting, second kernel is loaded if camera focus key is pressed on first 5 seconds of boot, and second recovery on pressing the snapshot key (i.e. pressing it fully)
    second kernel is loaded from Android2 partition, and second recovery from recovery2 partition.
    We'll update the scripts to make them automatically shortly.

    LK:
    http://goo.im/devs/cdesai/mint/lk/lk-20130223.elf
    flash it with "fastboot flash bootloader <file>"

    Also, here's a completely unmodified stock kernel, for anyone who wants it - built from source, but packed into a boot.img rather than sony elf.
    http://goo.im/devs/cdesai/mint/sony/boot-20120224.img
    5
    Versions:

    Version 1.0:
    • Initial Release.

    MD5Sums:
    • LittleKernel-1.0-FINAL.zip - fd550025493533db904ecb5bc299ac9b
    • JB_Kernel_LK.zip - cc185b728e28865fe6323f4cc96e17a0


    Building a boot image for lk should be done with the
    following boot image settings:
    • Base Address: 0x80200000
    • Ramdisk Address: 0x81400000
    • Page Size: 2048
    • Cmdline: “user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 maxcpus=2 kgsl.mmutype=gpummu”


    Copyleft:
    2
    Ok so from what I understand you are still depending on s1boot as primary bootloader. Then once the primary bootloader passes boot sequence to main kernel (mmcblk0p4) you have little kernel which will intercept it and then function as a bootloader? Which can then accept these commands or in turn boot a secondary kernel (fotakernel) or mmcblk0p16 which will now act as boot partition for the OS?

    We can't actually replace S1Boot due to code signatures, and S1Boot is actually multiple bootloader stages in 1. Other devices would have pbl sbl and appsboot.mbn, Sony have combined them all into 1, LK is only a replacement for appsboot, thankfully between each stage everything that was turned on gets turned on for the purpose of appsboot (such as mmu) get turned off again before the next stage which allows us to do this without major hacks. Essentially what we are doing is adding an extra boot stage.

    mmcblk0p16 which has been added to the end indeed does act as the new boot partition. I did originally plan to add another extra partition for boot, but after talking to Dees_Troy we worked out a situation where we could utilise FOTAKernel for recovery and not impact installation of TWRP from goomanager.

    My concern is how are you making space for that mmcblk0p16? Are you repartitioning internal sdcard?

    I do understand this concern, however I did notice that all Xperia T's that I have encountered so far (I checked with ~10 peoples devices) and they all have 300±25MB of unused, and unpartitioned space at the end of their eMMCs, I do not delete or resize any partitions. This is the script I run when installing lk if you are interested in seeing how it is done.

    I think flashing a standard full stock firmware should restore partition table

    Utimately this is what eased my feelings towards modifying the partition table, I understand people get a little bit funny about things that cannot be easily reverted, and in this case flashing a stock ftf or using EMMA to reflash back to stock will undo the changes to the partition table.