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

[Tutorial] Kernel building instructions for Xperia Z & ZL

OP DooMLoRD

8th February 2013, 10:39 PM   |  #1  
DooMLoRD's Avatar
OP Recognized Developer
Flag Noida
Thanks Meter: 39,110
 
13,127 posts
Join Date:Joined: Jul 2010
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/c....0.317.tar.bz2
http://dl-developer.sonymobile.com/c....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 by DooMLoRD; 26th February 2013 at 07:28 PM.
The Following 32 Users Say Thank You to DooMLoRD For This Useful Post: [ View ]
8th February 2013, 10:41 PM   |  #2  
DooMLoRD's Avatar
OP Recognized Developer
Flag Noida
Thanks Meter: 39,110
 
13,127 posts
Join Date:Joined: Jul 2010
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:
fastboot boot boot.img
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
Attached Files
File Type: tar kernel_builder_xperia_z.tar - [Click for QR Code] (40.0 KB, 323 views)
Last edited by DooMLoRD; 20th February 2013 at 11:16 AM.
The Following 21 Users Say Thank You to DooMLoRD For This Useful Post: [ View ]
8th February 2013, 11:28 PM   |  #3  
krabappel2548's Avatar
Recognized Contributor / Recognized Developer
Flag Zichem
Thanks Meter: 15,565
 
6,362 posts
Join Date:Joined: Nov 2011
Donate to Me
More
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
9th February 2013, 01:03 AM   |  #4  
Hawkysoft's Avatar
Senior Member
Flag Rotterdam
Thanks Meter: 168
 
738 posts
Join Date:Joined: Jul 2010
Donate to Me
More
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
11th February 2013, 01:10 PM   |  #5  
DooMLoRD's Avatar
OP Recognized Developer
Flag Noida
Thanks Meter: 39,110
 
13,127 posts
Join Date:Joined: Jul 2010
Quote:
Originally Posted by Hawkysoft

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 by DooMLoRD; 15th February 2013 at 03:39 PM.
The Following 4 Users Say Thank You to DooMLoRD For This Useful Post: [ View ]
15th February 2013, 03:18 PM   |  #6  
xperiax10.awesome's Avatar
Recognized Contributor
Flag Singapore
Thanks Meter: 1,436
 
3,317 posts
Join Date:Joined: Nov 2010
Donate to Me
More
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

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

sent from Giant Killer Galaxy Note 2
15th February 2013, 03:38 PM   |  #7  
DooMLoRD's Avatar
OP Recognized Developer
Flag Noida
Thanks Meter: 39,110
 
13,127 posts
Join Date:Joined: Jul 2010
Quote:
Originally Posted by xperiax10.awesome

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

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


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 by DooMLoRD; 15th February 2013 at 03:41 PM.
The Following 5 Users Say Thank You to DooMLoRD For This Useful Post: [ View ]
16th February 2013, 12:45 PM   |  #8  
Adi_Pat's Avatar
Recognized Contributor / Recognized Developer
Flag Mumbai
Thanks Meter: 3,602
 
1,210 posts
Join Date:Joined: Dec 2011
Donate to Me
More
Quote:
Originally Posted by DooMLoRD

glad to see u here

u still have the same nick>> X10 awesome


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 by Adi_Pat; 16th February 2013 at 03:30 PM.
The Following User Says Thank You to Adi_Pat For This Useful Post: [ View ]
17th February 2013, 04:21 PM   |  #9  
varshil's Avatar
Senior Member
Flag mumbai
Thanks Meter: 399
 
720 posts
Join Date:Joined: Sep 2010
More
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
18th February 2013, 06:56 AM   |  #10  
DooMLoRD's Avatar
OP Recognized Developer
Flag Noida
Thanks Meter: 39,110
 
13,127 posts
Join Date:Joined: Jul 2010
Re: [Kernel-Sources] Xperia Z (SO-02E) {FW: 10.1.D.0.317}
Quote:
Originally Posted by Adi_Pat

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




Quote:
Originally Posted by varshil

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 by DooMLoRD; 20th February 2013 at 11:08 AM.

The Following 2 Users Say Thank You to DooMLoRD For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes