[Tutorial] Kernel building instructions for Xperia Z & ZL

Search This thread

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
kernel sources for Xperia Z (SO-02E) {FW: 10.1.D.0.317} & C660x are {FW: 10.1.A.1.350} [these work for Xperia ZL too] available...

link to download sources:
http://dl-developer.sonymobile.com/code/copylefts/10.1.D.0.317.tar.bz2
http://dl-developer.sonymobile.com/code/copylefts/10.1.A.1.350.tar.bz2


i will post build instructions for developers who plan to work on this device....



Building kernel (zImage):

for Xperia Z (C6600x):
import defconfig
Code:
ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make fusion3_yuga_defconfig

for Xperia ZL (C6500x):
import defconfig
Code:
ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make fusion3_odin_defconfig


build zImage
Code:
ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j8


incase u get errors like:
Code:
 error : /scripts/gcc-wrapper.py

just correct the permissions of that file
Code:
chmod 777 ./scripts/gcc-wrapper.py




regards,

DooMLoRD
 
Last edited:

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Instructions for building kernel.elf

Instructions for building boot.img


first get the kernel built... once kernel is built u will get zImage and copy that zImage to the folder containing the mkbootimg files...

i am attaching a tar file which contains the correct mkbootimg binary and a shell script to build this boot.img


Sony has switched to a standard kernel (boot.img) format...

only issue is that the bootloader does not allow hotbooting of kernels
Code:
[I]fastboot boot boot.img[/I]
does not work




build boot.img

u can directly use the attached files

or

use the following command:
Code:
mkbootimg --kernel zImage --ramdisk ramdisk.img --pagesize 2048 --base 0x80200000 \
     --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.emmc=true" \
     --offset 0x02000000 --output boot.img
 

Attachments

  • kernel_builder_xperia_z.tar
    40 KB · Views: 552
Last edited:

krabappel2548

Inactive Recognized Developer
Nov 15, 2011
6,444
16,111
Lommel
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}

I have made 10.1.A.1.350 ftf :)

Only need to upload one more part, but I'm not home now. I'll upload it on sunday :)

Sent from my LT26i using xda app-developers app
 

Hawkysoft

Senior Member
Jul 21, 2010
762
182
40
Rotterdam
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}

hey doom, good to see you around again been a while since the x10 ;)

Sent from my Transformer Prime TF201 using xda premium
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
hey doom, good to see you around again been a while since the x10 ;)

Sent from my Transformer Prime TF201 using xda premium

hey Hawkysoft! LONG time no see ;)






@ALL


seems we have a new type of kernel.elf for the Xperia Z/ZL...

it only contains zImage and ramdisk.cpio.gz

i am guessing that the following build command should work:
Code:
python mkelf.py -o kernel.elf zImage@0x80208000 ramdisk.cpio.gz@0x82200000,ramdisk




this information might be valid only for the Xperia ZL as the file i received were for that device...
Code:
10.1.A.1.350-C65
ro.semc.version.sw=1266-7597
ro.semc.version.sw_revision=10.1.A.1.350

since i do not have the Xperia Z/ZL i need some testers... please send me kernel.sin which works for your device so that we can do testing...
 
Last edited:

xperiax10.awesome

Senior Member
Nov 20, 2010
3,333
1,452
Singapore
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}

Good to see you DoomLord, following you since X10..ditched you after Xperia S :p

Now waiting for my Xperia Z, will be getting on 28th Feb..

sent from Giant Killer Galaxy Note 2
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Good to see you DoomLord, following you since X10..ditched you after Xperia S :p

Now waiting for my Xperia Z, will be getting on 28th Feb..

sent from Giant Killer Galaxy Note 2

glad to see u here :)

u still have the same nick>> X10 awesome :D


i really like the xperia Z but i dont have the money to buy it... its too costly for me...


@ALL


did a lot of testing today thanks to one user over teamviewer... bootloader unlock is easy, we got full FTF flashed (updated FlashTool)... just the damn kernel is the issue... seems Z is using a standard boot.img format... but i havent been able to get the correct parameters, commands to get the damn boot.img to boot...
 
Last edited:

Adi_Pat

Senior Member
Dec 19, 2011
1,210
3,566
Mumbai
glad to see u here :)

u still have the same nick>> X10 awesome :D


i really like the xperia Z but i dont have the money to buy it... its too costly for me...


@ALL


did a lot of testing today thanks to one user over teamviewer... bootloader unlock is easy, we got full FTF flashed (updated FlashTool)... just the damn kernel is the issue... seems Z is using a standard boot.img format... but i havent been able to get the correct parameters, commands to get the damn boot.img to boot...
Hi Doomlord, nice to see you here.

Planning to hack some Kernels for the device. I would probably buy it after March.
Can you send me the boot.img? I've downloaded the sources.
Also, if we could get a dump of /proc/partitions , we could probably figure out the size of the boot partition. (Misread your comment)

Cheers.
 
Last edited:
  • Like
Reactions: sakindia123

varshil

Senior Member
Sep 4, 2010
730
399
32
mumbai
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}

Offtopic
Hey doom-. I just bought nexus 4 fr 23k.. Believe me its a great phone. If not xz dn plz buy nexus 4...

Sent from my Nexus 4 using xda app-developers app
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}

Hi Doomlord, nice to see you here.

Planning to hack some Kernels for the device. I would probably buy it after March.
Can you send me the boot.img? I've downloaded the sources.
Also, if we could get a dump of /proc/partitions , we could probably figure out the size of the boot partition. (Misread your comment)

Cheers.

I am posting some info which should be useful...

FOR XPERIA Z (C660x)

Code:
rootfs on / type rootfs (ro,relatime)
tmpfs on /dev type tmpfs (rw,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
none on /acct type cgroup (rw,relatime,cpuacct)
tmpfs on /mnt/asec type tmpfs (rw,relatime,mode=755,gid=1000)
tmpfs on /mnt/obb type tmpfs (rw,relatime,mode=755,gid=1000)
none on /dev/cpuctl type cgroup (rw,relatime,cpu)
/dev/block/platform/msm_sdcc.1/by-name/system on /system type ext4 (ro,relatime,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/userdata on /data type ext4 (rw,nosuid,nodev,relatime,discard,noauto_da_alloc,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/cache on /cache type ext4 (rw,nosuid,nodev,relatime,discard,data=ordered)
/dev/block/platform/msm_sdcc.1/by-name/LTALabel on /lta-label type ext4 (ro,nosuid,nodev,noexec,noatime,nobarrier,data=ordered)
tmpfs on /mnt/qcks type tmpfs (rw,relatime,mode=770,uid=1000,gid=1000)
/dev/block/platform/msm_sdcc.1/by-name/apps_log on /data/idd type ext4 (rw,nosuid,nodev,noexec,noatime,discard,nobarrier,data=ordered)
/dev/fuse on /storage/sdcard0 type fuse (rw,nosuid,nodev,noexec,relatime,user_id=1023,group_id=1023,default_permissions,allow_other)
/dev/block/vold/179:33 on /storage/sdcard1 type vfat (rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro)
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   941876        68    941808   0% /dev
tmpfs                   941876         0    941876   0% /mnt/asec
tmpfs                   941876         0    941876   0% /mnt/obb
/dev/block/platform/msm_sdcc.1/by-name/system
                       2067560   1026752   1040808  50% /system
/dev/block/platform/msm_sdcc.1/by-name/userdata
                      12301652   2967792   9333860  24% /data
/dev/block/platform/msm_sdcc.1/by-name/cache
                        554908      9856    545052   2% /cache
/dev/block/platform/msm_sdcc.1/by-name/LTALabel
                         16164      4740     11424  29% /lta-label
tmpfs                   941876      5432    936444   1% /mnt/qcks
/dev/block/platform/msm_sdcc.1/by-name/apps_log
                          8100      4292      3808  53% /data/idd
/dev/fuse             12301652   2967792   9333860  24% /storage/sdcard0
/dev/block/vold/179:33
                      15537664    526752  15010912   3% /storage/sdcard1
lrwxrwxrwx root     root              1970-01-11 04:46 FOTAKernel -> /dev/block/mmcblk0p23
lrwxrwxrwx root     root              1970-01-11 04:46 LTALabel -> /dev/block/mmcblk0p16
lrwxrwxrwx root     root              1970-01-11 04:46 TA -> /dev/block/mmcblk0p1
lrwxrwxrwx root     root              1970-01-11 04:46 aboot -> /dev/block/mmcblk0p6
lrwxrwxrwx root     root              1970-01-11 04:46 alt_aboot -> /dev/block/mmcblk0p12
lrwxrwxrwx root     root              1970-01-11 04:46 alt_rpm -> /dev/block/mmcblk0p15
lrwxrwxrwx root     root              1970-01-11 04:46 alt_s1sbl2 -> /dev/block/mmcblk0p10
lrwxrwxrwx root     root              1970-01-11 04:46 alt_sbl1 -> /dev/block/mmcblk0p8
lrwxrwxrwx root     root              1970-01-11 04:46 alt_sbl2 -> /dev/block/mmcblk0p9
lrwxrwxrwx root     root              1970-01-11 04:46 alt_sbl3 -> /dev/block/mmcblk0p11
lrwxrwxrwx root     root              1970-01-11 04:46 alt_tz -> /dev/block/mmcblk0p13
lrwxrwxrwx root     root              1970-01-11 04:46 apps_log -> /dev/block/mmcblk0p22
lrwxrwxrwx root     root              1970-01-11 04:46 boot -> /dev/block/mmcblk0p17
lrwxrwxrwx root     root              1970-01-11 04:46 cache -> /dev/block/mmcblk0p25
lrwxrwxrwx root     root              1970-01-11 04:46 m9kefs1 -> /dev/block/mmcblk0p18
lrwxrwxrwx root     root              1970-01-11 04:46 m9kefs2 -> /dev/block/mmcblk0p19
lrwxrwxrwx root     root              1970-01-11 04:46 m9kefs3 -> /dev/block/mmcblk0p20
lrwxrwxrwx root     root              1970-01-11 04:46 ramdump -> /dev/block/mmcblk0p21
lrwxrwxrwx root     root              1970-01-11 04:46 rpm -> /dev/block/mmcblk0p14
lrwxrwxrwx root     root              1970-01-11 04:46 s1sbl2 -> /dev/block/mmcblk0p4
lrwxrwxrwx root     root              1970-01-11 04:46 sbl1 -> /dev/block/mmcblk0p2
lrwxrwxrwx root     root              1970-01-11 04:46 sbl2 -> /dev/block/mmcblk0p3
lrwxrwxrwx root     root              1970-01-11 04:46 sbl3 -> /dev/block/mmcblk0p5
lrwxrwxrwx root     root              1970-01-11 04:46 system -> /dev/block/mmcblk0p24
lrwxrwxrwx root     root              1970-01-11 04:46 tz -> /dev/block/mmcblk0p7
lrwxrwxrwx root     root              1970-01-11 04:46 userdata -> /dev/block/mmcblk0p26





Offtopic
Hey doom-. I just bought nexus 4 fr 23k.. Believe me its a great phone. If not xz dn plz buy nexus 4...

Sent from my Nexus 4 using xda app-developers app

I have played with the Nexus 4... It's good but it's LG...

Sent from my LT30p using xda app-developers app
 
Last edited:
  • Like
Reactions: m00nl33n and avetny

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Re: [Kernel-Sources] Xperia Z (FW: 10.1.D.0.317, 10.1.A.0.350)

10.1.A.0.350 sources out!!!



Sent from my LT30p using xda app-developers app
 

yaabaa1986

Senior Member
Oct 16, 2011
120
13
Re: [Kernel-Sources] Xperia Z & ZL (FW: 10.1.A.0.350)

Dear doomlord,

I m following you (and krabbel from my x10 (to arcs xs xt and now xz in 3 days)
Love your work...
I'm not a developer, just someone who love stock Sony, and even more if it's not totally stock.
I see the development didn't started yet, is it hard for a development noop to start? Just to create a deodext Rom with root (just like krabbels on the xt). Can you please point me in the right way? If I can understand it I will try to start something, (if I don't get it I will wait patiently)
Love your work mate!!

Sent from my LT30p using xda premium
 

Droidyou

Senior Member
Dec 9, 2010
168
73
Re: [Kernel-Sources] Xperia Z & ZL (FW: 10.1.A.0.350)

Dear doomlord,

I m following you (and krabbel from my x10 (to arcs xs xt and now xz in 3 days)
Love your work...
I'm not a developer, just someone who love stock Sony, and even more if it's not totally stock.
I see the development didn't started yet, is it hard for a development noop to start? Just to create a deodext Rom with root (just like krabbels on the xt). Can you please point me in the right way? If I can understand it I will try to start something, (if I don't get it I will wait patiently)
Love your work mate!!

Sent from my LT30p using xda premium

Check xda university.


Sent from my C6603 using xda app-developers app
 

DooMLoRD

Inactive Recognized Developer
Jul 27, 2010
13,187
39,710
Pune
Dear doomlord,

I m following you (and krabbel from my x10 (to arcs xs xt and now xz in 3 days)
Love your work...
I'm not a developer, just someone who love stock Sony, and even more if it's not totally stock.
I see the development didn't started yet, is it hard for a development noop to start? Just to create a deodext Rom with root (just like krabbels on the xt). Can you please point me in the right way? If I can understand it I will try to start something, (if I don't get it I will wait patiently)
Love your work mate!!

Sent from my LT30p using xda premium

well to begin with the device isnt yet globally available... most devs who plan to buy the device havent got it yet...

if u want to create de-odexed ROM you will have to wait for proper recovery to be posted (FYI from what i know recovery is already working just not released yet)...

if u interested please search... lots of threads for that...





Hi, Doom! I am glad to read your posts again since x10)).
can again repeat that?

thanks! good to see ppl from the X10 days...

about that... well depends on community...
 

krabappel2548

Inactive Recognized Developer
Nov 15, 2011
6,444
16,111
Lommel
Re: [Kernel-Sources] Xperia Z & ZL (FW: 10.1.A.0.350)

Dear doomlord,

I m following you (and krabbel from my x10 (to arcs xs xt and now xz in 3 days)
Love your work...
I'm not a developer, just someone who love stock Sony, and even more if it's not totally stock.
I see the development didn't started yet, is it hard for a development noop to start? Just to create a deodext Rom with root (just like krabbels on the xt). Can you please point me in the right way? If I can understand it I will try to start something, (if I don't get it I will wait patiently)
Love your work mate!!

Sent from my LT30p using xda premium

I'll have mine on wednesday probably :)

Sent from my Xperia S using xda app-developers app
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    kernel sources for Xperia Z (SO-02E) {FW: 10.1.D.0.317} & C660x are {FW: 10.1.A.1.350} [these work for Xperia ZL too] available...

    link to download sources:
    http://dl-developer.sonymobile.com/code/copylefts/10.1.D.0.317.tar.bz2
    http://dl-developer.sonymobile.com/code/copylefts/10.1.A.1.350.tar.bz2


    i will post build instructions for developers who plan to work on this device....



    Building kernel (zImage):

    for Xperia Z (C6600x):
    import defconfig
    Code:
    ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make fusion3_yuga_defconfig

    for Xperia ZL (C6500x):
    import defconfig
    Code:
    ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make fusion3_odin_defconfig


    build zImage
    Code:
    ARCH=arm CROSS_COMPILE=~/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j8


    incase u get errors like:
    Code:
     error : /scripts/gcc-wrapper.py

    just correct the permissions of that file
    Code:
    chmod 777 ./scripts/gcc-wrapper.py




    regards,

    DooMLoRD
    21
    Instructions for building kernel.elf

    Instructions for building boot.img


    first get the kernel built... once kernel is built u will get zImage and copy that zImage to the folder containing the mkbootimg files...

    i am attaching a tar file which contains the correct mkbootimg binary and a shell script to build this boot.img


    Sony has switched to a standard kernel (boot.img) format...

    only issue is that the bootloader does not allow hotbooting of kernels
    Code:
    [I]fastboot boot boot.img[/I]
    does not work




    build boot.img

    u can directly use the attached files

    or

    use the following command:
    Code:
    mkbootimg --kernel zImage --ramdisk ramdisk.img --pagesize 2048 --base 0x80200000 \
         --cmdline "androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x3F ehci-hcd.park=3 vmalloc=400M androidboot.emmc=true" \
         --offset 0x02000000 --output boot.img
    5
    Good to see you DoomLord, following you since X10..ditched you after Xperia S :p

    Now waiting for my Xperia Z, will be getting on 28th Feb..

    sent from Giant Killer Galaxy Note 2

    glad to see u here :)

    u still have the same nick>> X10 awesome :D


    i really like the xperia Z but i dont have the money to buy it... its too costly for me...


    @ALL


    did a lot of testing today thanks to one user over teamviewer... bootloader unlock is easy, we got full FTF flashed (updated FlashTool)... just the damn kernel is the issue... seems Z is using a standard boot.img format... but i havent been able to get the correct parameters, commands to get the damn boot.img to boot...
    4
    hey doom, good to see you around again been a while since the x10 ;)

    Sent from my Transformer Prime TF201 using xda premium

    hey Hawkysoft! LONG time no see ;)






    @ALL


    seems we have a new type of kernel.elf for the Xperia Z/ZL...

    it only contains zImage and ramdisk.cpio.gz

    i am guessing that the following build command should work:
    Code:
    python mkelf.py -o kernel.elf zImage@0x80208000 ramdisk.cpio.gz@0x82200000,ramdisk




    this information might be valid only for the Xperia ZL as the file i received were for that device...
    Code:
    10.1.A.1.350-C65
    ro.semc.version.sw=1266-7597
    ro.semc.version.sw_revision=10.1.A.1.350

    since i do not have the Xperia Z/ZL i need some testers... please send me kernel.sin which works for your device so that we can do testing...
    3
    Hi doomlord, heard alot about you and your work for the xperia..I am New to xperia so I want to ask can the xperia z get kernels like which are available for the nexus as they have many options built in such as performance, display callibration, sounds, etc I know we have some kernels for increasing performance but I am trying to find kernel for the display callibration..can u make one for the xperia z with the callibration option?

    Sent from my C6602 using Tapatalk 4 Beta

    display calibration was introduced officially in firmware .253... though i am working on Gamma Control for our device...