yashsingh1/xdaforums huggingface dataset:
[Android Software Development] M66B:
I have successfully built twrp for SE Xperia Pro (iyokan), only I have a segmentation fault in recovery:

~ # 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.
[Android Software Development] M66B:
I found the twrp log file at /tmp/recovery.log and it says:

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:

I:Calculating backup details...
E:Unable to locate boot partition.
[Android Software Development] Dees_Troy:
Can you paste a full copy of a log after a failed backup to a paste website and post the resulting link for me please?
[Android Software Development] M66B:
This is the relevant part:

E:TOUCH_RELEASE: 465,696
I:Set page: 'backup_run'
Updating partition details...
I:Unable to mount '/sd-ext'
I:Actual block device: '', current file system: 'auto'
I:Backup Name is: '2013-01-04--04-16-39'
I:Full_Backup_Path is: '/sdcard/TWRP/BACKUPS/0000000000000000/2013-01-04--04-16-39/'

[BACKUP STARTED]
* Backup Folder: /sdcard/TWRP/BACKUPS/0000000000000000/2013-01-04--04-16-39/
I:Calculating backup details...
E:Unable to locate boot partition.
I:Set page: 'action_complete'

Thanks for your attention!

Edit: maybe I have to set TW_HAS_NO_RECOVERY_PARTITION

And a question: what is TW_HAS_DOWNLOAD_MODE ?

Edit #2: /boot is present, but empty:

~ # ls -al boot
drwxr-xr-x 2 root root 0 Jan 4 09:55 .
drwxr-xr-x 19 root root 0 Jan 4 09:55 ..

Edit #3: the full log is here: http://pastebin.com/GG9nuzeB

Edit #4: I guess this problem is caused by init.rc:

mkdir /boot

Edit #5: I did this quick fix:

diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 536e867..29a9ac3 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1504,6 +1504,7 @@ void TWPartitionManager::Update_System_Details(void) {
#endif
}
}
+	DataManager::SetValue(TW_BACKUP_BOOT_VAR, 0);
DataManager::SetValue(TW_BACKUP_DATA_SIZE, data_size);
string current_storage_path = DataManager::GetCurrentStoragePath();
TWPartition* FreeStorage = Find_Partition_By_Path(current_storage_path);

But now I have another problem:

[BACKUP STARTED]
* Backup Folder: /sdcard/TWRP/BACKUPS/0000000000000000/2013-01-04--07-26-39/
I:Calculating backup details...
* Total number of partitions to back up: 1
* Total size of all data: 64MB
* Available space: 2095MB
I:Estimated Total time: 22 Estimated remaining time: 22
Backing up Cache...
I:Backup command: 'cd /cache && tar -c -f '/sdcard/TWRP/BACKUPS/0000000000000000/2013-01-04--07-26-39//cache.yaffs2.win' ./*'
: applet not found
E:Backup file size for '/sdcard/TWRP/BACKUPS/0000000000000000/2013-01-04--07-26-39//cache.yaffs2.win' is 0 bytes.
I:Set page: 'action_complete'

Executing the backup command on the command line works.

All patches so far:

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

Last edit: the patches have been updated and everything works now!
[Android Software Development] Dees_Troy:
The "@ 32bpp" seems to indicate that you should be using RGBX_8888 or BGRA_8888 for TARGET_RECOVERY_PIXEL_FORMAT.

Also are you compiling in a CM repo? I've seen the "- exec '/system/bin/sh' failed: No such file or directory (2) -" error recently from another user that was not using a CM tree. Switching to a CM tree fixed that problem.
[Android Software Development] Kapricornus:
Thank you very much!!!

It is working!

I've used RGBX_8888

BTW strange that Gio and Ace have different Pixel formats.
[Android Software Development] varun.chitre15:
Compiled TWRP for my device and it boots but touch isn't working

Here is the log

http://pastebin.com/aLmdLqAP

It is having some errors with the touch events. Can you pls let me know what should be done?
[Android Software Development] awidawad:
I am trying to compile TWRP for the Kindle Fire with FFFExtended bootloader (dual booted) I successfully added in all four extra partitions but accidently removed the primary system partition. Now, after I add it back in I get errors.

I modified the partitions.cpp and partitionmanager.cpp to include extra options for 4 more partitions (system2, cache2, data2, and boot2). I am getting what seems to be a simple error but I just can't fix it for the life of me. Can anyone help me?

Here are my errors:

target thumb C++: recovery <= bootable/recovery/partition.cpp
bootable/recovery/partition.cpp: In member function 'bool TWPartition::Process_Fstab_Line(std::string, bool)':
bootable/recovery/partition.cpp:323:2: error: a function-definition is not allowed here before '{' token
bootable/recovery/partition.cpp:1551:1: error: expected '}' at end of input
make: *** [/home/austin/jb-otter/out/target/product/otter/obj/EXECUTABLES/recovery_intermediates/partition.o] Error 1
make: *** Waiting for unfinished jobs....
[Android Software Development] sks976:
Hello! I have a problem with the colors in TWRP.

In boardconfig.mk - TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888

But in log -

Starting the UI...Pixel format: 720x1280 @ 32bpp

Pixel format: BGR_565

WTF? 0_o
[Android Software Development] Dees_Troy:
You need quotes around it as is documented in the guide.
[Android Software Development] modifhigher:
Im trying to port TWRP to my device.its rooted,ive dumped stock recovery & fstab.however,i have no access to a build environment.can anyone compile it for me?the cwm online builder doesnt work either.

Heres a link to my OP & my dropbox folder with the two files .

http://xdaforums.com/showthread.php?p=53936699

Device is a Kyocera Hydro icon.

Hydro ICON™

Stock Rooted
[Android Software Development] Android-Andi:
https://romfoundry.com/

Kinda' nifty. *They'll give you a "free build" or it looks like $10 for 5 builds...

Gesendet von meinem GT-I8190 mit Tapatalk
[Android Software Development] S-trace:
There is typo in first post:

userrmrf -- overrides the normal format type of wiping and only allows the partition to be wiped using the rm -rf command
^^

It must be usermrf (use rm -rf), not userrmrf (user rm -rf) according to source code grep.

Take initramfs.cpio.gz, unpack it, edit (if neccesary) /etc/twrp.fstab, replace theme for target display resolution (if differs), recreate initramfs.cpio.gz, create boot image (uImage or ANDROID!, depends on which image have target device) and try to boot it, look into TWRP log, dmesg and any other logs (for example, serial console), and fix errors.

I tried to port TWRP such way from Amlogic 8726-MX tablet to Amlogic 8726-M based Android Smart TV board and it have successfully booted with unmodified tablet initramfs.cpio.gz for first try.
[Android Software Development] S-trace:
720P and 1080P themes

Why doesn't TWRP include 1280x720 and 1920x1080 landscape themes?

I have ported default theme for this resolutions:
[Android Software Development] DoxMAZz:
Can you please explain in detail that which file from which recovery and where tho replace.

Thank you
[Android Software Development] yuweng:
i believe it'll will be the exact same advice from Dees_Troy that is to refer to here . . . :laugh: An example here . . .

Spoke to Dees_Troy recently at #twrp on Freenode, normally you'll catch him there at KC MO time 9am onwards if you need further advice . . . :good:
[Android Software Development] desalesouche:
i finally fixed all bug i had with twrp2.7.1.0 a big thanks to Dees_Troy and all the community who helped...:D
[Android Software Development] arvinquilao:
Thank to this thread, I have managed to compile a working recovery.img for Micromax A121 (msm8610 board). However, I can only run it via "fastboot boot recovery.img". I cannot flash the recovery because the device's recovery partition is only 10.5mb, and the resulting twrp recovery is 10.7mb. It's unusually large, the kernel alone is 6mb.

I already used this build flag: BOARD_HAS_NO_REAL_SDCARD := true. I also resized the images in the res folder to gain some space then repacked the recovery, but fastboot still throws the "file size too large" error. I'm thinking of compressing the kernel but I cannot find the defconfig file in my source folder. Are there files that I can safely exclude from the build so that the recovery size will fit the partition?
[Android Software Development] MasterAwesome:
Add the -Os flag to the makefile of the kernel source. That should reduce the size.. If that's not enough, compress kernel using lzma. To add -Os flag, in menu configuration enable optimize for size.

Good luck.

Regards

MasterAwesome
[Android Software Development] arvinquilao:
Thanks, I will try that when I recompile. My temporary solution was to repack the img file using lzma compression, file size was reduced to 9.7mb.

On another note, I found out that the build I made, version 2.7.1.0, still has the screen timeout bug (bootloop/freezing after waking up from timeout) - I just disabled it and TWRP is now running smoothly. No other issues encountered so far.

Update: This git commit fixed the screen timeout issue. TWRP is now working perfectly.
[Android Software Development] ohmpsy:
Helo devs. I sucess build twrp 2.6.3.0 and 2.7.1.0 for my device with selinux suport. The 2.7.1.0 on log have selinux enable. The version 2.6.3.0 have this

Switching packages (TWRP)

No file contexts for SELinux

The version 2.7.1.0 any operation like format, wipe, restore with /data returns to home of twrp. The 2.6.3.0 working fine. Any solution? Thank
[Android Software Development] gimmeitorilltell:
This sound like a device issue with the Mount points. Have you created a twrp.fstab?
[Android Software Development] ohmpsy:
Yes. On 2.6.3.0 twrp work fine
[Android Software Development] gimmeitorilltell:
The Mount system has changed since 2.6.3.0. You may need to look into getting rid of the twrp.fstab or at least work on it.
[Android Software Development] ohmpsy:
Thank. I look here.
[Android Software Development] ohmpsy:
I use same twrp.fstab on 2 versions. On 2.6.3.0 the data operations work
[Android Software Development] bloommax:
No BoardConfig.mk available...how to start?

I have an Acube U65GT tablet which does not have a CM build and I cannot find a BoardConfig.mk. What should I do? Which is the first file I should create?
[Android Software Development] S-trace:
I'm think, You are have to set up Your device's CPU and CFLAGS:

TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_SMP := true
TARGET_ARCH_VARIANT := armv7-a-neon
ARCH_ARM_HAVE_VFP := true
TARGET_ARCH := arm
TARGET_ARCH_VARIANT_CPU := cortex-a9
TARGET_ARCH_VARIANT_FPU := neon
ARCH_ARM_HAVE_NEON := true
ARCH_ARM_HAVE_TLS_REGISTER := true
ARCH_ARM_HAVE_ARMV7A := true
TARGET_GLOBAL_CFLAGS += -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
TARGET_GLOBAL_CPPFLAGS += -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp

Then, add TWRP specific code (fix it for Your device):

# TWRP
# # RECOVERY_GRAPHICS_USE_LINELENGTH := true
# # TW_EXCLUDE_SUPERSU := true
TARGET_RECOVERY_INITRC := device/dns/s32dsb1/recovery/init.rc
DEVICE_RESOLUTION := 1280x720
TARGET_RECOVERY_PIXEL_FORMAT := "RGB_565"
TWHAVE_SELINUX := true

# Storage configuration
TW_EXTERNAL_STORAGE_PATH := "/sdcard"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "sdcard"
TW_FLASH_FROM_STORAGE := true

# For classic partitioned device
# TW_INTERNAL_STORAGE_PATH := "/media"
# TW_INTERNAL_STORAGE_MOUNT_POINT := "media"

# For datamedia device
RECOVERY_SDCARD_ON_DATA := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"

https://github.com/S-trace/TWRP_android_device_dns_s32dsb1/blob/master/BoardConfig.mk - this is example BoardConfig.mk for TWRP-only build, for Your reference.
[Android Software Development] bloommax:
My CPU is Cortex-A7 (mt8392). So I just need to change all a9s to a7s? How to determine the "TARGET_BOOTLOADER_BOARD_NAME "? Where's TARGET_RECOVERY_INITRC file? Thanks!
[Android Software Development] papsi177:
First you need to unpack yours stock recovery, after that you will have not so much questions)
[Android Software Development] lehmancurtis:
I'm using a prebuilt kernel, is there any way to further compress anything during the build? If not, what's the best way to trim the overall size?
[Android Software Development] _that:
Why is your prebuilt kernel so much larger than the boot partition? That doesn't make any sense to me.

Best way to trim the kernel size is to build it from source and use LZMA compression; if that is not enough then disable unneeded things in the kernel config.
[Android Software Development] DiamondJohn:
Are you asking about reducing the kernel size or the complete TWRP image?

And if you are talking only about the kernel, are you only using a pre-built, or also considering a complete build from source?
[Android Software Development] lehmancurtis:
I used AIK from osmosis, and I renamed the zimage to kernel. I have pulled the defconfig from the boot image and I am capable of compiling from source. How would I apply the LZMA flag?

---------- Post added at 10:26 PM ---------- Previous post was at 10:23 PM ----------

I need to reduce overall size. Max size is 17128320 total size is 22392832
[Android Software Development] lehmancurtis:
I went through the process of extracting the kernel again and then result was almost half the size. Compiling now, fingers crossed.

**Update**

I am able to compile recovery.img, but I am missing the dtb.

1. Can/ should I use prebuilt dtb?

2. Is there any difference between boot and recovery dtb's?
[Android Software Development] bassbounce:
I want to build Twrp, but I can't build it. I have a device tree but when compli many missing files so it abort all the time. I synced the Omni rom android-8.1 source but no Twrp recovery is in that source.

This is the device tree I want to use where do I place it?

https://github.com/geoleonsh/android_device_xiaomi_dipper
[Android Software Development] surendrajat:
The bootable/recovery/ dir contains TWRP source.

Put your device tree under device/xiaomi/dipper/ dir.

Also I guess you need to clone qcom_common repo as it is indicated in omni.dependencies.
[Android Software Development] bassbounce:
Thanks but, the recovery dit contains only aosp recovery no sign of Twrp in the source of onmi.
[Android Software Development] surendrajat:
I don't know if you've synced the right source but force clone https://github.com/omnirom/android_bootable_recovery into bootable/recovery/ again.
[Android Software Development] surendrajat:
Like it says "You can set ALLOW_MISSING_DEPENDENCIES=true in your environment".

You could've searched it first. Anyways hope this one works.....

https://github.com/q996467794/android_device_iuni_i1_twrp/issues/1
[Android Software Development] ashyx:
Nobody really uses the device resolution flag any more the portrait or landscape flag is enough. Twrp will do the rest.

TW_THEME := portrait_hdpi

Also the mount point stuff is unlikely to be needed either.

My guess is that you're using the stock kernel and you're facing Selinux issues.

Building a kernel as permissive from source can usually solve this.
[Android Software Development] Dmitry87:
ashyx, thanks for the advice. You are rignt, I have the warning about precompiled kernel. Is there an instruction how to build it form source and where to get the source?

There is no kernel source for my model on official samsung site, but there is for SM-G360F and SM-G360G, which are pretty similar to my model, can any be used instead or it won't likely work?

If I delete the resolution row, I get this error:

bootable/recovery/gui/Android.mk:68: * DEVICE_RESOLUTION is NOT SET in BoardConfig.mk

bootable/recovery/gui/Android.mk:69: * Please see http://tinyw.in/nP7d for details

Is my version old? I got it this way:

repo init -u https://github.com/omnirom/android.git -b android-4.4
repo sync -j4 -f --no-clone-bundle
[Android Software Development] zainifame:
What function of this flag

TW_SCREEN_BLANK_ON_BOOT

???
[Android Software Development] lehmancurtis:
I got mine to compile successfully but it's missing dtbs. How do I need to fix this.
[Android Software Development] ashyx:
Didn't realise you were building for a kitkat device.

That makes the selinux issues moot as kitkat kernels are permissive by default.

Also probably the reason you need the resolution flag. It's been a while since I built anything for KitKat.

It's likely if you download the sources for the g360g/f you will find the config for the Chinese device is included. That is if it ever got updated to lollipop.
[Android Software Development] Dmitry87:
ashyx, so, rebuilding the kernel makes no sense... and the problem that twrp doesn't work is hid somewhere else. Is there a way to debug it to find out the reason?
[Android Software Development] ashyx:
Which branch are you compiling from?
[Android Software Development] Dmitry87:
repo init -u https://github.com/omnirom/android.git -b android-4.4
repo sync -j4 -f --no-clone-bundle
[Android Software Development] ashyx:
Not sure your architecture is correct.

Try this:

TARGET_ARCH := arm

TARGET_CPU_ABI := armeabi-v7a

TARGET_CPU_ABI2 := armeabi

TARGET_ARCH_VARIANT := armv7-a-neon

TARGET_CPU_VARIANT := generic

TARGET_2ND_CPU_VARIANT := cortex-a53
[Android Software Development] slipk487:
I'm trying to build for j700t/1 but when I run lunch I says that it can't find the config material for j7eltetmo and I'm not sure how to go about fixing it.
[Android Software Development] surendrajat:
Must've missing some file in device tree or misplaced it. A log could be more helpful. However have you tried using twrp for J700H?
[Android Software Development] slipk487:
. build/envsetup.sh
including device/samsung/j7eltetmo/vendorsetup.sh
slipk487@slipk487-GA-970A-DS3:~/twrpOMNI$ lunch

You're building on Linux

Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. j7eltetmo
8. j7eltetmo-userdebug

Which would you like? [aosp_arm-eng] 8
build/core/product_config.mk:234: *** Can not locate config makefile for product "j7eltetmo". Stop.
WARNING: Trying to fetch a device that's already there
Traceback (most recent call last):
File "build/tools/roomservice.py", line 353, in <module>
fetch_device(device)
File "build/tools/roomservice.py", line 321, in fetch_device
git_data = search_gerrit_for_device(device)
File "build/tools/roomservice.py", line 81, in search_gerrit_for_device
device_data = check_repo_exists(git_data, device)
File "build/tools/roomservice.py", line 58, in check_repo_exists
"exiting roomservice".format(device=device))
Exception: j7eltetmo not found,exiting roomservice
build/core/product_config.mk:234: *** Can not locate config makefile for product "j7eltetmo". Stop.

** Don't have a product spec for: 'j7eltetmo'
** Do you have the right repo manifest?

[B][/B]

Yea my first time trying to set up a device tree. The device folder was from a j7eltexx that i edited to j7eltetmo
[Android Software Development] surendrajat:
Ah. I see. Your vendorsetup.sh is screwed up. Issue lunch omni_j7eltemo-eng instead if you've renamed .mk files correctly.
[Android Software Development] Davidgamer1990:
I am first time rooter and really wanna root my hauwei elate. Everything i read all i see is, theres no way ima be able to figure this out. Im sure itss very great feed back but im dumbfounded as to what i just read lol. Im trying to one click without pc i dont know what to install first before i root or also after. I dont know how to install or where. i install from bootloader itself or download apk. Im sure i sound dumb but i really dont waNt to brick my phone lol no extra device so this is a must be successful attemot. I have been dreading on not having root so i get i cant mess this up so any help or feed back on how to. Go about this step by step lol again sorry. Also its cricket androird hauwei elate phone any ideas what to install first before rooting like super ru or .. and or does that come after once root. See i already feel like an idiot but bricking only device well im sure anyone would be somewhat annoying as i feel now. Thanks i hope for any feedback and help. Appreciated alot.

..... Yes alot doesnt make any sense i guess my phone from what i have read reviews on is a little complicated then rooting others it barely even shows up on most pages when looking up all over google some people sound worst then me lol. And not indtruction i yrudt to prevent rooting.
[Android Software Development] zainifame:
#2

What function of this flag

TW_SCREEN_BLANK_ON_BOOT

???
[Android Software Development] _that:
It blanks (and immediately unblanks) the screen when TWRP starts up. I think it's a workaround that is required to make some devices (touchscreens?) work. According to the commit comment, the Huawei Honor 7 is one of the devices that need it.
[Android Software Development] pix106:
Hi,

Using a MT6680 smartwatch, I'd like to exclude /data/2ndswap file from the backups, because it has an immutable flag which stops restoring a backup.

Is there a simple way of excluding some files when creating a backup ?

I searched in partition.cpp, i found a few things about backup_exclusions but i did not manage to get it working for now (i may have used it wrong)

Thanks.
[Android Software Development] lehmancurtis:
I have successfully compiled twrp and boot.img (and several others), I started with Omni 7.1, then I switched to minimal manifest Omni tree, and now I'm working in Omni 5.1. I achieve the same results. The output claims success, I open the output directory and see what looks super, but I can't boot or flash the files. Instead the message says unable to locate remote dtb
[Android Software Development] ashyx:
Where/when does this message occur? Is your dtb actually combined in the recovery image?
[Android Software Development] lehmancurtis:
When I try to flash via fastboot. I used aik by osmosis to unpack the recovery and the dtb is missing. I've tried adding the original dtb using the same tool, but the resulting image flashes but is unusable. Do I need a dt.img? If so, how can I extract it?
[Android Software Development] ashyx:
Which device is this for?
[Android Software Development] lehmancurtis:
Coolpad catalyst cp3622A
[Android Software Development] ashyx:
Where did you obtain the dtb? Do you have the stock boot image you can post and is the dtb part of the boot image or on a separate partition?