[DISCUSSION][DEV] TWRP for X8 - XPERIA X8 General

Okay guys. So over the past few days I've tried to compile KXP (AOKP for X8, if you didn't know) and failed.....thrice. The main aim behind this was to get
a) AOKP m6 for X8
b) TWRP running on our device
Now a) is still resulting in failures but b)....well, let's just say it can still be worked on. So this is what I've done so far:
I compiled a CWM version (without compiling KXP) just to get the environment ready for building TWRP. Next I edited the BoardConfig.mk to include these lines under a heading of #twrp like this
#twrp
DEVICE_RESOLUTION := 320x480 (the device resolution)
RECOVERY_GRAPHICS_USE_LINELENGTH := true (this line is supposed to improve graphics on some devices)
TW_NO_BATT_PERCENT := true (this line prevents battery percentage display in the recovery GUI)
TW_NO_REBOOT_BOOTLOADER := true (self-explanatory; we can't reboot into bootloader, can we?)
TW_NO_REBOOT_RECOVERY := true (this option never worked for me and so I removed it)
I sent the binary (obtained by typing make -j# recovery after copying the TWRP repo to the bootable/recovery directory) to feherneoh (the dualboot dude) and asked him to use it in a kernel, changing nothing else but the recovery binary. He said the phone didn't even boot.
Now I've noticed there are a couple of other libs and files built with TWRP. And also there's another recovery binary in /out/target/product/shakira/symbol/system/bin.
What I'm trying to do is compile a kernel with this binary. So far feherneoh's failed. And I'm pretty sure there's something else that needs to be done. I know about the recovery GUI images; I will place them in the res folder and try again but I'm pretty sure it will fail.
So i'm asking experienced X8-ians to help me out, especially devs like Daveee10, Rohin, nAa, alfsamsung, djnilse....the list doesn't end.
Looking forward to replies.

This is what lead dev of TWRP, Dees_Troy had to say:
Re: Compiling TWRP for X8
Originally Posted by sgt. meow
Dear Sir,
I have started a TWRP-porting project for the X8. I have compiled the binary (make -j# recovery) using the following flags:
#twrp
DEVICE_RESOLUTION := 320x480
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_NO_BATT_PERCENT := true
TW_NO_REBOOT_BOOTLOADER := true
TW_NO_REBOOT_RECOVERY := true
I haven't tested it myself. However I sent a fellow member (with experience in this field) the binary (from /out/target/product/shakira/system/bin) and asked him to integrate it with a working kernel, changing nothing else but the recovery binary. He said the phone didn't boot up. I believe the images from the /bootable/recovery/gui/devices/320x480/res/images have to be placed in the kernel too, in order to get it working. I am very new to this and would greatly appreciate if you helped me with the following:
What files are related to the TWRP recovery?
What has to be done to integrate it with a kernel?
What files need to be edited?
Do the libs built along with TWRP need to be installed on the phone?
Thanking you and the rest of Team WIN in advance
sgt. meow
Click to expand...
Click to collapse
Generally speaking, the actual recovery files would be in out/target/product/shakira/recovery/root. What you have to have for integrating into your kernel build will depend a little bit on how your kernel ramdisk(s) are packed. You'll need, at the very least, the etc (for the recovery.fstab), sbin (binaries and libs), and the res (theme and zip signature keys) folders. Recovery usually gets its own init.rc so you'll have to do whatever you need to do to get the recovery/root/init.rc integrated into your kernel or at the very least, modify an exising init.rc so that recovery gets the LD_LIBRARY_PATH value as covered in the guide.

Here's the link to a zip I uploaded: http://www.mediafire.com/?ad374fp01274e3z
It contains the output files when TWRP is compiled as a binary (in the "TWRP(binary files)" folder) and the ramdisk-recovery.cpio when TWRP is compiled as an image by issuing make -j# recoveryimag (in the "TWRP(image files)" folder).
Note: The binary didn't build the res images. They had to be taken from the gui folder of the bootable/recovery directory. However the images were there when TWRP was compiled as an image in the ramdisk-recovery.cpio.
Note 2: This is compiled using jb-wip branch. The first binary and image was compiled using master branch. I later found out that I was supposed to use the jb-wip branch instead of the master branch.

Well you should make it to compile with rom together. When its built then u will get "ramdisk-recovery.img" or zip... inside this one you will have all needed binaries and images. Then just open kernel ramdisk and replace those binaries. There are lot more needed binaries than just "recovery".
But first you must compile everything
Sent from my mind using fingers

You mean like make -j# recoveryimage.

sgt. meow said:
You mean like make -j# recoveryimage.
Click to expand...
Click to collapse
Try with brunch
Sent from my X8 using xda app-developers app

Problem with brunch is I run into some errors while compiling the ROM (which stop the building) so I won't get any end product. I tried recoveryimage and got a lot of ramdisk-***.img's and cpio's and what-nots.

sgt. meow said:
Problem with brunch is I run into some errors while compiling the ROM (which stop the building) so I won't get any end product. I tried recoveryimage and got a lot of ramdisk-***.img's and cpio's and what-nots.
Click to expand...
Click to collapse
Thats good too now extract ramdisk-recovery.img if you have it
Sent from my X8 using xda app-developers app

sgt. meow said:
Problem with brunch is I run into some errors while compiling the ROM (which stop the building) so I won't get any end product. I tried recoveryimage and got a lot of ramdisk-***.img's and cpio's and what-nots.
Click to expand...
Click to collapse
The brunch not help Tried a lot of variant (compile only the recovery/compile with rom/millions of different settings/etc...) The phone start the recovery, but not work (the best result is only a flickering image). Earlier I consulted with Daveee10, but he have same results.

I couldn't extract ramdisk-recovery.img but I extracted ramdisk-recovery.cpio and I get a lot of files in the sbin directory like recovery, sdparted, fix_permissions.sh, adbd and a lot of libs. In the etc directory there is a recovery.fstab.

pilu1978 said:
The brunch not help Tried a lot of variant (compile only the recovery/compile with rom/millions of different settings/etc...) The phone start the recovery, but not work (the best result is only a flickering image). Earlier I consulted with Daveee10, but he have same results.
Click to expand...
Click to collapse
Then we are missing some files or there are wrong configurations...
Sent from my X8 using xda app-developers app

How did you try pilu1978? I mean where did you place the libs and the binary?

sgt. meow said:
I couldn't extract ramdisk-recovery.img but I extracted ramdisk-recovery.cpio and I get a lot of files in the sbin directory like recovery, sdparted, fix_permissions.sh, adbd and a lot of libs. In the etc directory there is a recovery.fstab.
Click to expand...
Click to collapse
Now replace all the files in ramdisk with these new ones
Sent from my X8 using xda app-developers app

It won't work. I'm pretty sure about it.
EDIT: Okay apparently it is the right way. Sorry Xmaster8. Lesson learned.

Xmaster8 said:
Now replace all the files in ramdisk with these new ones
Sent from my X8 using xda app-developers app
Click to expand...
Click to collapse
Yes. I examined a disassembled recovery binary from other phone (what is working correctly), the recovery depends on these binaries:
libz.so, libc.so, libstlport.so, liblog.so, libcutils.so, libstdc++.so and linker. These binaries needed in the ramdisk.

But should these be in the sbin?

sgt. meow said:
But should these be in the sbin?
Click to expand...
Click to collapse
Yes, you can place here. Or any other place, but need to add the path in init.rc. For example:
export PATH /sbin
EDIT: I forgot, libm.so also needed

One more thing. Should I try this with ICS or JB?

sgt. meow said:
One more thing. Should I try this with ICS or JB?
Click to expand...
Click to collapse
If you built with ics source tree then ics and if jb then jb
Sent from my X8 using xda app-developers app

sgt. meow said:
One more thing. Should I try this with ICS or JB?
Click to expand...
Click to collapse
I tried with cm7 For my own goal the ICS/JB is too slow/unstable. But Daveee10 working on twrp with his own JB project, looks like he have same results with CM11 than me with CM7. I think the problem source is not the CM version, maybe something missing from the device specific files.

Related

Championswimmer's Ultimate HOW-TO

after numerous requests here we go!!!
no it's not complete yet, just starting...
firstly i'll just link up all threads from where i took collected my info, and then i'll start wiriting my how-to
it'll take time as my school and entrance exams are main priority at the moment but i'll do it in bits and pieces and i'll manage to pull it off before you x10 dies off .. ha ha ha
==========================================================================================================
SIMPLE GUIDE TO COMPILE KERNEL FOR X10i/X10a
=====================================================================================================
COMPILE AOKP FOR ANY XPERIA PHONE
=====================================================================================================
REFERENCE TO COMPILE AOSP/AOKP/CM7/CM9 FOR X10i/X10a
==========================================================================================================
firstly credits : >
1. DoomLord -> whose tools and info thread are just awesome
2. Zdzihu -> the biggest ever dev for x10 and for doing impossible feats
3. Freexperia Team -> for supporting this device for 2 years
4. Spaarc -> for his guide and his vast knowledge (guys!! this dude is 1 yr younger than me!!)
5. Azuzu -> for his awesome windows based tools
6. Androxyde -> flashtool and awesome shell scripts
7. Colossus -> for being the best mod ever !!! (yes i mean it buddy) and for guiding me a lot
8. Sahibunlimited -> for being me buddy and a really good friend to everybody here
9. GregBradley -> for being having the most useful signature in xda (and having helped me out when i was a noob)
10. LzVebz -> Pestering me to write this
phew!!! hope that's all?? more left?? please pm me, i'lll add you
EDIT
11. pvyParts -> for showing how to work on apk files
12. iridaki -> for being helpful and encouraging and pepping me up for all the good work i did and mostly for being an elder sister
13. ~Pilot~ -> for keeping xda clean
14. TAL333 -> for standing by me and believing in me
So firstly the threads that I read and YOU SHOULD PLEASE GO THOUGH ONCE before reading my Howto
spaarc's porting guide
doom's guide 1
doom's guide 2
doom's guide 3
doom's all in one info thread
doom's kernel.sin and ftf creator
doom's kernel.sin unpacker
dsixda kitchen (for "cooking" roms)
using android kitchen for xperia devices
http://forum.xda-developers.com/showthread.php?p=12875
Ok so as they say "safety first"
Let me give you your CRASH HELMET
It is said that x10 is UNBRICKABLE, though that is true but not hard and fast rule. Jerpelea and Doomlord have bricked x10 devices before and it's not all that impossible. Still, if you keep care of following things, you'll never brick your phone
1. NEVER DISCONNECT USB CABLE while flashing/bootloader unlocking/pccompanion upgrade is going on
2. Be extremely careful while using the_laser or 9Lukas5's unlock procedure. It changes device partition and mapper modules so they are delicate ares and can brick your device if procedure is not followed
3. DO NOT PANIC, THINGS CAN BE SET RIGHT. BE CALM, BE PATIENT, ASK FOR HELP AT XDA
=======================================================================================================================
Ok so, there can be bad flashes or whatever..... what to do if device does not boot up??
1. If the problem is about RED flashing led, then just plug your phone into a charger and wait over night it's a low charge problem. Once charged, all will be ok
2. If you face boot loop and you just do not know what to do (i.e. you cannot go to recovery too) then do this
a.) either download PC companion and update/upgrade your phone
OR
b.) download latest flashtool and flash a 2.1 for 2.3.3 firmware (that you get in .ftf format) that will set you on track
ok so to tell a few things first....
please do not pm me.regarding this.
ask any questions here.
i or any other member would definitely help
and dont get impatient.... I'm busy...so it'll take time to complete the guide
Sent from my X10S using xda premium
Finally it's here!!! Thanks man, I've been waiting for this
LzVebz said:
Finally it's here!!! Thanks man, I've been waiting for this
Click to expand...
Click to collapse
I've not yet started....feeling too lazy...but dont worry...in a week or two it'll be complete
Sent from my X10S using xda premium
Alright pretty dumb question feel free to shoot me. If I take an system ui apk and framework apk from say arc and just change it with my existing system ui n framework will I be getting the same theme of Sony arc.
Sent from my X10S using XDA
stanzzzzz said:
Alright pretty dumb question feel free to shoot me. If I take an system ui apk and framework apk from say arc and just change it with my existing system ui n framework will I be getting the same theme of Sony arc.
Sent from my X10S using XDA
Click to expand...
Click to collapse
maybe yes with systemui
DEFINITELY NOT with framework.
the framework res is not just the ui.
it defined the whole Android system...
it just cannot be ported like that....lol
@everyone
i won't shoot if you ask dumb questions.
you can ask dumb questions if you wish to.
that's the way we learn
Sent from my X10S using xda premium
Really happy to see someone doing this, thanks CS, may I suggest adding dooms guide to create update/amend scripts? I am sure you'll get to it! Best if luck with your exams too.
Sent from my X10i using XDA
[email protected] said:
Really happy to see someone doing this, thanks CS, may I suggest adding dooms guide to create update/amend scripts? I am sure you'll get to it! Best if luck with your exams too.
Sent from my X10i using XDA
Click to expand...
Click to collapse
never heard of that guide
I'll search and see....
i learnt amend and edify on my own by looking through various zip files....ha ha ha.
btw the dsixda kitchen makes edify/amend scripts automatically
Sent from my X10S using xda premium
championswimmer said:
maybe yes with systemui
@everyone
i won't shoot if you ask dumb questions.
you can ask dumb questions if you wish to.
that's the way we learn
Sent from my X10S using xda premium
Click to expand...
Click to collapse
Excellent! In which case, can you answer this question?
http://forum.xda-developers.com/showthread.php?t=1574805
blueowl0708 said:
Excellent! In which case, can you answer this question?
http://forum.xda-developers.com/showthread.php?t=1574805
Click to expand...
Click to collapse
decompile settings.apk and go through the xml files you get and play around with them a little....
Sent from my X10S using xda premium
this one
Ok, so lets get to our stuff fast
Her we begin with some info about how a ROM works
when cooking/porting roms, you are concerned with only a few folders
download any randon ROM zip and unzip it and see what it contains
1. /system/app -> this folder contains all apk files of apps
2. /system/framework -> this folder contains lots of .jar files that defines how the base operating system will run and function
3. /system/lib -> lots of .so files that are like drivers (yep .dll files in windows), these specify how the software communicates with various hardware components
4. /system/etc -> very dangerous folder contains lots of important configurations
5. /system/etc/permissions -> these contain lots of xml files that are required to define how the .jar files in framwork folder will work
ok so i'll elaborate point 2 and 5 a little more taking example of the panorama beta app by SE. it requires the com.sonyericsson.android.seee.jar file in framework folder to work but if you just keep the jar file, it'll not work. you need to sort out its permissions too and for that you need to put com.sonyericsson.android.seee.xml file in permissions folder
Click to expand...
Click to collapse
also the etc folder contains two some files called
gps.conf (which defines which gps server the device will use)
hosts (this defines which websites will be blocked .... yes that is your adblocker file )
apns.xml (which defines your apn configuration)
screwing up these files can cause you internet/gps/data traffic problems. also intelligent editing of these fils can give you better gps/data too
Click to expand...
Click to collapse
hey champ!
First I'd like to thank you very much for this nice guide and for your kernel. With latter u saved my ass. Was on Doom's with FeraLab and phone reboots sometimes Now it's flying!!!
But I'm fan of good design. And please don't hit me, but I'd like to change the boot-logo of your kernel is there any way? Or do u have any nice guide to change logo?
Would be awesome!!!
Question
Hi champ,
Does THIS also work for X10?
LzVebz said:
Hi champ,
Does THIS also work for X10?
Click to expand...
Click to collapse
not precisely.
for the perfect repacking script, see www.github.com/championswimmer/kCernel-goro
inside build-bootimg folder
Sent from my X10S using xda premium
championswimmer said:
not precisely.
for the perfect repacking script, see www.github.com/championswimmer/kCernel-goro
inside build-bootimg folder
Sent from my X10S using xda premium
Click to expand...
Click to collapse
Thanks!
I've one question left I think
I'm currently on Windows 7 ultimate, and I have 1 TB left on drive D (which is empty) My question is.. Is there a way to Dual-boot Windows & ubuntu without wubi?
Thank u very much again
Compiling kernel
So letme tell you how a kernel for x10 can be compiled
1. install ubuntu (through wubi or in vmware will also do) but i prefer on a separate partition.
2. Install the following packages
git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
here's how you go about doing it
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
sun-java6-sdk is no more officially available through ubuntu repositories
so you will need a workaround.... so here are some helpful articles
http://www.gaggl.com/2011/10/installing-java6-jdk-on-ubuntu-11-10/
http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric
http://softwareinabottle.wordpress.com/2011/11/17/install-sun-jdk-6-on-ubuntu-11-10/
In case you are on a 64-bit version of ubuntu, (btw i strongly recommend using a 32 bit version for android development as you'll face various problems with 64-bit at various stages) you'll need these packages too
ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib​
3. Next you'll need a cross-compiler.
a cross compiler is used to compile for a different architecture than from the one you are currently working on. in this case you are either on a i686 or amd64 pc while the kernel you are compiling is for an ARMv7 processor.
for ubuntu, getting the Linaro GCC cross compiler for arm is getting as easy as
Code:
sudo apt-get install gcc-arm-linux-gnueabi
4. Now you are pretty much set up to compile kernels. Next we need sources.
So let me link you up to the most common available ones
Sony Ericcsoon Official Kernel Sources for 3.0.1.G.0.75 (gingerbread firmware)
Sony Ericsson Official Kernel Sources for Eclair Firmware
FreeXperia Kernel For ICS
FreeXperia Kernel for GingerBread
DoomKernel (this is my forked repo)
*** i'll update this list later (there are dozens of kernels for x10, all have their sources, i guess for now, this is enough)
5. So the source you have downloaded will be either a tar or zip archive. Using archiver, extract it into a directory of your liking.
6. Open terminal and 'cd' into the kernel directory. The kernel directory is the one which contains the folders arch, block, crypto, firmware, drivers .....
for compiling kernel you need to be in the root of this direcrory.
7. So here are a few codes that will get your kernel compiled
To clean source directory : -
Code:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make clean
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make distclean
To get default configuration
Code:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make semc_es209ra_defconfig
if you are compiling FXP kernel then instead of semc_es209ra_defconfig you need to write fxp_es209ra_defconfig , and likewise for DoomKernel you need to use doom_x10_defconfig
To configure the kernel
Code:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make menuconfig
inside general setup you can name your kernel
and inside power management setup you can setup which CPU governors will be present and which will be default
do not mess to much with the driver setups or with "kernel hacking" area....
do not touch things that you have no idea about
Finally... to compile the kernel
Code:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- make
If all goes well, you'll get this message
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
If you get stuck in between, nothing to fret about. Just post here what problem you faced, amd me or some other helpful soul will help you out
8. I know you are thinking "whew!! are we done??"... ha ha ha!! no buddy!! not yet... much more work to do.
Firstly from you kernel directory go to arch/arm/boot (using a file explorer, not a terminal) and inside you'll find a 2~3 MB sized file called zImage. Copy that file into a separate folder where you'll stach all your finished works.
9. Now we need to compile the wifi modules.
It is imperative to note here that wifi modules should be compiled immediately after kernel has been compiled. DO NOT run "make clean" or "make distclean" commands in the kernel folder before wifi modules have been compiled
Click to expand...
Click to collapse
For compiling wifi, you'll need the "vendor" folder (which is there in official sony kernel sources but not present in Doom's or FXP's repo). So if you need just the vendor folder, you'll HAVE TO download the official kernel sources too.
in terminal 'cd' to vendor/atheros/wlan/host/ folder
edit the localmake.linux.inc file using a text editor
Code:
sudo gedit localmake.linux.inc
edit the line ATH_CROSS_COMPILE_TYPE := arm-eabi- to ATH_CROSS_COMPILE_TYPE := arm-linux-gnueabi-
also in the line
# ATH_LINUXPATH := < kernel source path >
remove the # (uncomment it) and insert the appropriate kernel source path (the folder that contains arch, crypto, firmware, drivers etc folders.
now to compile wifi modules, run this code
Code:
ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KERNEL_DIR=/path/to/kernel make
of course, in place of "/path/to/kernel" type the actual path to kernel on your pc
this will get your wifi module compiled
go to the folder
vendor/atheros/wlan/host/.output/QUALCOMM_ARM_NATIVEMMC_BSP_REV=3240-SDIO/image/
and you'll find a file ar6000.ko
transfer that file to the place where you kept your zImage safely earlier.
10. PHew!! done?? ha ha .. no dude.. still not...more work left
now to pack things up, you'll need a ramdisk.
so lets steal a ramdisk from a already working kernel (for stock kernel take stock ramdisk, for cm7/cm9 take respective ramdisk)
take any kernel and unpack it using instructions given here
the file ending with xyz.cpio.gz is the ramdisk. rename the file into "ramdisk" (without any extension) and put this file into the folder where you kept your zImage and wifi module.
Now transfer all these three files into a folder which is accessible from your Windows partition (oops... yeah... without windows you cannot finish this job)
Rest of the steps that follow are to be done on Windows (i have not tried on WINE)
rename zImage to "image"
now using this tool (courtesy DoomLord) pack your ramdisk and image into a flashable .ftf file
also make a copy of the file ar6000.ko and name it wifi.ko
both these ar6000.ko and wifi.ko files are supposed to be in the folder /system/lib/module of your mobile (please create appropriate flashable zip for the same)
===============================================================================================================
If you found this Guide helpful, please remember to press the thanks button ;P
================================================================================================================
LzVebz said:
Thanks!
I've one question left I think
I'm currently on Windows 7 ultimate, and I have 1 TB left on drive D (which is empty) My question is.. Is there a way to Dual-boot Windows & ubuntu without wubi?
Thank u very much again
Click to expand...
Click to collapse
send me a screenshot of you disk manager (start->computer management -> disk management)
then i'll tell you how you can set it up easily

[Tutorial] Kernel building instructions for Xperia SP

kernel sources for Xperia SP (C5302, C5303, C5306, M35h) {FW: 12.0.A.1.257} are available...
link to download sources:
http://dl-developer.sonymobile.com/code/copylefts/12.0.A.1.257.tar.bz2
i will keep pushing stock kernel sources to my git tree at the following branch:
https://github.com/DooMLoRD/android_kernel_sony_msm8960t/tree/sony_sources
following are the build instructions for developers who plan to work on this device....
toolchain recommended: Google GCC 4.7
Building kernel (zImage):
for Xperia SP:
import defconfig
Code:
ARCH=arm CROSS_COMPILE=~/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make viskan_huashan_defconfig
build zImage
Code:
ARCH=arm CROSS_COMPILE=~/arm-linux-androideabi-4.7/bin/arm-linux-androideabi- make -j8
incase u get errors like:
Code:
error : /scripts/gcc-wrapper.py
just correct the permissions of that file
Code:
chmod 755 ./scripts/gcc-wrapper.py
here is patch for compatibility with GCC 4.7 compilation
regards,
DooMLoRD
Instructions for building kernel.elf
first get the kernel built... once kernel is built u will get zImage and copy that zImage to the folder containing the build tools...
i have posted the build tools i use here:
https://github.com/DooMLoRD/build_tools/tree/master/msm8960t_viskan
Sony using the ELF format (similar to the 2012 devices)...
build kernel.elf
u can directly use the files posted at my git repo for build tools
or
use the following command:
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
the correct RPM.bin & bootcmd are posted at my git tree for build tools...
regards,
DooMLoRD
@DooMLoRD
I have to answer a lot of questions when compiling like board selection etc (have been clicking y and and enter for about 30 minutes now) is this normal?
View attachment 2411564
Hi Doomlord.
Being a fresh Xperia User, never heard about u on HTC forums. But glad to know you are helping a lot of people around here. I was wondering whether you could help me in understanding a bit about xperia phones before i dive into kernel kanging n stuff.
What i know from HTC devices
Partitions are like this:
Boot (separate partition on NAND)
Recovery (separate partition on NAND)
System like above
Data, same
Cache, same
etc
There, we used to flash boot.img to boot. boot.img contained kernel zImage+ramdisk
For recovery, we have recovery.img which contained zImage+recoveryramdisk
Then system and data etc as every other phone.
Here in Xperia, i cant understand where the recovery is. Is it inside kernel.elf?
Is it placed on a dedicated partition?
I want to know what i am messing with, before continuing.
What i plan to do is.
Build a clean TWRP from source (for myself, usage and learning.)
Build a stock based kernel from source. Add few govs/scheds and maybe Doubletap2wake etc. (but thats a little way ahead.)
Can you help me with this?
neXus PRIME said:
Hi Doomlord.
Being a fresh Xperia User, never heard about u on HTC forums. But glad to know you are helping a lot of people around here. I was wondering whether you could help me in understanding a bit about xperia phones before i dive into kernel kanging n stuff.
What i know from HTC devices
Partitions are like this:
Boot (separate partition on NAND)
Recovery (separate partition on NAND)
System like above
Data, same
Cache, same
etc
There, we used to flash boot.img to boot. boot.img contained kernel zImage+ramdisk
For recovery, we have recovery.img which contained zImage+recoveryramdisk
Then system and data etc as every other phone.
Here in Xperia, i cant understand where the recovery is. Is it inside kernel.elf?
Is it placed on a dedicated partition?
I want to know what i am messing with, before continuing.
What i plan to do is.
Build a clean TWRP from source (for myself, usage and learning.)
Build a stock based kernel from source. Add few govs/scheds and maybe Doubletap2wake etc. (but thats a little way ahead.)
Can you help me with this?
Click to expand...
Click to collapse
The recovery is inside the kernel but that's all I know
Sent from my C5303 using xda app-developers app
Yep. I found all I needed to know.... Fotakernel partition, elf ramdisk kernel and other stuff.
Sent from my C5303 using Tapatalk
No NAND is used
EMMC is there in all new xperia devices
Sent from my C6902 using xda app-developers app
DooMLoRD said:
No NAND is used
EMMC is there in all new xperia devices
Sent from my C6902 using xda app-developers app
Click to expand...
Click to collapse
ok thanks...
one more thing, if i build a custom kernel (lets say, stock-based), without any major changes..... can i flash that kernel file without unlocking bootloader???
as i understand, only kernel ftf files can be flashed via flashtool in locked bootlaoder.... correct me if im wrong.
neXus PRIME said:
ok thanks...
one more thing, if i build a custom kernel (lets say, stock-based), without any major changes..... can i flash that kernel file without unlocking bootloader???
as i understand, only kernel ftf files can be flashed via flashtool in locked bootlaoder.... correct me if im wrong.
Click to expand...
Click to collapse
No u can't
Sent from my C5302 using Tapatalk
Siddhesh said:
No u can't
Sent from my C5302 using Tapatalk
Click to expand...
Click to collapse
I compiled my kernel with a different splash screen and it flashed but I got a flashing black screen and it doesn't boot (i have UBL)
hi @DooMLoRD,
when i am making the elf of the zImage i am getting this error
[email protected]:~/android/huashan files/build tools/jk_output$ sudo bash '/home/jk-cha0s/android/huashan files/build tools/jk_output/build_it.sh'
[sudo] password for jk-cha0s:
Traceback (most recent call last):
File "mkelf.py", line 182, in <module>
main(sys.argv[1:])
File "mkelf.py", line 159, in main
size = os.path.getsize(seg.file)
File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 'ramdisk.cpio.gz'
where to get the ramdisk.cpio.gz ?
edit:its inside a working kernel extract from there
neXus PRIME said:
Yep. I found all I needed to know.... Fotakernel partition, elf ramdisk kernel and other stuff.
Sent from my C5303 using Tapatalk
Click to expand...
Click to collapse
hey hi,
i need to know how to integrate recovery into a kernel i made. please help me to do it. :silly:
About Xperia SP(m35t)
Hello DooMLoRD
I want to ask you about how to build a kernel of m35t. I had tried to use the build_tools-master to unzip the kernel of m35t, and then repacked it without any modification. I flash the new kernel.elf but the phone doesn't work, how should I do ?
I want let the m35t run on Android 4.3 cause Sony hasn't update it, hope you can help me. Thanks a lot!
NewBay_STanLey said:
Hello DooMLoRD
I want to ask you about how to build a kernel of m35t. I had tried to use the build_tools-master to unzip the kernel of m35t, and then repacked it without any modification. I flash the new kernel.elf but the phone doesn't work, how should I do ?
I want let the m35t run on Android 4.3 cause Sony hasn't update it, hope you can help me. Thanks a lot!
Click to expand...
Click to collapse
Hi,
For android 4.3 the command to pack has changed from
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
To
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
pec0ra said:
Hi,
For android 4.3 the command to pack has changed from
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
To
Code:
python mkelf.py -o kernel.elf [email protected] [email protected],ramdisk [email protected],rpm [email protected],cmdline
Click to expand...
Click to collapse
Thanks, Pec0ra.
Yes, I know the command is changed, I repacked original kernel with build_it_JB-4.1.sh, the system is 12.0.C.2.58, everything is original, but the phone doesn't work.
I guess there is a little difference between c5303 and m35t, that I need to make a little modification to this tool.
I found the difference between m35t and other SPs
Finally, I found a difference between m35t and other SPs. The build_tools-master shouldn't be wrong, there is only one explanation is the RPM.bin not working for m35t. So,the rebuilt kernel can't boot up the m35t. @DooMLoRD, could you give me the right RPM.bin for m35t? Thanks a lot!
NewBay_STanLey said:
Finally, I found a difference between m35t and other SPs. The build_tools-master shouldn't be wrong, there is only one explanation is the RPM.bin not working for m35t. So,the rebuilt kernel can't boot up the m35t. @DooMLoRD, could you give me the right RPM.bin for m35t? Thanks a lot!
Click to expand...
Click to collapse
I think you can simply unpack it from stock kernel with the build tools. You will just have to find out which one of the extracted file it is since it might have another name.
Good news!
Good news! I found the way to extract rpm.bin witch use the flashtool. I use the version 207 C5303's zimage and ramdisk.cpio.gz and m35t's rpm.bin to repack the kernel. When I flash the kernel and version 207's rom in my m35t, it works! But only press the power button can let the back light gets on and off, the screen still can't display anything, and it can't play any sound, but it still take a big step!

[TUT] [SABERMOD] How to Compile Your Own AOSP/CM Custom Kernel

Since this is in the Moto G (Falcon) forum, these steps are for the Falcon. This does not mean that it isn't the same for other phones! Even if you don't own a Falcon device, feel free to ask for help here!
Prerequisites:
- You must have a Linux firmware running on your computer (I suggest Builduntu because you can skip the next one [build environment setup])
- Build environment setup (Put the this in terminal and follow instructions)
- Patience and a heart willing to learn
- You need to know the languages C, C++, Java, Ruby, Python... NOT! You don't need to know ANY coding languages.
[MOTIVATIONAL SPEECH]
Truth be told, when I first started out developing, I knew NO coding languages except for HTML and a little bit of Java. Both have nothing to do with kernels! I actually learned how to do this when I suffered from a concussion. So if you really want to learn how to kernel dev and you give up halfway, just know that a 14 year old kid with a concussion beat you .
[/MOTIVATIONAL SPEECH]
Click to expand...
Click to collapse
WARNING: I am not responsible for any damages to your phone or computer or pet unicorn. When you modify the wrong partitions, set too many jobs for your compiler etc., that is not anyone's fault but yours.
Your Personal Handbook to the Following:
- Anything inside "CODE" boxes, type it into your terminal. If you can't find terminal, then press CTRL, ALT, t.
- If I were you, I would write these by hand instead of copying and pasting it because after a certain amount of times, you will remember the linux commands and it will be easier for you to compile more kernels for different devices
- Use this thread as a "Help Me" button. Ask for help!
Click to expand...
Click to collapse
A New Beginning:
Let's start out with something simple, getting the actual code:
Code:
git clone https://github.com/cyanogenmod/android_kernel_motorola_msm8226
This could range from 3 minutes to 2 hours! Read a book, count your fingers, watch ****, and wait patiently.
Once that's done, open up your file manager and rename the folder (should be android_kernel_motorola_msm8226) to whatever you want. I will refer it as "mykernel".
Click to expand...
Click to collapse
Pokemon!
For this tutorial, we will be using a Sabermod 4.7 toolchain to compile. I WOULD teach you how to compile with 4.8+, but it creates errors that will take even longer for me to write about sooooooooo :fingers-crossed:. Now to get the toolchain:
Code:
git clone https://github.com/SaberMod/android_prebuilts_gcc_linux-x86_arm_sabermod-arm-eabi-4.7
Rename this to whatever you like, but I will be referring this as "toolchain"
Now go into you folder where the kernel source is stored...
Code:
cd mykernel
Click to expand...
Click to collapse
Almost done :
Time to set-up the compiler!
Code:
export CROSS_COMPILE=/home/*your linux name*/toolchain/bin/arm-eabi-
This tells the toolchain that "OK, we want to make ALL this code here into a kernel".
This next line tells it that your defconfig (the toolchain's manual for compiling the kernel) that it's in the arch/arm/configs folder.
Code:
export ARCH=arm
Now to tell the it what the defconfig is!
Code:
make falcon_defconfig
Hehe, now to the hardest part of all...
MuHAHHAHAHa
Click to expand...
Click to collapse
THE HARD PART
You ready for this? HERE IT IS! TIME TO BUILD THE KERNEL!
Code:
make -j4
Now sit back, relax, and watch the code! Or you could read a book, watch ****, count your fingers, play with your toes...
If you have an error during the waterfall of code, find the part where it actually says *error* (you'll probably have to scroll upwards) and search it on Google or post it here.
Click to expand...
Click to collapse
THE EASY PART
If you manage to get something that says "the kernel zImage is ready" or something like that, that means you've made it!
You have officially compiled your own kernel from source! Now you need to put it in a flashable zip.
Download this file and open it up, but DON'T EXTRACT IT.
Now go to your kernel source then "CTRL + F" and search for "zimage-dtb".
Find it and put it in the "kernel" folder of "FalconKernel - Signed.zip". Then "CTRL + F" and search ".ko".
Copy radio-iris-transport.ko and put it in the system/lib/modules (not pronto) of the zip.
Then find wlan.ko and rename it to pronto_wlan.ko. Copy and paste it in system/lib/modules/pronto of the zip.
Click to expand...
Click to collapse
Now you can put it on your phone and flash it! ​
Reserved
Here I will walk you through on how to add the intelliplug feature made by @faux123
First, fetch my Green Machine kernel source (go into your kernel folder in terminal):
Code:
git fetch https://github.com/YoshiShaPow/green_machine_falcon
Then you could cherry-pick (basically copy) all my cherry picks for intelliplug from my source.
If you do check my source out, you can see there's a little link to a history of commits near the middle of the screen, right above the files/folders. You can see at this page of my features history, you'll see a bunch of commits for intelliplug. I will use those commits and copy it to your own kernel.
This copies the initial coding/first commit of intelliplug!
Code:
git cherry-pick 01a850f
This cherry-picks the remaining commits so that your newly added intelliplug is updated.
Code:
git cherry-pick 6623f2f^..4e1ece7
One more thing though, you need to add the line to compile intelliplug!
Almost all things compiled along with the zImage are in a file called defconfig. What a defconfig does, is tell your machine to build certain modules, kernel objects, drivers, governors, etc.etc.etc.. Now, all of them are found in the folder
arch/arm/configs
Click to expand...
Click to collapse
As stated in the OP, you have to modify the defconfig you use. (CM11 Kernel is falcon_defconfig, Gummy Kernel is msm8226_mmi_defconfig). Open up the corresponding defconfig and add this to ANY line anywhere.
Code:
CONFIG_INTELLI_PLUG=m
Now, for those who are familiar with "y=yes/n=no/m=maybe", you'll see that I specifically told you to put the "m=maybe" one. That's because when you compile the kernel again, right after you're about to start your build. Since you put that "m", the terminal will prompt you with a "y=yes/n=no" question on whether or not you would like to add the following feature. Since you would like to add the feature, put in "y". Later on when you feel more comfortable with adding features to your kernel, you can go back into the defconfig and put it as
Code:
CONFIG_INTELLI_PLUG=y
So that it will compile it without asking, since you have given it an answer.
Now you have officially compiled a "Custom Kernel" and with the knowledge you know, you could create a feature packed one by just kanging (copying one's work/features).
Always remember to
Code:
make clean && make mrproper
after every build to prevent errors and such!
Click to expand...
Click to collapse
One More
One more
Nice guide!
I think it lacks one thing- how to modify the kernel.
The guide only mentions how to compile a preconfigured kernel, just the way it is. Modding kernels and adding new features (like OC, schedulers, s2w etc.) is the cool part about making a kernel yourself IMO.
Just a suggestion.
Sent from my XT1033 using XDA Premium 4 mobile app
KDB223 said:
Nice guide!
I think it lacks one thing- how to modify the kernel.
The guide only mentions how to compile a preconfigured kernel, just the way it is. Modding kernels and adding new features (like OC, schedulers, s2w etc.) is the cool part about making a kernel yourself IMO.
Just a suggestion.
Sent from my XT1033 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
Well, I will be putting the reserve posts to good use later
What would be the best way to test a kernel w/o bricking the phone?
adizz4 said:
What would be the best way to test a kernel w/o bricking the phone?
Click to expand...
Click to collapse
You can't brick a phone with an unmodified kernel!
Oops double post
adizz4 said:
What would be the best way to test a kernel w/o bricking the phone?
Click to expand...
Click to collapse
Does "fastboot boot kernel.img" work from bootloader mode?
Also why wouldn't the any kernel zip work if I decompressed and compressed it again. I did that before this thread and it didn't work.
P.Kosunen said:
Does "fastboot boot kernel.img" work from bootloader mode?
Click to expand...
Click to collapse
I've been using that to test. Its a really good way but you'll have to build a boot.img
adizz4 said:
Also why wouldn't the any kernel zip work if I decompressed and compressed it again. I did that before this thread and it didn't work.
I've been using that to test. Its a really good way but you'll have to build a boot.img
Click to expand...
Click to collapse
I specifically said in the tutorial nor to unzip it... The zip is already signed (a prerequisite for flashing) and unzipping will break it.
Did we need sudo before make -j4 command?
Sent from my XT1032
Siekil said:
Did we need sudo before make -j4 command?
Sent from my XT1032
Click to expand...
Click to collapse
Not necessary
I'll be writing more posts on how to add features to your kernel and basic cherry-picking features
I syncd gummy kernel sources and tried to build using linaro and sm but I keep getting this error.
sound/soc/msm/msm8226.c:30:40: fatal error: qdsp6v2/msm-pcm-routing-v2.h: No such file or directory
Click to expand...
Click to collapse
Any inputs on that?
adizz4 said:
I syncd gummy kernel sources and tried to build using linaro and sm but I keep getting this error.
Any inputs on that?
Click to expand...
Click to collapse
Probably a gcc error... I'd try compiling with a 4.7 toolchain. And also, make sure you're using the msm8226_mmi_defconfig since gummy's different
@YoshiShaPow thanks for the guide. I'm using it to begin fooling around with some building.
May I be a pain in the *** and ask you for a lil help? If using the file you provided to insert the build, I get trouble with wifi (in latest Aospa). I don't expect you to solve that, but I was wondering how to make out of the zimage a boot.img file, but I've read around the ramdisk needs to be merged into that, and honestly I'm not so sure how to do that. I found some guides, but none of them is specific for falcon, so I might be goofing around if I follow them?
Also checked the flashing script in the file you provided and noticed that it makes a boot.img on the go, but couldn't figure out how to reproduce that either.
If what I'm asking is too hard or long to be answered , I understand :good:
Edit: now I tried building with Linaro and after sorting out a couple of errors, voilá, I got a build. But again, my wifi gets smashed. Everything else seems to work fine, but when I try to turn wifi on, it's dead, nothing happens. My ideas: could it be something about the way the kernel's flashed skipping a boot.img (ramdisk?)? Is it something about AOSPA (think it shouldn't since it uses CM kernel)? Or should I be looking into my build, making a logcat about the issue and working it back?
fermasia said:
@YoshiShaPow thanks for the guide. I'm using it to begin fooling around with some building.
May I be a pain in the *** and ask you for a lil help? If using the file you provided to insert the build, I get trouble with wifi (in latest Aospa). I don't expect you to solve that, but I was wondering how to make out of the zimage a boot.img file, but I've read around the ramdisk needs to be merged into that, and honestly I'm not so sure how to do that. I found some guides, but none of them is specific for falcon, so I might be goofing around if I follow them?
Also checked the flashing script in the file you provided and noticed that it makes a boot.img on the go, but couldn't figure out how to reproduce that either.
If what I'm asking is too hard or long to be answered , I understand :good:
Edit: now I tried building with Linaro and after sorting out a couple of errors, voilá, I got a build. But again, my wifi gets smashed. Everything else seems to work fine, but when I try to turn wifi on, it's dead, nothing happens. My ideas: could it be something about the way the kernel's flashed skipping a boot.img (ramdisk?)? Is it something about AOSPA (think it shouldn't since it uses CM kernel)? Or should I be looking into my build, making a logcat about the issue and working it back?
Click to expand...
Click to collapse
Sorry, I wanted to wait till I could use a computer to respond.
You must be missing the *.ko files:
You have officially compiled your own kernel from source! Now you need to put it in a flashable zip.
Download this file and open it up, but DON'T EXTRACT IT.
Now go to your kernel source then "CTRL + F" and search for "zimage-dtb".
Find it and put it in the "kernel" folder of "FalconKernel - Signed.zip". Then "CTRL + F" and search ".ko".
Copy radio-iris-transport.ko and put it in the system/lib/modules (not pronto) of the zip.
Then find wlan.ko and rename it to pronto_wlan.ko. Copy and paste it in system/lib/modules/pronto of the zip.
Click to expand...
Click to collapse
kernel for x86 device [Asus zenfone5] can be made using this method?
YoshiShaPow said:
Sorry, I wanted to wait till I could use a computer to respond.
You must be missing the *.ko files:
Click to expand...
Click to collapse
Uhm, no, I followed that part step by step. I did it once more to double check, and I'm still in the same place. Actually, I suspected something and tried your kernel (TGM) and had the same problem (WTF?). I need to try wiping everything and reinstalling aospa to make sure there isn't some other thing going on down there.
But it's ok, I'll figure it out somehow. What I'd really need if you can point me in the right direction, si how to step further into building a boot.img
Or for that I MUST follow the official CM method, meaning syncing the full repo and building just the kernel?
Thanks for your help!
---------- Post added at 10:42 AM ---------- Previous post was at 10:18 AM ----------
sanjib734 said:
kernel for x86 device [Asus zenfone5] can be made using this method?
Click to expand...
Click to collapse
I'd guess it's not about the method. I think there's no CM official support for this device. Do you have any unofficial source to build from (Github)? If so, I guess you could try.
Edit: should check if Sabermod is compatible with the device's arch too.

[LOLLIPOP] Xperia AOSP Project

hi all
we have included this device in open devices project
you can check news about project on
http://developer.sonymobile.com/knowledge-base/open-source/open-devices/
feel free to fork, build, fix and push back
Br
J
jerpelea said:
hi all
we have open up gits for Xperia Z,Z1,Z2 devices
http://developer.sonymobile.com/201...-aosp-for-xperia-on-github-video-open-source/
feel free to fork, build and push back
J
XDA:DevDB Information
Xperia AOSP Project, ROM for the Sony Xperia Z1
Contributors
jerpelea
Version Information
Status: Testing
Created 2014-10-16
Last Updated 2014-10-16
Click to expand...
Click to collapse
WHooop Whooop WHHHHOOOOP!! :victory::victory::highfive::fingers-crossed::good::cyclops::victory:
Thank you jerpelea!!!! :victory:
ps; sorry for OT, Just so SUPER excited by this news!!!!!
would this lead to a better generation of AOSP roms for Z1? with good battery and camera functionality?
jerpelea said:
hi all
we have open up gits for Xperia Z,Z1,Z2 devices
http://developer.sonymobile.com/201...-aosp-for-xperia-on-github-video-open-source/
feel free to fork, build and push back
J
XDA:DevDB Information
Xperia AOSP Project, ROM for the Sony Xperia Z1
Contributors
jerpelea
Version Information
Status: Testing
Created 2014-10-16
Last Updated 2014-10-16
Click to expand...
Click to collapse
Like the guy above me asked. How does the camera react on this one? Same functionality? Or loss of important parts like bionz etc..
Very Nice
Read somewhere that modem and camera are disabled.
So we can't know how the camera react at this moment.
Thank you very much! Will such devices as amami, togari etc. be added too?
Attention: "For example, the camera is not working and the modem is not enabled, which means you cannot make phone calls."
Von meinem Sony Xperia Z1 gesendet. Mit Hirn.
Please @jerpelea can you put up a tut for building this! :crying:
I have downloded the source, and setup the build environment like you said on github but having issues with the final out directory.
It builds 100%, no issues whatsover, but mkbootimg fails to build the boot.img and it doesnt build the system.img :crying: I only have the userdata.img, kernel, and a system folder (others as well but these three are the important ones, oh theres also the ramdisk.img as well)
I have tried compiling the system folder using mkfs.yaffs2 to a system.img file and that flashes fine, userdata.img flashes too but the kernel I have tried a few combos and I can flash the boot.img file using files I have compiled before but it never boots. Its hard to see whats going on because I think the system folder never flashes properly so I dont have access to adb or anything. Its hard to trouble shoot this as well because it "bricks" my device everytime and its time consuming getting it up and running again. The build.prop looks fine and all folders in system folder look spot on but I am clearly missing something. I tried the fastboot flashall as well but that didtnt do anything, it gives me an error saying something about it must be an OUT_DIRECTORY... or something (yes I have tried it from the out/target/product/honami/ directory but same error, I think its because its looking for a system.img file..)
Please can you give me a kick in the right direction? I have been pulling my hair out trying to flash this but its a no go.
Desperately want to get it up and running (I am prepared to even go a few days without the radio just to test it and I can live without the camera as well)
PS: Sorry for being such a noob!
NanoSurfer said:
Please @jerpelea can you put up a tut for building this! :crying:
I have downloded the source, and setup the build environment like you said on github but having issues with the final out directory.
It builds 100%, no issues whatsover, but mkbootimg fails to build the boot.img and it doesnt build the system.img :crying: I only have the userdata.img, kernel, and a system folder (others as well but these three are the important ones, oh theres also the ramdisk.img as well)
I have tried compiling the system folder using mkfs.yaffs2 to a system.img file and that flashes fine, userdata.img flashes too but the kernel I have tried a few combos and I can flash the boot.img file using files I have compiled before but it never boots. Its hard to see whats going on because I think the system folder never flashes properly so I dont have access to adb or anything. Its hard to trouble shoot this as well because it "bricks" my device everytime and its time consuming getting it up and running again. The build.prop looks fine and all folders in system folder look spot on but I am clearly missing something. I tried the fastboot flashall as well but that didtnt do anything, it gives me an error saying something about it must be an OUT_DIRECTORY... or something (yes I have tried it from the out/target/product/honami/ directory but same error, I think its because its looking for a system.img file..)
Please can you give me a kick in the right direction? I have been pulling my hair out trying to flash this but its a no go.
Desperately want to get it up and running (I am prepared to even go a few days without the radio just to test it and I can live without the camera as well)
PS: Sorry for being such a noob!
Click to expand...
Click to collapse
Sent from my GT-I9505 using XDA Free mobile app
Try using the new mkqcdtbootimg repo for kernel building, put it in system/extra. I've compiled successfully with aosp l-preview branch. Haven't tested the compiled rom though
krabappel2548 said:
Sent from my GT-I9505 using XDA Free mobile app
Try using the new mkqcdtbootimg repo for kernel building, put it in system/extra. I've compiled successfully with aosp l-preview branch. Haven't tested the compiled rom though
Click to expand...
Click to collapse
Thank you Sir!!! Yes! :highfive: That makes perfect sense! *doh* :silly: (i feel silly now)
Will try that. Really appreciate it!!! Thank you for the heads up and responding :good:
@NanoSurfer did you manage to build boot.img after copying the repo source to system/extras/ ? I wasn't able to Let me know if you did. I must be doing something wrong
tejaswi.rohit said:
@NanoSurfer did you manage to build boot.img after copying the repo source to system/extras/ ? I wasn't able to Let me know if you did. I must be doing something wrong
Click to expand...
Click to collapse
Hey bro
Nope. I put mkqcdtbootimg in my /bin folder so I could execute it from anywhere but it still wouldnt work (by the way, you have to compile mkqcdtbootimg using "make mkqcdtbootimg", wish someone told me that before ). So I compiled the kernel seperately and got a boot.img, put that in /out folder and tried fastboot flashall, nope no go. Useless.
I cannot make a system.img during compile time! I managed to make a system.img though by executing "make snod". I tried flasing that, with my userdata.img, boot.img, system.img. NOPE ,ALWAYS BRICKS!!!! Arrrgh!!!! Wtf?? Btw fastboot flashall simply does not work.
Anyway, I wish I knew how @jerpelea did it because I have tried EVERYTHING! Im super frustrated by this because it seems there is either
a) critical stuff missing to succesfully build.
b) information is way to vague.
Ive wasted a lot of time on this and Im getting tired of having to recover my phone everytime. So do yourself a favour bro and rather leave this until a proper tut is posted or someone can explain the steps in more detail.
Cheers
NanoSurfer said:
Hey bro
Nope. I put mkqcdtbootimg in my /bin folder so I could execute it from anywhere but it still wouldnt work (by the way, you have to compile mkqcdtbootimg using "make mkqcdtbootimg", wish someone told me that before ). So I compiled the kernel seperately and got a boot.img, put that in /out folder and tried fastboot flashall, nope no go. Useless. ............
Cheers
Click to expand...
Click to collapse
@NanoSurfer I compiled the ROM successfully and flashed it too. It booted up just fine. This is what I did.
I downloaded the sources of mkqcdtbootimg and then extracted the openssl libraries from Android Source and placed it in the mkqcdtbootimg source folder (place it inside libdtd folder too, not sure of the exact folder name)and typed "make". Initially I had an error regarding some linker error got it fixed by installing this package libssl-dev I'm running Ubuntu 14.04. Ok, so that resulted me in a mkqcdtbootimg executable. What I realized what while compile the compiler is calling mkbootimg when mkqcdtbootimg isn't there, so I renamed mkqcdtbootimg executable to mkbootimg and placed it in out/host/linux-x86/bin . I replaced the original mkbootimg.
Once I did that my compilation went smooth. I got all the required images in the out folder. I tried fastboot flashall that didn't work for me either. So these are the partitions are flashed manually.
1. userdata
2. cache
3. system
4. boot
5. recovery
Crossed my fingers and typed "fastboot reboot" and BAM! it booted right to the home screen
P.S. I have a Xperia Z2. I downloaded the Android Source for 4.4.4_r2 but the blobs seem to be for 4.4.2 as of now at least for Z2 so I had some issues regarding sensors. Going to change my branch and compile again. But other than that the ROM was smooth as silk
Don't give up
tejaswi.rohit said:
@NanoSurfer I compiled the ROM successfully and flashed it too. It booted up just fine. This is what I did.
I downloaded the sources of mkqcdtbootimg and then extracted the openssl libraries from Android Source and placed it in the mkqcdtbootimg source folder (place it inside libdtd folder too, not sure of the exact folder name)and typed "make". Initially I had an error regarding some linker error got it fixed by installing this package libssl-dev I'm running Ubuntu 14.04. Ok, so that resulted me in a mkqcdtbootimg executable. What I realized what while compile the compiler is calling mkbootimg when mkqcdtbootimg isn't there, so I renamed mkqcdtbootimg executable to mkbootimg and placed it in out/host/linux-x86/bin . I replaced the original mkbootimg.
Once I did that my compilation went smooth. I got all the required images in the out folder. I tried fastboot flashall that didn't work for me either. So these are the partitions are flashed manually.
1. userdata
2. cache
3. system
4. boot
5. recovery
Crossed my fingers and typed "fastboot reboot" and BAM! it booted right to the home screen
P.S. I have a Xperia Z2. I downloaded the Android Source for 4.4.4_r2 but the blobs seem to be for 4.4.2 as of now at least for Z2 so I had some issues regarding sensors. Going to change my branch and compile again. But other than that the ROM was smooth as silk
Don't give up
Click to expand...
Click to collapse
Ahhhhhh dude!!! A 1000 thanks to you mate!!! :highfive: YESSS VICTORY! :victory: She works... FINALLY :victory:
Man THANK YOU!!! I love you bro! :laugh: You made my day :good:
And a SPECIAL thanks to @jerpelea!!!!! Flip it was painful trying to figure this out but finally I've got it. I owe you @tejaswi.rohit
NanoSurfer said:
Ahhhhhh dude!!! A 1000 thanks to you mate!!! :highfive: YESSS VICTORY! :victory: She works... FINALLY :victory:
Man THANK YOU!!! I love you bro! :laugh: You made my day :good:
And a SPECIAL thanks to @jerpelea!!!!! Flip it was painful trying to figure this out but finally I've got it. I owe you @tejaswi.rohit
Click to expand...
Click to collapse
Congratulations @NanoSurfer Glad I could help How's the build ? Do you face any issues regarding screen brightness,rotation, sound and mobile network ? Those were the problems I had on my 4.4.4 build
tejaswi.rohit said:
Congratulations @NanoSurfer Glad I could help How's the build ? Do you face any issues regarding screen brightness,rotation, sound and mobile network ? Those were the problems I had on my 4.4.4 build
Click to expand...
Click to collapse
Same issues as you here are the problems I found:
1) mobile network broken
2) wifi not working
3) screen rotation not working
4) sound not working
5) brightness slider has no affect
6) internal storage showing as about 70mb
7) phone resets when restarted (like it does a factory wipe)
8) camera broken
9) Bluetooth broken
I managed to get the sound working though by flashing the aosp kernel from Sony's github I think I can fix wifi as well because I compiled the prima module, but I couldn't push it to system/lib as adb wouldn't allow it (read only file system) I'm still trying to figure out how to compile that module inline.
I think a lot of the problems are kernel related.
Interestingly tho, the performance is way better than I expected! Graphics and scrolling are very smooth.
Busy working on the issues. Will let you if I make any breakthroughs
I think I fixed the sound, just busy doing another build to test a few more things...
I'm struggling though to get the sim to work :crying: Also trying to fix wifi but I'm crossing fingers that the build I'm doing at the moment fixes that :fingers-crossed:
By the way, I was wrong previously about a few things, the data partition is actually displaying 100% correct and it doesn't reset after each boot. However, this was happening to me after I flashed a boot.img I compiled, I think maybe because I used a stock ramdisk Im just guessing but I don't know why. The kernel it builds with works just fine. If the next build is ok, I will post my device config files for others to play around with...
krabappel2548 said:
Sent from my GT-I9505 using XDA Free mobile app
Try using the new mkqcdtbootimg repo for kernel building, put it in system/extra. I've compiled successfully with aosp l-preview branch. Haven't tested the compiled rom though
Click to expand...
Click to collapse
working on the guide
br
J
to be able to build kernel you need
cd build && git cherry-pick 612e2cd0e8c79bc6ab46d13cd96c01d1be382139 && cd ..
before building
br
J
tejaswi.rohit said:
@NanoSurfer I compiled the ROM successfully and flashed it too. It booted up just fine. This is what I did.
I downloaded the sources of mkqcdtbootimg and then extracted the openssl libraries from Android Source and placed it in the mkqcdtbootimg source folder (place it inside libdtd folder too, not sure of the exact folder name)and typed "make". Initially I had an error regarding some linker error got it fixed by installing this package libssl-dev I'm running Ubuntu 14.04. Ok, so that resulted me in a mkqcdtbootimg executable. What I realized what while compile the compiler is calling mkbootimg when mkqcdtbootimg isn't there, so I renamed mkqcdtbootimg executable to mkbootimg and placed it in out/host/linux-x86/bin . I replaced the original mkbootimg.
Once I did that my compilation went smooth. I got all the required images in the out folder. I tried fastboot flashall that didn't work for me either. So these are the partitions are flashed manually.
1. userdata
2. cache
3. system
4. boot
5. recovery
Crossed my fingers and typed "fastboot reboot" and BAM! it booted right to the home screen
P.S. I have a Xperia Z2. I downloaded the Android Source for 4.4.4_r2 but the blobs seem to be for 4.4.2 as of now at least for Z2 so I had some issues regarding sensors. Going to change my branch and compile again. But other than that the ROM was smooth as silk
Don't give up
Click to expand...
Click to collapse

[Utility] Android Image Kitchen &amp;amp; Flasher APK

Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
All credit of unpak/repack tools used in my apk are to @osm0sis
atoxyd said:
Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
Click to expand...
Click to collapse
can I use this on snapdragon 615 stock kernel
Sent from my 6045X using Tapatalk
Yes, you can try
tested on htc desire 816, cm13
unpacks and repacks kernel and ramdisk successfully, but didn't extract or repack the dtbs (device tables image, kernel 3.4) so the repacked image won't boot.
Well I use in my apk AIK.mobile tools proposed by osm0sis.
atoxyd said:
Well I use in my apk AIK.mobile tools proposed by osm0sis.
Click to expand...
Click to collapse
https://github.com/osm0sis/AnyKernel2/ ?
from http://forum.xda-developers.com/showthread.php?t=2670512
bigsupersquid said:
tested on htc desire 816, cm13
unpacks and repacks kernel and ramdisk successfully, but didn't extract or repack the dtbs (device tables image, kernel 3.4) so the repacked image won't boot.
Click to expand...
Click to collapse
Hi, I test it on cm13 and I unpack recovery.img for HTC desire 816, I think it work fine.
If the apk didn't work properly that's means the boot image doesn't not following Google's standard format so you'll need to find other tools to unpack and edit your image.
atoxyd said:
Hi, I test it on cm13 and I unpack recovery.img for HTC desire 816, I think it work fine.
If the apk didn't work properly that's means the boot image doesn't not following Google's standard format so you'll need to find other tools to unpack and edit your image.
Click to expand...
Click to collapse
I can unpack, edit, and repack successfully.
but, it wont boot.
I used official twrp 3.0.0-0 recovery.img and cm13 boot.img both, tried without editing.
just unpack/repack/flash.
boots straight into hboot, which is what happens if I build a boot.img or recovery.img without dtbs.
I pointed to the anykernel2 link because I know its scripting handles dtbs.
the whole kernel device table thing is new to me, and so far only on this device, so I'm not very savvy with dtb work. been lucky enough that it was preconfigured in the build system for cm.
nero curin said:
can I use this on snapdragon 615 stock kernel
Sent from my 6045X using Tapatalk
Click to expand...
Click to collapse
Hi, did my apk work for you?
atoxyd said:
Hi, did my apk work for you?
Click to expand...
Click to collapse
only unpacking and repacking,didnt help on my device but yet again nothing else helps me compile kernel for this idol 3 so i guess this app works just not for me, bad luck :/
Sent from my 6045X using Tapatalk
Well, this is a beta version of my apk, only for testing, I use @osm0sis tools ,this doesn't mean that you have bad luck my friend, this is due to the limitation of @osm0sis tools, but I will find another way to make it universal apk. Okay
atoxyd said:
Well, this is a beta version of my apk, only for testing, I use @osm0sis tools ,this doesn't mean that you have bad luck my friend, this is due to the limitation of @osm0sis tools, but I will find another way to make it universal apk. Okay
Click to expand...
Click to collapse
The scope of my tools is for Google's Android image standard as defined in the bootimg.h header from AOSP/CM. My tool forks have the widest support available for images which are standards compliant, supporting all commonly used ramdisk compression formats.
Supporting Sony's ELF, MTK's labeled and Samsung's headerless image formats along with the standard images (not to mention Samsung's and others' various deviations based on the standard header) and having the script/app differentiate between them would be a very large and difficult undertaking indeed. If that's your plan then I wish you the best of luck in your efforts.
hey, ran more tests.
no issues with the dtb or other functions either.
backup and flash functions working fine too.
here, for your devices.xml
Code:
<!-- Desire 816 a5 (710C) added by bigsupersquid -->
<device>
<model>710C</model>
<kernel>/dev/block/mmcblk0p40</kernel>
<recovery>/dev/block/mmcblk0p41</recovery>
<cache>/dev/block/mmcblk0p42</cache>
</device>
thanks for your work.
eagerly awaiting your open source as well
atoxyd said:
Hi all , I'm new here and I would like to present to you this simple application which backup, edit, repack and flash kernel.img or recovery img with a single click.
This apk need root.
All credit of unpak/repack tools used in my apk are to @osm0sis
Click to expand...
Click to collapse
Thank you for adding the appropriate credit back to your post. Patching, cross-compiling and scripting has taken significant work. :good:
The only other thing that I'd ask is that you do not use the name of Android Image Kitchen or AIK in the title of your app. I'd like to suggest maybe "Image Editor and Flasher" as a snappy alternative?
bigsupersquid said:
hey, ran more tests.
no issues with the dtb or other functions either.
backup and flash functions working fine too.
here, for your devices.xml
Code:
<!-- Desire 816 a5 (710C) added by bigsupersquid -->
<device>
<model>710C</model>
<kernel>/dev/block/mmcblk0p40</kernel>
<recovery>/dev/block/mmcblk0p41</recovery>
<cache>/dev/block/mmcblk0p42</cache>
</device>
thanks for your work.
eagerly awaiting your open source as well
Click to expand...
Click to collapse
Thank you my friend , you are the only one who supported me , and from the beginning.
atoxyd said:
Thank you my friend , you are the only one who supported me , and from the beginning.
Click to expand...
Click to collapse
it's a useful project, definitely worth a little testing and feedback.
besides, i remember what a pain it was getting my xda account eligible for posting the project i was all gung-ho about sharing (optimus v boot from sd card if i remember correctly)
sharing is cool, but a lot of the feedback tends to be annoying when there's no logs or other usable information, just "it's broken" or "can you implement for me on device XYZ."
bigsupersquid said:
I can unpack, edit, and repack successfully.
but, it wont boot.
I used official twrp 3.0.0-0 recovery.img and cm13 boot.img both, tried without editing.
just unpack/repack/flash.
boots straight into hboot, which is what happens if I build a boot.img or recovery.img without dtbs.
I pointed to the anykernel2 link because I know its scripting handles dtbs.
the whole kernel device table thing is new to me, and so far only on this device, so I'm not very savvy with dtb work. been lucky enough that it was preconfigured in the build system for cm.
Click to expand...
Click to collapse
Did you have an unlocked bootloader ?
nothing changed on the device, unlocked and still s-on, I'm not sure what went wrong the first try.
PEBKAC error probably
(problem exists between keyboard and chair)
I release AIK&Flasher v2 , I use @xiaolu unpack/repack tools.
atoxyd said:
I release AIK&Flasher v2 , I use @xiaolu unpack/repack tools.
Click to expand...
Click to collapse
Please use a different name for your app as I have requested.

Categories

Resources