[XPERIA X8 Original Android Development] pilu1978:
ATTENTION!

AT THIS MOMENT THIS IS ONLY A WORK IN PROGRESS PROJECT,

RECOMMENDED FOR DEVS AND TESTERS ONLY!

To the haters/spammers/etc:

The TeamWin Recovery Project is Open Source Project, available for

everyone and I talked with Dees_Troy, and he accept this project.

In the links you can found a modded kernel from alfsamsung, before you

start a permission war: I have permission from alfsamsung too, since 2012 march,

so do not start "do you have permission???" questions.

Some suggestion:

This is a development thread. :)

If you want to say: this project is wonderful or a big piece of sh*t, better if you leave it.

Earlier sgt. meow opened a discussion thread about TWRP, if you can't help in the development,

please go there if you want to write something. :)

I have really few time to work on this project. :(

If you want to help, write your ideas, and write what do you want to do.

For example:

If you want to work with themes, or any part of the code, please inform me.

XDA Developers site is a COMMUNITY :)

Better if we share the tasks, and work more developers on ONE project than everyone working alone. :)

I will try to manage this project, and if the project will be stable, I will send back the code/configuration/etc

changes to the original TeamWin team to help their work.
​

What is it?

This is a modified TeamWin Recovery for the X8 :)

For more information visit the official TeamWin Recovery Project page. :)

http://teamw.in/project/twrp2

Whats working:

Touch control

Install zip updates (some zip files need a newer update-binary)

Backup and Restore (except the android_secure folder)

Built in terminal and filemanager

Mounts

Wipes

USB Mount

Need to fix:

Some UI related changes (a few button/checkbox in wrong place)

Backup/restore of the android_secure folder

All non discovered bugs...

How to build from source:

With CM7:

First step: Prepare the build environment

Download the modded CM7_build from Dees_Troy:

https://github.com/Dees-Troy/TWRP2-CM7_build

and replace your own build/core/Makefile with the one from the downloaded file.

Second step: modify the prelinker map

Search the device specific BoardConfig.mk (or BoardConfigCommon.mk) and check where is your prelinker map. Defined with the TARGET_PRELINKER_MAP variable, for example in the MiniCM7 source the TARGET_PRELINKER_MAP point to /device/semc/msm7x27-common/prelink-linux-arm-x8.map

Merge these binaries:

#libraries for TWRP

libmmcutils.so 0x9C500000 # [<64K]

libbmlutils.so 0x9C400000 # [<64K]

libflashutils.so 0x9C300000 # [<64K]

libmincrypt.so 0x9C200000 # [<64K] #This need only is you use crypto​

WARNING!!! Check the last address in the original file, and recalculate the added binaries address!!!

With CM9/CM10/AOKP:

Waiting for other devs :)

TWRP related settings (merge into the BoardConfig.mk, and you can found these settings in the source too)

#TWRP

BOARD_HAS_NO_REAL_SDCARD := false

DEVICE_RESOLUTION := 320x480

RECOVERY_GRAPHICS_USE_LINELENGTH := true

TARGET_RECOVERY_GUI := true

TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565"

TARGET_USE_CUSTOM_LUN_FILE_PATH :=/sys/devices/platform/usb_mass_storage/lun0/file

TW_CUSTOM_POWER_BUTTON := 107

TW_EXTERNAL_STORAGE_PATH := "/sdcard"

TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard"

TW_FLASH_FROM_STORAGE := true

TW_HAS_DOWNLOAD_MODE := false

TW_HAS_NO_RECOVERY_PARTITION := true

TW_INCLUDE_CRYPTO := false

TW_INCLUDE_JB_CRYPTO := false

TW_NEVER_UNMOUNT_SYSTEM := false

TW_NO_BATT_PERCENT := false

TW_NO_REBOOT_BOOTLOADER := true

TW_NO_USB_STORAGE := false

TW_SDEXT_NO_EXT4 := false​

To build it, you need only:

Replace the files in bootable/recovery with the files from the source :)

. build/envsetup.sh
lunch
make recoveryimage

When the build finished, grab the needed files from:

out/target/product/shakira/recovery/root

While this project is only alpha stage, better if you use it in dual recovery mode (CWM+TWRP)

Here is a sample bootrec file (with this sample the normal methods (key press on kernel logo or use the Reboot to recovery option in the rom) start the CWM recovery, if you touch the screen on kernel logo, the TWRP start.

#!/sbin/sh

# With alfsamsung kernels and stock use these values:
cat /dev/input/event1 > /dev/keycheck&
cat /dev/input/event0 > /dev/tscheck&

[COLOR="Red"]# USE THESE VALUES ON ALL NAA BASED KERNELS :) [COLOR="Blue"]// thanks for feherneoh[/COLOR]
cat /dev/input/event2 > /dev/keycheck&
cat /dev/input/event1 > /dev/tscheck&[/COLOR]

sleep 2
kill -9 $!
if [ -s /dev/keycheck -o -e /cache/recovery/boot ]
then
rm /cache/recovery/boot
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
rm -r /sdcard
rm -r /not/sdcard
mkdir /sdcard
mkdir /tmp
rm /etc
mkdir /etc
cp /recovery.fstab /etc/recovery.fstab
mount /dev/block/mmcblk0p1 /sdcard
/sbin/recovery &
/sbin/adbd recovery
fi

if [ -s /dev/tscheck ]
then
mount -o remount,rw rootfs /
umount -l /system
umount -l /data
umount -l /cache
umount -l /mnt/sdcard
chroot /recovery /init
fi

mkdir /system/lib/modules
ln -s /modules/sdio.ko /system/lib/modules/sdio.ko
ln -s /modules/tiwlan_drv.ko /system/lib/modules/tiwlan_drv.ko
ln -s /modules/tiap_drv.ko /system/lib/modules/tiap_drv.ko

chown u+s /sbin/charger
mount -o remount,noatime,noauto_da_alloc,nodiratime,barrier=0,nobh,ro /dev/block/mtdblock0 /system

/sbin/charger

With this sample you must place the recovery files into /recovery folder of the ramdisk or if you have /recovery partition place it there (don't forget to mount the recovery partition)

If you use the ramdisk own init.rc file to start the recovery (instead of the method with change root to the recovery own folder) you need to modify the init.rc file, add the path of the recovery files to the LD_LIBRARY_PATH variable:

# setup the global environment
export PATH /sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
export LD_LIBRARY_PATH /vendor/lib:/system/lib[COLOR="Red"]:/path_of_the_recovery (usually the /sbin folder)[/COLOR]

Links:

Source: https://github.com/pilu1978/TeamWin_Recovery_X8

Link for the prebuilt binaries (you can try it without compiling):

http://www.mediafire.com/?wxkmwnh1afc7aa1

If you not want to play with this project, just want to try it

here is a modded alfs8a kernel with CWM+TWRP:

http://www.mediafire.com/?7qy1fq3yv4gjra8​