yashsingh1/xdaforums huggingface dataset:
[Sony Cross-Device General] championswimmer:
the source is present on http://github.com/KangXperiaProject

also check the latest merged commits on http://smartdev.com.pl:8080

building with KXP_INCLUDE_TWRP := true will give you same product as I have provided here.

the kernel is built off already present sources on KXP github, so there is no GPL violation

and yes I will update the flags on BoardConfigs on all the devices after I make KXP Milestone1-R2 releases, I will sync all local changes.

but again to reiterate, to duplicate the kernel I have posted, stuff is already present on github to do so.
[Sony Cross-Device General] championswimmer:
just give me a day or two please :)

and I'll PM you when it's done. (I will update all 15 Xperia devices with the flags needed :) )
[Sony Cross-Device General] dtekkt:
Could anyone post a flashable zip please? don't have a PC right now
[Sony Cross-Device General] jerdog:
Update your first post with links to the sources, along with any specific flags. And, to be GPL compliant, you do need to provide all aspects of the build in order that anyone could come in and build from your sources. The best way to do that is to link to the exact source for the specific project (not just the overall github) and to provide the instructions and flags, etc. used in building that specific project in like the README like linux and other GPL-compliant projects do
[Sony Cross-Device General] schaggo:
Although getting GPL compliant is important and totally supportable, I'd still like to leave a big, fat, spelled out THANK YOU for tinkering with TWRP on the xperias. Big thing, big win :thumbup:
[Sony Cross-Device General] CosmicDan:
Nice thread, well done champ.

If any users are interested in my TWRP build/changes you can see my fork here: https://github.com/cosmicdan/Team-Win-Recovery-Project/commits/jb-wip

Here are the flags I use for Xperia Play BTW:

# TWRP
DEVICE_RESOLUTION := 480x854
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565"
TW_FLASH_FROM_STORAGE := true
[Sony Cross-Device General] XDM inc:
pictures please? i think this is the recovery have looking for
[Sony Cross-Device General] olokos:
FFS click
[Sony Cross-Device General] schaggo:
lol, totally was my plan as well.
[Sony Cross-Device General] XDM inc:
lol thanks, that was the recovery i was looking for, but it is now compatible with ICS so i had to go back. looks goo though and easy
[Sony Cross-Device General] CosmicDan:
Not stock ICS no, maybe wedgess will one day. But Turbo Kernel works on CM9/AOKP.

Sent from Xperia Play (R800a) with Tapatalk
[Sony Cross-Device General] sj8023ld:
I have done on my xperia tx :D Thank you all the same
[Sony Cross-Device General] leon22heart:
Lets hope that will see it inserted in stock kernels too alongside with the cwm recovery . It would be awesome to have 2 recoveries in one kernel.
[Sony Cross-Device General] Jeik:
how to enter this recovery? xperia mini-smultron
[Sony Cross-Device General] championswimmer:
vol down when led is pink :)
[Sony Cross-Device General] Jeik:
it dont work

i tried

AOKP r2 and this kernel,before i installed AOKP,it opened TWRP,but after i installed AOKP,wont open twrp

EDIT:solved-recovery manager,boot in recovery
[Sony Cross-Device General] optik19918:
Thanks! I will test it soon as i get home!

Dose it supports usb otg?
[Sony Cross-Device General] hassi4042:
Thanks Dude :good::good::good::good::good:
[Sony Cross-Device General] justmpm:
Thanks a lot for this ChampionSwimmer. This will be an especially big benefit to the 2011 devices where there were a lot of problems compiling TWRP and integrating it into the ramdisk. It is really nice to have a compilable version!

The build for the Ray is working and szl.kiev has already released a TWRP'd version for the PACman ROM. The TWRP bugs are the same as the version you helped Thomas1991_12 create: no boot into recovery, no mounting the SDcard via USB. Not complaining!

Thanks again and great work (x17)!
[Sony Cross-Device General] CosmicDan:
I have a tech Q for you champ,

For some reason when I append /sbin to the library export in ramdisk, twrp does not load and cannot find the libraries. To get around it I had to move the static objects to /system/lib/ on the rootfs/ramdisk. But I've had to implement work-arounds for when the reaal system is mounted due to one lib missing.

Do you know why I can't get it to pick up /sbin as a library path, even though I've tried all types of export lines? Maybe I need to edit sourcecode for linker?
[Sony Cross-Device General] championswimmer:
could you send me a copy of your ramdisk so i take a look ?

maybe the order the init scripts are imported is wrong or something ?

and are you using a split ramdisk or the older method where both recovery and rom's ramdisk were baked together ?
[Sony Cross-Device General] championswimmer:
no boot into recovery is a problem the AOKP kernel faces with CWM too afaik, and since only 2011 devices face it I cannot help out there (the 2012 devices used to face it too and i had corrected it a few released back)

also can you have a look at your boot.txt file in root and tell me if it says anywhere "cache not mounted" or something ?

about USB, does the FXP kernel with CWM have usb mounting ?
[Sony Cross-Device General] CosmicDan:
I'm on an Xperia 2011 device, so the Ramdisk contains Recovery.

The RAMDisk for the kernel is here: https://github.com/cosmicdan/Xperia-2011-Kernel-2.6.32.9-KRsH/tree/jellybean/ramdisk

The full boot.img with "built" RAMDisk is Turbo Kernel, it's in my sig.

If you get the chance to take a look, thanks heaps :)
[Sony Cross-Device General] championswimmer:
you can split the ramdisk on a 2011 device too

in fact in jellybean it is split.

i ported the patch from 2012 first for AOKP and now even FXP's CM10 builds have a split ramdisk

it's cleaner to work with for porting other recoveries ;)
[Sony Cross-Device General] CosmicDan:
Interesting.... I'll check it out. Do you think this might help my LD_LIBRARY_PATH problem?

It's really strange, because I ported TWRP a few months ago and that was working fine with the libs in /sbin/ - but that was a stock ICS kernel. And we didn't have the align_buffer interface fix then so I never released it :P

Anyway I'll take a look at this ramdisk change as it does sound interesting, thanks for the tip.

EDIT: Could you point me to a repo where I might find this? I had a look at android_build on cm10.1 branch and couldn't see anything =\

EDIT2: OK, I can see some "2 stage boot" commits in these repo's:

https://github.com/KangXperiaProject/android_device_semc_zeus-common/commits/jb

https://github.com/KangXperiaProject/android_device_semc_msm7x30-common/commits/jb

https://github.com/KangXperiaProject/android_device_semc_zeus/commits/jb

But I'm not sure if I'm missing anything. I keep kernel and ramdisk compile separate from my ROM's so I'kk have to figure out how to do it via my existing scripts.

EDIT3: OK I figured it out, just used unpackbootimg on your image here. Thanks for the great work, this is awesome :) I will try out your TWRP on zeus and report suggestions/fixes if I find any. I had no idea you can use an sh script instead of init binary... this has a lot of potential to make my Multiboot kernel more robust :D (P.S. Let me know if you want any help on porting multiboot to others devices)
[Sony Cross-Device General] justmpm:
CWM from FXP201 kernel mounts USB no problem.

Text from boot.txt after rebooting from KXP kernel:

I also attached the recovery log from twrp which I think indicates an error with mounting the sdcard. When I was trying to get twrp to work, I seem to remember that twrp uses some work around for mounting the sdcard: http://teamw.in/DataMedia

Thanks!
[Sony Cross-Device General] Dees_Troy:
I was recently loaned an Xperia S. This is the first time that I have had a Sony phone in my hands (they aren't very common in the USA.) I have experimented with formatting the FOTAKernel / recovery partition that's not usable on unlocked Xperias to ext4. I modified the init.sh script to try to mount the formatted partition & copy a ramdisk-recovery.cpio file from the partition to the ramdisk & replace the existing recovery ramdisk. Using this kind of setup a developer only has to make a few small changes to the ramdisk to allow users to be able to boot a different recovery than what is in the boot image. This also separates the recovery from the boot image (though you still have to a working boot image).

I am also talking to a few people at Sony about why they disabled the recovery partition & seeing if we can get them to enable it on unlocked devices.
[Sony Cross-Device General] championswimmer:
i understand that, i myself was also dissapointed on knowing the s1boot locks off the fotakernel on unlocked phones

my understanding of the issue is this

you might have heard or read about it that a Sony (Ericsson) official FOTA upgrade on an unlocked bootloader often used to cause a brick on 2011 devices. to make sure FOTA upgrade is not performed on an unlocked device at all, I guess they locked off the fotakernel partition for unlocked phones.

but in any case, having a separate recovery partition (which in fact there is, albeit locked off) would have been really awesome.

also I understand what you are talking of, which i presume is somewhat like fakeflashing from the system partiton, here you are fakeflashing it from the fota partition ?

(on a lighter note, I also see a limitation on hardware key combinations. my Xperia V has only 3 keys. Power and the +/- vol keys. power+volup is fastboot and power+voldown is flashmode, which is like Samsung's download mode. Now if there was a separate recovery kernel, and if there were a method to boot it straight from the bootloader without booting the normal kernel, what key am I supposed to press :D )
[Sony Cross-Device General] Hardtron:
I do not know what I'm doing wrong. I'm trying a second time, but I can not do backups with TWRP. This time I'm using updated.

On the Backup option, I mark the options: System, Data, sd-ext, Cache. Also marked "Enable Compression".

When you start the backup immediately get the message "Failed" .... E: Unable to locate boot partition.

Help please!!!

---------- Post added at 04:58 PM ---------- Previous post was at 04:50 PM ----------

@championswimmer

Where is the "tick" from boot?
[Sony Cross-Device General] championswimmer:
I'll check on this. Seems its trying to access boot partition when none exists on the play. Thanks to report
[Sony Cross-Device General] funiewski:
@champ pls help a total noob

i´m stuck in trying to port twrp to stock kernel for xperiaV

i have working stock kernel with cwm recovery

my steps:

decompile your twrboot.img for V with your kernel kitchen (installed cygwin onmy win7 pc)

decompile stock. img with kitchen

replace kernel zimage in kernel-contents folder of twrp.img with kernel zimage from stock kernels contents folder

replace ramdisk.cpio in ramdisk-contents folder of twrp.img with ramdisk.cpio from stock kernels ramdisk-contents folder

copy all files and folders inside kernel-contents folder of twrp.img with changes to input folder

created new kernel.elf with kitchen first option 3 than 2

flash the new kernel.elf with fastboot

device boots up, aokp logo is brown instead of blue, pink led, i can reach twrp recovery, than V´s boot animation for a long time than device reboots

?

edit: can not get dmesg, device not found
[Sony Cross-Device General] CosmicDan:
I had no checkbox for Boot on my build. I had to manually remove the code to check/backup boot partition. I should add a parameter for it and then we can do a "No Boot Partition" flag in BoardConfig, and submit pull request to TWRP.

EDIT: Here's the commit champ: https://github.com/cosmicdan/Team-W...mmit/2e7b530501e3db8ff15191a3304ca79179c45476
[Sony Cross-Device General] wzhy:
i use AOKP source and replace recovery to TWRP

but i make bootimage ,the kernel cant go into recovery

i see the recocerys ramdisk has no *.so and come bin files

how can i completed the TWRP recovery with source?

my TWRP source was got here:https://github.com/TeamWin/Team-Win-Recovery-Project
[Sony Cross-Device General] CosmicDan:
I missed this comment:

If we unlocked via testpoint would it be the same? I.e. the bootloader does it? I wonder if we can still map it. Take a look at my knowledge on Xperia 2011 partition layout (as taken from my thread here):

{zeus/phoenix, stock map}

reserved | boot | /system | /data | appslog | /cache |
first 80MB | 12.5MB | 312.5MB | 380MB | 133.5MB | 101.5MB |

Note: Not to scale :)

Obviously if we have it, it'd be in the first 80MB. But I find it very strange that we have 80MB there, considering this:

{zeus/phoenix, from FTF}

adsp.sin ~5.16MB
amss.sin ~20.60MB
amss_fs.sin ~0.10MB
fota0.sin ~1.43MB
fota1.sin ~1.43MB
------------------
total ~28.72MB

So wtf is the other 50MB for?

Slightly off topic I know, sorry about that.... but I've never had anyone else to talk to about this.

(On topic)

Regarding the failed "boot" backup, I actually have added mtdblock for boot partition in my kernel (via mtdparts cmdline) and still got the error in TWRP, I found that strange. I assume it gets the partition info from ATAG instead of /proc/mtd...?

{zeus/phoenix, custom partitions}

~ # cat /proc/mtd
cat /proc/mtd
dev: size erasesize name
mtd0: 13600000 00020000 "system"
mtd1: 26180000 00020000 "userdata"
mtd2: 00800000 00020000 "cache"
mtd3: 00c80000 00020000 "boot"
[Sony Cross-Device General] thunder888:
I use your twrp 2.3 kernel on my neo with pac jb 4.1.2 rom, but can't turn wifi on. Can you make some wifi module? Thanks before.
[Sony Cross-Device General] wzhy:
replace the zImage with your ROM in this post kernel

can use kernel kitchen to do this
[Sony Cross-Device General] championswimmer:
for the 2012 devices we actually have a "fotakernel.sin" file apart from the normal "kernel.sin" file in stock FTF's :D

thanks for the patch. I will push it up to TeamWin gerrit (or if you can do it before me, I'll love it ;) )

once the patch is in place, I will fix the Board flags accordingly :)
[Sony Cross-Device General] CosmicDan:
Ahh ok.

Well I've never used gerrit... I have not done the flag one either. I'm still trying to get two-stage ramdisk working.

I want to get adbd working on the first-stage so I can debug why my custom ramdisks/menu wont load properly, but I always get "device offline" error when I try to connect. Any ideas? I added this code to init.sh:

# setup abdb
busybox echo 0 > /sys/class/android_usb/android0/enable
busybox echo 0FCE > /sys/class/android_usb/android0/idVendor
busybox echo 615D > /sys/class/android_usb/android0/idProduct
busybox echo "adb" > /sys/class/android_usb/android0/functions
busybox echo 1 > /sys/class/android_usb/android0/enable
/sbin/adbd&

I added a known-working adbd binary and symlink /system/sh to /sbin/busybox, but I still get the "device offline" message no matter what I try. Any ideas? It's been bugging me for the past day trying to work around it but now I absolutely need it to debug any more :(

EDIT: And yes I added it further down init.sh after the sysfs mount. I am thinking I am missing some device node or something?

EDIT2: Well it seems adb is also broken in the TWRP ramdisk. So I will try to fix it there.
[Sony Cross-Device General] CosmicDan:
OK this is how I fixed adb in Xperia 2011 TWRP ramdisk:

--- init.rc Tue Jan 20 09:26:08 1970
+++ init.rc Tue Jan 20 09:26:08 1970
@@ -1,3 +1,6 @@
+
+import /init.semc.usb.rc
+
on early-init
start ueventd

@@ -26,10 +29,11 @@
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 0fce
write /sys/class/android_usb/android0/idProduct 615d
- write /sys/class/android_usb/android0/functions adb
+ write /sys/class/android_usb/android0/functions mass_storage,adb
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
write /sys/class/android_usb/android0/iSerial ${ro.serialno}
+ write /sys/class/android_usb/android0/enable 1

on boot
@@ -47,13 +51,18 @@

service recovery /sbin/recovery

+service console /sbin/busybox sh
+ console
+ disabled
+
service adbd /sbin/adbd recovery
disabled

# Always start adbd on userdebug and eng builds
on property:ro.debuggable=1
#write /sys/class/android_usb/android0/enable 1
- #start adbd
+ start adbd
+ start console
setprop service.adb.root 1

# Restart adbd so it can run as root
[Sony Cross-Device General] DooMLoRD:
i am working on my own recovery... once thats ready i can merge other recoveries into a common ramdisk and give users access to multiple recoveries through a menu... i had done something similar for the X10, ARC, etc...

the 2012 ramdisk is different... and the idProduct code is slightly different...

P.S.: if adbd is not given shell use a different adbd in the ramdisk...
[Sony Cross-Device General] adulfo:
Hey champ thanks for this.

As I am creating a back-up of my ROM, I observed that it did not back-up "android_secure".

I restored it with no problems, the system and data although some APPs/games (moved to sdcard) are not being displayed on my APP TRAY after restoring. I know that the apps are still present because as I install it again (both apps and games), it ask me to "Replace the app".

Thanks.
[Sony Cross-Device General] CosmicDan:
That'll be interesting to see :)

OK it's really strange, I've also had to symlink /system/bin/sh to /sbin/busybox sh to get it to work so I'll try that. Also, Aroma Installer touchscreen is very 'glitchy' in this TWRP recovery image (when trying to drag/scroll) and I'm not sure why but I'll keep digging.

Anybody else encounter issues with Aroma Installer ZIP's in this?

EDIT: OK, it's an issue with Aroma 2.56, nevermind. I will need to update the input code for it or just use older Aroma.
[Sony Cross-Device General] justmpm:
Some people are reporting that they can't make back ups using the twrp in the kxp kernel. This is also true of the twrp in the pacman kernel for the Ray, but not from thomas1991_12's twrp in flykernel. I think the problem is in the file structure on sdcard. Your twrp will back up into and restore from the TWRP folder built by flykernel, but not into the TWRP folder built by the kxp kernel. It looks to me like the folder names and permissions are the same, so I am not sure what the problem is. If you need to see something, just let me know and I will try and post it for you.
[Sony Cross-Device General] CosmicDan:
There's no such things as "permissions" on the SDCard, it's vfat.

We'd need to see /tmp/recovery.log to find out what the error is (if TWRP is not reporting an error).
[Sony Cross-Device General] justmpm:
Here are 2 logs, one from the working /sdcard/TWRP and one from the bad one. Both logs were made using the same kernel and rom (both latest kxp AOKP for the Ray). The only difference is the /sdcard/TWRP directory. I renamed the recovery.log to differentiate them and to get xda to take them.

Thanks alot....off to read up on file permissions :laugh:
[Sony Cross-Device General] CosmicDan:
This is the same problem as before. A Log wasn't needed if you had said that it says "Unable to locate boot partition", it clearly says that in the backup text :P

Champ needs to apply this patch then set board flag:

TW_PARTITION_NOBOOT := true

It just doesn't need file permissions on the SDCard because it's not a Linux filesystem. Recovery has 100% access to the entire SDCard, and it can't create symlinks, change owners, execute binaries, etc. from SDCard because those require an ext#/yaffs2/other linux attribute filesystem.
[Sony Cross-Device General] justmpm:
Thanks a lot and sorry for reporting something that was already fixed. But I still think that there is something else going on because it is possible to get a back up with out your patch or recompiling twrp. Wechy77 was able to trace down the problem to /sdcard/TWRP/.twrps Changing "tw_backup_boot  1" to "tw_backup_boot  0" fixes the "Unable to locate boot partition" error...at least for us.
[Sony Cross-Device General] Wechy77:
I think boot backup is only possible for 2012 Xperias, so this little change is good maybe for the whole 2011 line, who has the same problem.
[Sony Cross-Device General] CosmicDan:
Yeah changing that 1 to a 0 is just as good. But still you would have to do that everytime because its default setting for TWRP, but my patch allows us to set boot backup disabled on a per-device basis. If champ does this then he can add it to all Xperia 2011 boardconfigs.

Sent from Xperia Play (R800a) with Tapatalk
[Sony Cross-Device General] championswimmer:
ok i know i am lagging behind on time and i have no idea what has happened on xda for last 3-4 days :p

was busy learning to make Android apps 'coz I am responsible for the Android App of our College's Fest. :cowboy:

will catch up on TWRP/KXP in 2-3 days...

till then

so long :)
[Sony Cross-Device General] arch_saiful:
i have changed my board_config.mkto this:

-include device/semc/mogami-common/BoardConfigCommon.mk

-include vendor/semc/haida/BoardConfigVendor.mk

TARGET_KERNEL_SOURCE := kernel/semc/msm7x30

TARGET_KERNEL_CONFIG := pac_haida_defconfig

#TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-eabi-4.4.3

TARGET_KERNEL_CUSTOM_TOOLCHAIN := arm-gnueabihf-linaro-4.7

TARGET_RECOVERY_INITRC := device/semc/haida/recovery/init.rc

SENSORS_COMPASS_AK8975 := true

SENSORS_ACCEL_BMA150_INPUT := true

SENSORS_ACCEL_BMA250_INPUT := false

SENSORS_PROXIMITY_APDS9700 := true

SENSORS_PRESSURE_BMP180 := false

#TWRP flags

DEVICE_RESOLUTION := 480x854

RECOVERY_GRAPHICS_USE_LINELENGTH := true

TW_HAS_NO_RECOVERY_PARTITION := true

TW_FLASH_FROM_STORAGE := true

TW_INTERNAL_STORAGE_PATH := "/sdcard"

TW_INTERNAL_STORAGE_MOUNT_POINT := "sdcard"

TW_EXTERNAL_STORAGE_PATH := "/external_sd"

TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"

TARGET_OTA_ASSERT_DEVICE := MT11i,MT11a,haida

and init.rc to this:

on early-init

start ueventd

on init

export PATH /sbin

export LD_LIBRARY_PATH .:/sbin

export ANDROID_ROOT /system

export ANDROID_DATA /data

export EXTERNAL_STORAGE /sdcard

symlink /system/etc /etc

mkdir /boot

mkdir /sdcard

mkdir /sd-ext

mkdir /datadata

mkdir /emmc

mkdir /system

mkdir /data

mkdir /cache

mount /tmp /tmp tmpfs

chown root shell /tmp

chmod 0775 /tmp

write /sys/class/android_usb/android0/enable 0

write /sys/class/android_usb/android0/idVendor 0fce

write /sys/class/android_usb/android0/idProduct 6156

write /sys/class/android_usb/android0/functions mass_storage,adb

write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}

write /sys/class/android_usb/android0/iProduct ${ro.product.model}

write /sys/class/android_usb/android0/iSerial ${ro.serialno}

on boot

ifup lo

hostname localhost

domainname localdomain

class_start default

on post-fs

mount vfat /dev/block/mmcblk0p1 /sdcard

service ueventd /sbin/ueventd

critical

service recovery /sbin/recovery

service adbd /sbin/adbd recovery

disabled

# Always start adbd on userdebug and eng builds

on property:ro.debuggable=1

#write /sys/class/android_usb/android0/enable 1

#start adbd

setprop service.adb.root 1

# Restart adbd so it can run as root

on property:service.adb.root=1

write /sys/class/android_usb/android0/enable 0

restart adbd

write /sys/class/android_usb/android0/enable 1

is it okay

help me please...........

its for P.A.C kernel for Haida(NEO V MT11i)

some one help me
[Sony Cross-Device General] cartmenicus:
Sorry if this is noboish? But is it possible to port to loced bootloader? metioned in op says port to stock ics would it work if you unpack twrp parts and instead of a cwm installer it instlakks twrp???:cowboy:
[Sony Cross-Device General] CosmicDan:
No. Locked bootloader can only use official kernels.

Sent from Xperia Play (R800a) with Tapatalk
[Sony Cross-Device General] championswimmer:
With fake flash technically yes
[Sony Cross-Device General] cartmenicus:
Fake flash?:confused:
[Sony Cross-Device General] CosmicDan:
Locked bootloader can't flash boot.img though. And you can't flash unsigned kernel.sin. Never heard of this fake flash.

Sent from Xperia Play (R800a) with Tapatalk