yashsingh1/xdaforums huggingface dataset:
[Android Software Development] _that:
What version of TWRP are you trying to build? Mine has "-fno-strict-aliasing" in the makefile since 2014.
[Android Software Development] :
This thread isn't a place to request others make a twrp for your device. Post those requests in your device section or Android General Q&A.

Thanks! Thread cleaned.

Darth

Forum Moderator
[Android Software Development] BENETNATH:
Hi Dees_Troy,

you already provided me a lot of help to get the ot-995 working TWRP.

However, i was facing an issue ; the impossibility to flash other things than roms.

gapps or other things were non working.

i've found why : the /system/app partition

in fact. In our device, there is a custpack partition, used by alcatel to put all their bloat.

we are using it as a /system/app partition.

this one is not called by the recovery, and then not used by the system during install.

when gapps wants to put apk in the system/app folder, it's not possible to have it.

BUT, adding a line in the gapps updater-script like that :

run_program("/sbin/busybox", "mount", "/system/app");

just after

run_program("/sbin/busybox", "mount", "/system");

works perfectly.

I can do that as a workaround, but i would prefer to avoid having dedicated gapps for TWRP recovery.

any idea ?

i've tried to use the SP1 function, but was not successful. what should be the name to put in ?

"/system/app" ?

thanks for your advices

ben
[Android Software Development] #define:
Does TWRP can be modified to add "Format boot partition" facility??

If yes, how to do it??

Which files to edit??

Thanx in advance.. :good:
[Android Software Development] Dees_Troy:
You should probably do this as a custom theme. It's mostly just a matter of adding a wipe boot option to the ui.xml for your resolution.
[Android Software Development] #define:
Thanx for the quick reply..

I have one more question..

My device is HTC Explorer (codename Pico)..

Can I have it supported officially??

PS :- Its working great, BTW... :good:
[Android Software Development] cornholio_rules:
It's all in post #2 mate. ;)
[Android Software Development] #define:
I failed to put my question clearly..

I meant, who do I send this to?? And how??

Would a PM to the OP suffice??

Or do I need to email or something??
[Android Software Development] Dees_Troy:
PM me or catch me on IRC.
[Android Software Development] nabeeleinstein:
so do i need to have the entire cm source synced?

cuz i have a slow net connection and I've tried many times unsuccessfully to sync sources

is there any other way, to compile?
[Android Software Development] mfsr98:
I have this question too. Maybe we can only sinc a part of the source?
[Android Software Development] Dees_Troy:
While you don't need the entire CM repo to compile TWRP, I honestly have no idea what parts are needed and what parts aren't needed. You're welcome to try to figure it out on your own though.
[Android Software Development] BENETNATH:
indeed, it might help a lot to have only a sync of what is needed :)
[Android Software Development] #define:
Thats something we can try to figure out..

Someone with full source, do this..

$ make -jX recoveryimage 2>&1 | tee compile.log

The "compile.log" should be there in the root of the source..

Open that, and see whats used to compile..

And then, when you initialize the repo, just keep those folders in default.xml(or make a local_manifest.xml) and sync.. Compile to see if it works..

And if it does, please report here...

:)
[Android Software Development] Dees_Troy:
Here's the output:

http://tinyw.in/dRmW
[Android Software Development] antonio8297:
who want to try???

is here the default.xml modded

https://github.com/antonio8297/android

need to do the normal command for repo...

jb branch
[Android Software Development] #define:
Nobody tried this??

Sent from my Nexus 7
[Android Software Development] Ozadroid:
Dees_Troy: cant this get UBIFS support :(
[Android Software Development] nikhil16242:
Thank you for the awesome tutrorial Dees_Troy , really appreciate it :). With the help of your tutorial i was able to compile TWRPv 2.4.1.0 for my device (Desire C) . But Aroma Rom - installation doesnt seem to work with the recovery :( . Is this a known bug or do we have to do something extra to get aroma installer working with TWRP ?
[Android Software Development] varun.chitre15:
You need to post a recovery log for us to know the issue :)
[Android Software Development] nikhil16242:
This is really odd , the installer seems to work fine now :) .
[Android Software Development] yuweng:
i'm a n00b at compiling & this is my first try & would like to try out but where do i put this default.xml...

i'm using Ubuntu 12.04 LTS x64 & correct me if i'm wrong...

1. repo init -u git://github.com/CyanogenMod/android.git -b jellybean

2. Go to ~/CM10 & Ctrl + H at file manager & copy default.xml to ~/CM10/.repo/manifests to replace existing copy

3. repo sync -j16

it has been synchronising for hour up to now & i hope all the Master Shifu's here will have patience with me as i might ask some really n00b questions... :o
[Android Software Development] schwabe93:
So now i changed to cm repo, now i getting this error:
[Android Software Development] schwabe93:
Ok, i have set kernel compression, now building fine and booting also fine, but its shows no storage.
[Android Software Development] Android-Andi:
Issue in twrp.fstab?

Send from OnePlus One using Tapatalk

---------- Post added at 04:19 PM ---------- Previous post was at 04:17 PM ----------

About lzma.compression, in case someone need:

Lzma compressed ramdisk support: https://gerrit.omnirom.org/#/c/12773/

Lzma compressed recovery ramdisk using a custombootimg.mk: https://gerrit.omnirom.org/#/c/12797/

Send from OnePlus One using Tapatalk
[Android Software Development] schwabe93:
Here ist the twrp.fstab,
[Android Software Development] schwabe93:
The twrp.fstab i looked for the the klimtwifi model, it has offical twrp. So anybody could help

Gesendet von meinem klte mit Tapatalk
[Android Software Development] someone755:
bootable/recovery/minui/graphics.c:476: error: undefined reference to 'open_adf'
bootable/recovery/minui/graphics.c:485: error: undefined reference to 'open_fbdev'
collect2: error: ld returned 1 exit status

Getting this when compiling using CM sources. Any ideas?

EDIT: Pulling the graphics.h file from another recovery seems to have fixed it. However, more errors occur:

bootable/recovery/minui/graphics.c:356: error: undefined reference to 'res_create_surface'
collect2: error: ld returned 1 exit status
make: *** [/media/store/cm/out/target/product/z3c/obj/EXECUTABLES/healthd_intermediates/LINKED/healthd] Error 1
make: *** Waiting for unfinished jobs....

I've read here (click) that CyanogenMod has tweaked their charger/charger.c so that TWRP doesn't like it. However, editing bootable/recovery/minui/graphics.c to "res_create_display_surface," the build goes on. But, as you've probably guessed, more errors occur:

bootable/recovery/twrpTar.cpp: In member function 'int twrpTar::createTarFork(const long long unsigned int*, const long long unsigned int*, pid_t&)':
bootable/recovery/twrpTar.cpp:307:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (enc[i].thread_id == i) {
^

EDIT2: The above warning doesn't seem to impact anything. The second error though still remains and I have no clue how to fix it.
[Android Software Development] dungphp:
Help me

Dees_Troy please help me out ?

I have compiled recovery for my phone (720x1280, HD screen)

Pictures attack !

Thank you
[Android Software Development] Lrs121:
Make sure you have this line in your BoardConfig.mk

RECOVERY_GRAPHICS_USE_LINELENGTH := true

that should fix it
[Android Software Development] dungphp:
Great help ! I have compiled a TWRP for my phone ! Thankssssssssssss
[Android Software Development] santoshvaza:
hi,

repo init -u https://github.com/marduk191/recovery_manifest.git -b android-5.0

repo sync

how much data will be downloaded?
[Android Software Development] xuefer:
How to make a flash-able zip file to flash the recovery directly to recovery partition? is there a "make" rule for it yet?
[Android Software Development] diogofd8:
Does anyone know how and where can I learn the basics to be able to port TWRP for an unknown device?

I have the Vodafone Smart Tab 4G rooted and working good. But I want to use xposed and make some risky changes so I need a recovery at least to be able to make a nandroid backup so I won't end with a unrepairable brick.

I assume there's not many people with this device and there will never be so I am prepared to start myself developing some little things for my personal use and to share if they work good. I know somethings about programming as I can program in both C and Python to some extent, but this seems tottaly different. Any help to redirect some required reading and learning for me?
[Android Software Development] Lrs121:
Both CyanogenMod and omnirom both have guides to help you port the "rom" to your device. The guides help you understand what is needed to properly port to new devices. Having it ported makes developing recoveries for devices easier.

here are some links to dig around.

http://docs.omnirom.org/Index

http://wiki.cyanogenmod.org/w/Development

http://wiki.cyanogenmod.org/w/Doc:_porting_intro
[Android Software Development] yuweng:
Vodafone then best of luck to you . . . :cowboy:
[Android Software Development] papsi177:
compile bugs

Hi, everyone) I try to compile twrp on CM11 source(CM11 builded from this source is working fine ;)) But if i compile twrp, i get on output recovery.img..BUT it not content a needed files, wich must to be copied from device tree???

Example)

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/recovery/system/bin/linker:recovery/root/system/bin/linker \
$(LOCAL_PATH)/recovery/system/lib/libc.so:recovery/root/system/lib/libc.so \
$(LOCAL_PATH)/recovery/system/lib/libdl.so:recovery/root/system/lib/libdl.so \
$(LOCAL_PATH)/recovery/system/lib/libm.so:recovery/root/system/lib/libm.so \
$(LOCAL_PATH)/recovery/system/lib/libstdc++.so:recovery/root/system/lib/libstdc++.so \
$(LOCAL_PATH)/recovery/system/lib/libz.so:recovery/root/system/lib/libz.so

This files are not copied, and this too

PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/recovery/twrp.fstab:recovery/root/etc/twrp.fstab

Can some body explayn my WHY? I checked everything..
[Android Software Development] yuweng:
PRODUCT_COPY_FILES doesn't work on recovery anymore on cm-11.0, someone change the source again . . .

Found that out a month ago, Solution : Eg. Make a new folder /device/samsung/i9300/recovery/root at your device tree & copy whatever files/ folders you want, it'll automatically include it, you don't even need the PRODUCT_COPY_FILES statement anymore & it'll work too . . . :cool:
[Android Software Development] papsi177:
Greate)) Thanke you so much!
[Android Software Development] bgos10:
Hi [MENTION=912474]Dees_Troy[/MENTION],

Big fan of TWRP, It has been my default recovery for the last 3 Years on 5 devices. Thanks for all the Hardwork.

I had a question in TWRP 2.8.5.0 How do you make Mke2fs default instead of make_ext4fs like in TWRP 2.5.0.0

Thanks

Regards
[Android Software Development] _that:
Why do you want to do that?
[Android Software Development] bgos10:
The reason is wiping system /data/cache partition with mame_ext4fs takes around 5-10 minutes WhIle the latter takes hardly 10 seconds

I have faced lots of corrupt partitions with it especially emmc and system
[Android Software Development] _that:
I know that it takes long, but it should not corrupt partitions (unless it's a Samsung...). You could build with BOARD_SUPPRESS_SECURE_ERASE or even BOARD_SUPPRESS_EMMC_WIPE to disable the eMMC discard commands inside make_ext4fs.
[Android Software Development] lj50036:
How can the recovery have anything to do with android once it has booted ?

Thx Josh
[Android Software Development] Epirex:
Don't know, it only appears when installing TWRP

I did not find relationship between them, but the error exists
[Android Software Development] bgos10:
I will surely try that thanks. But isn't there a way to build as mke2fs as default?
[Android Software Development] _that:
As far as I see, there are only code paths for using the make_ext4fs library function or the separate make_ext4fs binary for formatting ext4. mke2fs is only used for ext3.
[Android Software Development] brisinger08:
This is the first time I've tried to compile TWRP so I apologize in advance if this is a dumb question, but after the recovery image and other associated files have generated I get this error:

----- Making recovery filesystem ------

Copying baseline ramdisk...

Modifying ramdisk contents...

cp: cannot stat ‘/home/bri/android/omni/out/target/product/hwmt7/root/init.recovery.*.rc’: No such file or directory

build/core/Makefile:767: recipe for target '/home/bri/android/omni/out/target/product/hwmt7/recovery/root.ts' failed

make: [/home/bri/android/omni/out/target/product/hwmt7/recovery/root.ts] Error 1 (ignored)

mkdir -p /home/bri/android/omni/out/target/product/hwmt7/recovery/root/system/bin

sed -i 's/ro.build.date.utc=.*/ro.build.date.utc=0/g' /home/bri/android/omni/out/target/product/hwmt7/recovery/root/default.prop

sed -i 's/ro.adb.secure=1/ro.adb.secure=0/g' /home/bri/android/omni/out/target/product/hwmt7/recovery/root/default.prop

----- Made recovery filesystem -------- /home/bri/android/omni/out/target/product/hwmt7/recovery/root

----- Making uncompressed recovery ramdisk ------

/home/bri/android/omni/out/host/linux-x86/bin/mkbootfs /home/bri/android/omni/out/target/product/hwmt7/recovery/root > /home/bri/android/omni/out/target/product/hwmt7/ramdisk-recovery.cpio

----- Making recovery ramdisk ------

/home/bri/android/omni/out/host/linux-x86/bin/minigzip < /home/bri/android/omni/out/target/product/hwmt7/ramdisk-recovery.cpio > /home/bri/android/omni/out/target/product/hwmt7/ramdisk-recovery.img

----- Making recovery image ------

/home/bri/android/omni/out/target/product/hwmt7/recovery.img maxsize=15949824 blocksize=135168 total=12130304 reserve=270336

----- Made recovery image: /home/bri/android/omni/out/target/product/hwmt7/recovery.img --------

zip error: Invalid command arguments (cannot repeat names in zip file)

build/core/Makefile:814: recipe for target '/home/bri/android/omni/out/target/product/hwmt7/system/etc/recovery-resource.dat' failed

make: *** [/home/bri/android/omni/out/target/product/hwmt7/system/etc/recovery-resource.dat] Error 16

It hope this is a noncritical error but I was hoping someone could help me identify the problem :)

Cheers
[Android Software Development] _that:
From what I see, recovery-resource.dat seems to be only used for stock OTAs, so it should not cause any issues if you don't have it. However I can't explain why it fails, unless you have two files with the same name in recovery/root/res, which should not happen.
[Android Software Development] MicroMod777:
Is this still a relenvant guide to build twrp or is there any more current ones updated? I"m trying to build twrp for the LG G Pad 8 v480 which currently does not have any custom recovery.

Thanks
[Android Software Development] yuweng:
This is the official thread, of course it is still relevant . . . :cowboy: Fyi, shoxxy has shared with me few days ago that he manage to build one but Touch is not working so you might wanna hang out here & hopefully the Master Shifu's there will be able to help you solve it . . . :fingers-crossed: i donno if this kernel source is complete as i'm no kernel expert either & i don't own a v480 myself so best of luck to you . . . :cool:
[Android Software Development] MicroMod777:
Thanks for the reply. Shoxxy got touch issue fixed. Only thing not working is when trying to flash a rom it bootloops back into twrp. Nothing gets flashed nor does it actually start. Here the recovery log:

http://pastebin.com/FQ4vqgmf
[Android Software Development] lj50036:
E:request read returned -1, errno: 22, exiting MtpServer::run loop

'errno 22 '

#define EINVAL 22 /* Invalid argument */

Have you tried to building without MTP ? Add this to the boardconfig.mk

I guess its worth a test.... :D

TW_EXCLUDE_MTP := true

Thx Josh
[Android Software Development] MicroMod777:
Thanks for taking a look at this! I will let shoxxy know and keep you posted. :good:
[Android Software Development] MicroMod777:
Well that didn't fix it but disabled mounting the sd card on computer from within twrp.

Thanks though. :good:
[Android Software Development] _that:
Your recovery.log should now be different. Any other error messages near the crash?
[Android Software Development] GeyerA:
Hi, I compiled following the guide and got this error at the end of compilation; it however compiled to the end....

make[1]: Entering directory `/media/Android2/Android/kernel/sony/msm'

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[2]: *** [modules] Error 1
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/media/Android2/Android/kernel/sony/msm'
make: [TARGET_KERNEL_BINARIES] Error 2 (ignored)
make -C kernel/sony/msm O=/media/Android2/Android/out/target/product/leo/obj/KERNEL_OBJ INSTALL_MOD_PATH=../../system ARCH=arm CROSS_COMPILE=" arm-eabi-" modules_install
make[1]: Entering directory `/media/Android2/Android/kernel/sony/msm'

The present kernel configuration has modules disabled.
Type 'make config' and enable loadable module support.
Then build a kernel with module support enabled.

make[2]: *** [modules_install] Error 1
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/media/Android2/Android/kernel/sony/msm'
make: [TARGET_KERNEL_BINARIES] Error 2 (ignored)

I added these commits to my device_sony_leo https://github.com/GeyerA/android_device_sony_leo/commits/Z3

and device_sony_shinano https://github.com/GeyerA/android_device_sony_shinano/commits/Z3

Obviously, I forked the bootable_recovery from Omni

Any idea why my build does not boot anymore neither I can boot to recovery (just a black screen)? It did before without these commits.
[Android Software Development] MicroMod777:
Here's the new recovery.log. Ahy help appreciated. Thanks

http://pastebin.com/8W7XueHJ
[Android Software Development] _that:
Looks like it crashes with no further error messages after line 388.

Time to debug TWRP and get a stack trace. Unfortunately nobody wrote a detailed "how to debug TWRP" guide yet. Here is what I learned so far about debugging - my method is crude but it works for me:

- get a static gdb binary for arm (thx Tassadar): http://tasemnice.eu/bordel/gdb and store it in ~/android/tools (or adapt the path below).

- create this shell script:

#!/bin/sh
adb push ~/android/tools/gdb /sbin
adb push $OUT/symbols/system/bin/recovery /tmp/
adb push $OUT/symbols/system/lib/libtwrpmtp.so /tmp/
adb push $OUT/symbols/system/lib/libc.so /tmp/
adb push $OUT/symbols/system/lib/libcutils.so /tmp/
adb push $OUT/symbols/system/lib/libstdc++.so /tmp/
adb push $OUT/symbols/system/lib/libstlport.so /tmp/
adb shell "chmod 777 /sbin/gdb /tmp/recovery"
adb shell "ps -T|grep recovery"
echo now run:
echo adb shell
echo gdb /tmp/recovery
echo set follow-fork-mode child
echo set detach-on-fork off
echo attach 123 (pid of twrp thread)

The selection of libraries that I push is incomplete (it's just what I needed to debug), so if you get missing symbols in your backtrace, you might want to push symbols for more libraries.

The "ps" command will list all threads of TWRP - usually at least two, and I guess the one with the lowest pid is always the main thread.

The two "set" commands should be typed at the gdb prompt and instruct gdb to follow process forks, which was important for debugging backup operations. You probably don't need them in your case. There is probably also a way to pass these options somehow to gdb so that you don't need to type them every time.

The "attach" command attaches the debugger to the running TWRP instance. Replace 123 with the result from the "ps" command of course.

- run TWRP, and at any time between the curtain and the crash (e.g. in the main menu :)), run your shell script and attach the debugger as explained in the echo commands and above.

- type "c" to continue running TWRP.

- let it crash; the debugger should display the signal.

- type "bt" to get a backtrace.
[Android Software Development] yuweng:
Thank You so much, Master Shifu [MENTION=4878287]_that[/MENTION], never knew this technique for debugging . . . :good:

i donno if this is related, i build on jb repo to support older devices, it use to work until bigbiff updated blkid to 2.25.0 then it doesn't build, got help from codelover it boots but doesn't backup, donno if this is worth your time to look into it, fyi, latest repo works no problem . . . :o

[New LWP 145]

Program received signal SIGFPE, Arithmetic exception.
[Switching to LWP 145]
0x4014bd20 in kill () from /sbin/libc.so
(gdb) bt
#0 0x4014bd20 in kill () from /sbin/libc.so
#1 0x4014dbc0 in __aeabi_ldiv0 () from /sbin/libc.so
#2 0x400bf95a in TWPartitionManager::Backup_Partition (
this=0x400ee080 <PartitionManager>, Part=0x402cbd60, Backup_Folder=...,
generate_md5=<optimized out>, img_bytes_remaining=0x43252950,
file_bytes_remaining=0x43252958, img_time=0x43252924,
file_time=0x43252928, img_bytes=0x43252948, file_bytes=0x43252940)
at bootable/recovery/partitionmanager.cpp:543
#3 0x400c0140 in TWPartitionManager::Run_Backup (
this=0x400ee080 <PartitionManager>)
at bootable/recovery/partitionmanager.cpp:795
#4 0x400d01e4 in nandroid (arg=..., this=0x40b96ab0)
at bootable/recovery/gui/action.cpp:1159
#5 GUIAction::nandroid (this=0x40b96ab0, arg=...)
at bootable/recovery/gui/action.cpp:1144
#6 0x400ce9de in GUIAction::doAction (this=<optimized out>, action=...)
at bootable/recovery/gui/action.cpp:463
#7 0x400cea6a in ActionThread::run (this=0x400ee320 <action_thread>,
data=0x42a95078) at bootable/recovery/gui/action.cpp:143
#8 0x400ceaba in ActionThread_work_wrapper (data=<optimized out>)
at bootable/recovery/gui/action.cpp:99
#9 0x40150c78 in __thread_entry () from /sbin/libc.so
#10 0x401503e0 in pthread_create () from /sbin/libc.so
---Type <return> to continue, or q <return> to quit---

Loaded symbols for /sbin/linker
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x0001dc0c in TWPartitionManager::Partition_SDCard (this=
0x34484 <std::vector<GUIObject::Condition, std::allocator<GUIObject::Condition> >::_M_insert_overflow_aux(GUIObject::Condition*, GUIObject::Condition const&, std::__false_type const&, unsigned int, bool)+108>,
this@entry=<error reading variable: Cannot access memory at address 0x402588ac>) at bootable/recovery/partitionmanager.cpp:1730
1730	bootable/recovery/partitionmanager.cpp: No such file or directory.

Running gdb after crash gives above message
[Android Software Development] _that:
The code in partitionmanager.cpp line 543 is dividing by zero:

total_time = (*img_bytes / (unsigned long)img_bps) + (*file_bytes / (unsigned long)file_bps);

img_bps and file_bps are read from DataManager a few lines before this. Currently I don't understand how this could have ever worked - the related variables in DataManager are only set after a backup is finished. Otherwise the variables are uninitialized.

Looks like this is dead code anyway - I'm going to remove it.

Edit: Here is the fix, tell me if it worked :) -> https://gerrit.omnirom.org/#/c/13647/
[Android Software Development] yuweng:
Thank You so much Master Shifu _that . . . arm11 devices is going to get 2.8.6.0 all thanks to you . . .

codelover has given me below command to be able to build on jb repo for patching the blkid error

# cd to your source dir
mv bootable/recovery/libblkid/include/bitops.h bootable/recovery/libblkid/include/bitops.h.BAK
curl https://raw.githubusercontent.com/omnirom/android_bootable_recovery/android-4.4/libblkid/bitops.h -o bootable/recovery/libblkid/include/bitops.h
[Android Software Development] MicroMod777:
Sweet. Will try to figure this out! Thanks