FORUMS
Remove All Ads from XDA

[DEV]How to compile TWRP touch recovery

1,705 posts
Thanks Meter: 13,572
 
Post Reply Email Thread
3rd December 2012, 03:33 PM |#21  
justmpm's Avatar
Retired Senior Moderator
Flag Jumpston Junction
Thanks Meter: 5,308
 
More
We're trying to get twrp ported onto the xperia ray. This guide has been a big help, but it looks like our screen is somehow messed up (the dimensions are supported)...once you are in recovery it looks like an invisible man is constantly tapping the screen making it pretty impossible to use. Some aroma installers behave in a similar way and they can be fixed by putting in a screen calibration....this includes the newer versions of aroma that contain some calibration code from twrp: https://github.com/amarullz/AROMA-In...44d5a6b04ce9c8. I was wondering if you guys knew how to put in a screen calibration into twrp. Thanks a lot....
 
 
3rd December 2012, 05:07 PM |#22  
Senior Member
Thanks Meter: 47
 
More
Quote:
Originally Posted by Dees_Troy

Look for another mtk6577 device that has CM & copy the arch flags from it.

I'am sorry, but I don't understand exactly what you are meaning with this ?
I hope you can explain this a little bit more.
7th December 2012, 08:05 PM |#23  
kokotas's Avatar
Senior Member
Flag Athens
Thanks Meter: 1,560
 
More
Hi Dees_Troy,

First of all thanks for a great project and for sharing its code.

I've compiled the latest version for the HD2 and it looked good. Didn't stay that way for long because I wanted to experiment and I added a couple of things like
option for nilfs2 fs-type formatting, option to add a second EXT partition on sd, option to convert fs-type of a partition and a NativeSD Manager.
I'm still messing/testing it (was thinking of pushing what I've done to a git repo) and I need to ask your help for some things:
  1. Is it possible to have a condition in a slider object?
    I've tried something like this:
    Code:
    <object type="slider">
    	<condition var1="tw_has_sdext2_partition" op="=" var2="1" />
    	<placement x="%slider_x%" y="%row17_text_y%" />
    	<resource base="slider" used="slider-used" touch="slider-touch" />
    	<action function="page">partsdcardaction</action>
    	<actions>
    		<action function="set">tw_back=convertext</action>
    		<action function="set">tw_action=convertext2fs</action>
    		<action function="set">tw_has_action2=0</action>
    		<action function="set">tw_action_text1=Re-formatting 2nd EXT partition...</action>
    		<action function="set">tw_action_text2=This will take a few minutes.</action>
    		<action function="set">tw_complete_text1=Operation Completed</action>
    		<action function="page">action_page</action>
    	</actions>
    </object>
    but the slider is shown regardless of the value of "tw_has_sdext2_partition".
    Note: "tw_has_sdext2_partition" is supposed to be set in Update_System_Details():
    Code:
    else if ((*iter)->Mount_Point == "/sdext2") {
    	int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
    	DataManager::SetValue(TW_BACKUP_SDEXT2_SIZE, backup_display_size);
    	if ((*iter)->Backup_Size == 0) {
    		DataManager::SetValue(TW_HAS_SDEXT2_PARTITION, 0);
    		DataManager::SetValue(TW_BACKUP_SDEXT2_VAR, 0);
    	} else
    		DataManager::SetValue(TW_HAS_SDEXT2_PARTITION, 1);
    }
  2. How do we get existing partitions?
    In many functions I see the loop:
    Code:
    for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
    //...
    }
    but for the love of god I can't see how Partitions is set
  3. I'm sure there was one more question, but I forgot it...lol

Regards!
8th December 2012, 02:23 AM |#24  
whitexp's Avatar
Senior Member
Flag Rio De Janeiro
Thanks Meter: 3,236
 
Donate to Me
More
i have a question:

TWRP support 320x240 ?

thanks !

Gustavo .
8th December 2012, 04:56 AM |#25  
Deadly's Avatar
Senior Member
Flag Bangalore
Thanks Meter: 4,036
 
Donate to Me
More
Quote:
Originally Posted by whitexp

i have a question:

TWRP support 320x240 ?

thanks !

Gustavo .

It has been written in op first post , how to check it yourself.. see a part of op post below and read bolded lines..

Quote:
Originally Posted by Dees_Troy

For all devices you'll need to set a resolution. TWRP needs to know the resolution at compile time so that it knows what stock theme to include. You can only use resolutions that have a theme so if you don't see your resolution, you'll have to pick one that's less than or equal to your resolution. You can find the list of stock themes in bootable/recovery/gui/devices. So if your device has a 540x960 display, you would add this:
DEVICE_RESOLUTION := 540x960

Nothing is True.. Everything is PermittedĀ©
8th December 2012, 10:30 AM |#26  
sgt. meow's Avatar
Senior Member
Flag Dhaka
Thanks Meter: 3,014
 
More
pilu1978 has successfully ported it to the X8. Thanks Dees_Troy and the rest of Team Win. Awesome work.
8th December 2012, 03:14 PM |#27  
antonio8297's Avatar
Senior Member
Flag Camposano (NA)
Thanks Meter: 598
 
More
when give make bootimage give me this error:
Code:
[email protected]:~/android/cm7$ make bootimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.7
TARGET_PRODUCT=cyanogen_gio
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv6-vfp
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
build/core/base_rules.mk:162: *** external/pigz: MODULE.TARGET.RECOVERY_EXECUTABLES.pigz already defined by bootable/recovery/pigz.  Arresto.
10th December 2012, 02:50 PM |#28  
Dees_Troy's Avatar
OP Senior Recognized Developer
Flag KC MO
Thanks Meter: 13,572
 
Donate to Me
More
Quote:
Originally Posted by justmpm

We're trying to get twrp ported onto the xperia ray. This guide has been a big help, but it looks like our screen is somehow messed up (the dimensions are supported)...once you are in recovery it looks like an invisible man is constantly tapping the screen making it pretty impossible to use. Some aroma installers behave in a similar way and they can be fixed by putting in a screen calibration....this includes the newer versions of aroma that contain some calibration code from twrp: https://github.com/amarullz/AROMA-In...44d5a6b04ce9c8. I was wondering if you guys knew how to put in a screen calibration into twrp. Thanks a lot....

No other devices have ever needed calibration. It's also probably safe to assume that your device doesn't need calibration when booted to regular Android? Most likely there is a configuration or firmware file that regular Android uses to achieve proper calibration. If you can find that file and include it in the recovery ramdisk then the problem will likley go away.

Quote:
Originally Posted by gls9

I'am sorry, but I don't understand exactly what you are meaning with this ?
I hope you can explain this a little bit more.

Architecture flags look a lot like this:
Code:
TARGET_GLOBAL_CFLAGS += -mfpu=neon -mfloat-abi=softfp
TARGET_GLOBAL_CPPFLAGS += -mfpu=neon -mfloat-abi=softfp
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_SMP := true
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
ARCH_ARM_HAVE_TLS_REGISTER := true
But the flags vary depending on the CPU & GPU in the device.

Quote:
Originally Posted by kokotas

Hi Dees_Troy,

First of all thanks for a great project and for sharing its code.

I've compiled the latest version for the HD2 and it looked good. Didn't stay that way for long because I wanted to experiment and I added a couple of things like
option for nilfs2 fs-type formatting, option to add a second EXT partition on sd, option to convert fs-type of a partition and a NativeSD Manager.
I'm still messing/testing it (was thinking of pushing what I've done to a git repo) and I need to ask your help for some things:

  1. Is it possible to have a condition in a slider object?
    I've tried something like this:
    Code:
    <object type="slider">
    	<condition var1="tw_has_sdext2_partition" op="=" var2="1" />
    	<placement x="%slider_x%" y="%row17_text_y%" />
    	<resource base="slider" used="slider-used" touch="slider-touch" />
    	<action function="page">partsdcardaction</action>
    	<actions>
    		<action function="set">tw_back=convertext</action>
    		<action function="set">tw_action=convertext2fs</action>
    		<action function="set">tw_has_action2=0</action>
    		<action function="set">tw_action_text1=Re-formatting 2nd EXT partition...</action>
    		<action function="set">tw_action_text2=This will take a few minutes.</action>
    		<action function="set">tw_complete_text1=Operation Completed</action>
    		<action function="page">action_page</action>
    	</actions>
    </object>
    but the slider is shown regardless of the value of "tw_has_sdext2_partition".
    Note: "tw_has_sdext2_partition" is supposed to be set in Update_System_Details():
    Code:
    else if ((*iter)->Mount_Point == "/sdext2") {
    	int backup_display_size = (int)((*iter)->Backup_Size / 1048576LLU);
    	DataManager::SetValue(TW_BACKUP_SDEXT2_SIZE, backup_display_size);
    	if ((*iter)->Backup_Size == 0) {
    		DataManager::SetValue(TW_HAS_SDEXT2_PARTITION, 0);
    		DataManager::SetValue(TW_BACKUP_SDEXT2_VAR, 0);
    	} else
    		DataManager::SetValue(TW_HAS_SDEXT2_PARTITION, 1);
    }
  2. How do we get existing partitions?
    In many functions I see the loop:
    Code:
    for (iter = Partitions.begin(); iter != Partitions.end(); iter++) {
    //...
    }
    but for the love of god I can't see how Partitions is set
  3. I'm sure there was one more question, but I forgot it...lol

Regards!

The slider element doesn't have a conditional capability at this time. For now a button with a conditional that leads to a new page with your slider would probably be the best approach.
Partitions are loaded in partitionmanager.cpp and partitions.cpp during booting of the recovery. Most of the partition loading functions are at the top of these 2 files.

Quote:
Originally Posted by antonio8297

when give make bootimage give me this error:

Code:
[email protected]:~/android/cm7$ make bootimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.3.7
TARGET_PRODUCT=cyanogen_gio
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv6-vfp
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=GINGERBREAD
============================================
build/core/base_rules.mk:162: *** external/pigz: MODULE.TARGET.RECOVERY_EXECUTABLES.pigz already defined by bootable/recovery/pigz.  Arresto.

Remove external/pigz from your build tree. Pigz is included in the TWRP code base.
The Following 6 Users Say Thank You to Dees_Troy For This Useful Post: [ View ]
24th December 2012, 11:36 AM |#29  
kokotas's Avatar
Senior Member
Flag Athens
Thanks Meter: 1,560
 
More
Quote:
Originally Posted by Dees_Troy

The slider element doesn't have a conditional capability at this time. For now a button with a conditional that leads to a new page with your slider would probably be the best approach.

Eventually I edited the slider.cpp and objects.hpp in order to add conditional capability by checking how you've done it for buttons. It works like I wanted now
Quote:
Originally Posted by Dees_Troy

Partitions are loaded in partitionmanager.cpp and partitions.cpp during booting of the recovery. Most of the partition loading functions are at the top of these 2 files.

Ok, got that too! The more I read the code the more I get familiar with it.

Wanted also to thank you for your work! I think the HD2 has another great tool added to its assets thanks to your open project.
(Here is the thread for hd2's twrp version)

Merry Christmas
Regards!
3rd January 2013, 10:42 PM |#30  
M66B's Avatar
Recognized Developer
Thanks Meter: 36,966
 
More
I have successfully built twrp for SE Xperia Pro (iyokan), only I have a segmentation fault in recovery:

Code:
~ # ps
...
  144 root       240 S    /sbin/ueventd
  146 root      4344 S    /sbin/adbd recovery
  151 root       756 S    /sbin/sh -
  157 root       748 R    ps
~ # /sbin/recovery
Segmentation fault
What could be the cause for this and how can I debug this?

This is what I did to compile twrp for CM10:

I patched twrp like this:

http://www.faircode.eu/freexperia/patches/twrp.patch

See here what else I did:

http://www.faircode.eu/freexperia/patches/update.sh

Look for 'twrp', because the script does a lot more.
4th January 2013, 10:04 AM |#31  
M66B's Avatar
Recognized Developer
Thanks Meter: 36,966
 
More
I found the twrp log file at /tmp/recovery.log and it says:

Code:
Starting TWRP 2.3.3.0 on Fri Jan  4 08:43:03 2013
I:=> hardware id from cpuinfo: 'mogami'
I:=> serial from cpuinfo: '0000000000000000'
I:Single storage only.
I:No internal storage defined.
I:No storage defined, defaulting to /sdcard.
Starting the UI...Pixel format: 480x854 @ 32bpp
Pixel format: BGRA_8888
failed to put fb0 info: Invalid argument
Unable to get framebuffer.
: Invalid argument
So the problem seems to be the frame buffer device.

---------- Post added at 10:35 AM ---------- Previous post was at 09:45 AM ----------

Changing the pixel format to RGB_565 fixed the problem.
And I have to say TWRP looks really nice!

---------- Post added at 11:04 AM ---------- Previous post was at 10:35 AM ----------

Backup does not work:

Code:
I:Calculating backup details...
E:Unable to locate boot partition.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes