yashsingh1/xdaforums huggingface dataset:
[Android Software Development] _that:
No, the makefiles are the dictionary, in the sense that each build flag appears only once.
[Android Software Development] xathras:
Thanks for the reply. I'm sorry to seem slightly dim about this. If I make a mistake (a typo say) in writing a TWRP command it will show up in the build as an error. But how does the build know that it is an error. Surely it could only do that if it has an internal database of valid commands?

I think I'm confusing a command (e.g. TW_OEM_BUILD ) with a flag (e.g. wipeduringfactoryreset -- the partition will be wiped during a factory reset ).
[Android Software Development] _that:
Define what you mean with "commands".

TW_OEM_BUILD is a build flag for use in makefiles, not a command. wipeduringfactoryreset is a filesystem flag for use in fstab. These are totally different things.
[Android Software Development] xathras:
Thanks for your patience. So there are 2 types of flags, build flags and filesystem flags (there a lot of those in the first post).

I don't know if you're familiar with the Richard Feynman Universal Problem Solving Algorithm. It goes like this :-

Step 1) Write down the question.

Step 2) Think VERY hard.

Step 3 ) Write down the answer.

I've failed at step 1. I've been asking the wrong question. I should have asked - where are build flags defined, can that code be edited, can new build flags be created, and does the TWRP team know what/where they all are?
[Android Software Development] ibub:
[MENTION=4878287]_that[/MENTION]

I've been considering compiling an engineering build, which would include enough of the system binaries in ramdisk to at least allow twrp to operate without system partition (for all of those little oopses) . Recovery partition for the LG Fuel is 22MB. Our twrp image is 9.5MB. And the /system/bin is almost 18MB uncompressed. I noticed comments in omni/bootable_ recovery/android.mk (line 141) concerning exactly this idea, so I know I'm not the first to think of this. I had considered placing the binaries into a largely unused partition (misc?, external_SD?), but I'd rather not create more problems than I'm trying to fix. And I'm really not sure what binaries I can safely strip out (other than methods listed on the OP). Any suggestions?
[Android Software Development] _that:
TWRP doesn't need the system partition for anything. Other than installing a ROM on it. :)
[Android Software Development] _that:
The build flags are defined in the makefiles. Most are documented in the OP.

The code can be edited, new build flags can be created, and the TWRP team doesn't know what new build flags you want to create. :)
[Android Software Development] xathras:
Thanks again. Question answered.:)
[Android Software Development] ibub:
Hey, thanks for the response brother. :) Guess I'm interpreting a few things wrong, and the export path statement that lists /system/bin and /sbin is only for the make files. Thought the linker used that during loading. But it's not the first time that android made me feel stupid. Guess I'll go back and read the source and scratch my head some more. Again thanks.
[Android Software Development] blastagator:
[MENTION=4878287]_that[/MENTION]

I finally got around to fixing my previous suggestion :)

Fix handling of permissions on internal sd card; Updated and fixed to be consistent with reviewer notes. Also, changed mandated /data/media/0 to match what user defines in boardconfig.

https://gerrit.omnirom.org/#/c/15545

(Old abandoned suggestion https://gerrit.omnirom.org/#/c/13957/ - abandoned due to changing the nature of the patch / branch)

This could additionally be improved by making a loop to extract the internal sd mount from the fstab file, eliminating the need to use the old internal path flag. (I know the flag is supposed to be deprecated.)

Tested and working great.

edit: More https://gerrit.omnirom.org/#/c/15549

https://gerrit.omnirom.org/#/c/15550
[Android Software Development] vx2ko:
Can someone help with this compil error? Seems I can't get passed it. I'm building from omnirom bootable recovery source tree.

make: *** No rule to make target 'su', needed by '/home/kiyano/android/system/out/target/product/clark/obj/EXECUTABLES/recovery_intermediates/twrp.o'. *Stop.
[Android Software Development] BuQQzz:
Not sure whats going on here but if anyone has an idea as to why im getting this error id be grateful!

----- Making recovery image ------
/home/buqqzz/cm13/out/host/linux-x86/bin/mkbootimg --kernel /home/buqqzz/cm13/out/target/product/tate/kernel --ramdisk /home/buqqzz/cm13/out/target/product/tate/ramdisk-recovery.img --cmdline "mem=1G rootdelay=2 init=/init androidboot.console=ttyO2 androidboot.hardware=bowser androidboot.selinux=permissive" --base 0x80000000 --pagesize 2048 --output /home/buqqzz/cm13/out/target/product/tate/recovery.img.tmp
error: could not load ramdisk '/home/buqqzz/cm13/out/target/product/tate/ramdisk-recovery.img'
make: *** [/home/buqqzz/cm13/out/target/product/tate/recovery.img] Error 1
make: *** Waiting for unfinished jobs....
make: Leaving directory `/home/buqqzz/cm13'
[Android Software Development] _that:
I guess because /home/buqqzz/cm13/out/target/product/tate/ramdisk-recovery.img doesn't exist.
[Android Software Development] BuQQzz:
Yeah which is weird twrp won't compile successfully, but I can compile it successfully for 5.1 with the same device tree setup. Any idea how I can fix this ?
[Android Software Development] bigmeltx:
all of a sudden my twrp is asking for a password. I did not set one. My system is also looping going into system. How do I recover password were I can restore my system.
[Android Software Development] lj50036:
Device ?

Thx Josh
[Android Software Development] bigmeltx:
Xoom
[Android Software Development] lj50036:
That device has not been supported since 2.6..3.0....

Thx Josh
[Android Software Development] desalesouche:
android 6.0 twrp

HI all, i would like to know if there is any msm8916 twrp android 6.0 device tree?

or any 6.0 twrp device tree which has booting twrp?
[Android Software Development] andreya108:
Please help compiling TWRP for ARM64.

I have no problem when building TWRP for 32-bit (under OMNI-4.4), but when I tried to build for 64-bit platform I faced some problems:

When building under OMNIROM 5.1.1 source tree:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=full_aio_otfp
TARGET_BUILD_VARIANT=user
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.19.0-33-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=LYZ28J
OUT_DIR=/home/andreya108/omni-5.0/out
============================================
/home/andreya108/omni-5.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: /home/andreya108/omni-5.0/out/target/product/aio_otfp/obj_arm/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(bcopy.o): multiple definition of 'bcopy'
/home/andreya108/omni-5.0/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.8/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: /home/andreya108/omni-5.0/out/target/product/aio_otfp/obj_arm/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a(memmove.o): previous definition here
collect2: error: ld returned 1 exit status

When building under CM-12.1 source tree:

============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
CM_VERSION=12.1-20151127-UNOFFICIAL-aio_otfp
TARGET_PRODUCT=cm_aio_otfp
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-a
TARGET_CPU_VARIANT=generic
TARGET_2ND_ARCH=arm
TARGET_2ND_ARCH_VARIANT=armv7-a-neon
TARGET_2ND_CPU_VARIANT=cortex-a53
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.19.0-33-generic-x86_64-with-Ubuntu-14.04-trusty
HOST_BUILD_TYPE=release
BUILD_ID=LMY48Y
OUT_DIR=/home/andreya108/cm-12.1/out
============================================
target SharedLib: libaosprecovery (/home/andreya108/cm-12.1/out/target/product/aio_otfp/obj/SHARED_LIBRARIES/libaosprecovery_intermediates/LINKED/libaosprecovery.so)
/home/andreya108/cm-12.1/out/target/product/aio_otfp/obj/SHARED_LIBRARIES/libaosprecovery_intermediates/legacy_property_service.o: In function `update_prop_info':
/home/andreya108/cm-12.1/bootable/recovery-twrp/legacy_property_service.c:129: undefined reference to `__futex_wake'
/home/andreya108/cm-12.1/out/target/product/aio_otfp/obj/SHARED_LIBRARIES/libaosprecovery_intermediates/legacy_property_service.o: In function `legacy_property_set':
/home/andreya108/cm-12.1/bootable/recovery-twrp/legacy_property_service.c:190: undefined reference to `__futex_wake'
collect2: error: ld returned 1 exit status
[Android Software Development] desalesouche:
twrp 6.0 ?

Hi all, i would like to know if there is any twrp 6.0 device tree.

is there any device that have a working trwp made with omni 6.0?

If it can be a msm8916 device , it would be nice.

please link me to github or thread.

thanks.
[Android Software Development] lj50036:
https://github.com/omnirom/android_bootable_recovery/tree/android-6.0

There is the source for TWRP right where it has always been :)

I have a working TWRP build from this tree....

But I am not sure about msm8916...

Thx Josh
[Android Software Development] desalesouche:
this is not a device tree, sorry. with twrp device tree i mean something like that sir,

https://github.com/surdupetru/g620s_twrp
[Android Software Development] nailyk:
PRODUCT_COPY_FILES on mka recoveryimage

Hi,

I'm experiencing a problem when compiling twrp for the D6603 (sony z3 / msm8974).

I launch the build (CM12.1 working tree) doing

make clean
mka -j5 recoveryimage

I need to 'copy' two 'out of build tree' files:

device/sony/z3/recovery/root/etc/bootrec-device
device/sony/shinano-common/twrp.fstab

So I put the lines:

device/sony/shinano-common/shinano.mk:52:PRODUCT_COPY_FILES += device/sony/shinano-common/twrp.fstab:recovery/root/etc/twrp.fstab
device/sony/shinano-common/shinano.mk:53:PRODUCT_COPY_FILES += device/sony/z3/recovery/root/etc/bootrec-device:recovery/root/etc/bootrec-device

and with a lot of internet and reading (almost) all this thread I found this post:

Everything goes fine until build complains about:

Target boot image: /home/nailyk/android/cm-12.1/out/target/product/z3/boot.img
cp: impossible d'évaluer «/home/nailyk/android/cm-12.1/out/target/product/z3/recovery/root/etc/bootrec-device»: Aucun fichier ou dossier de ce type
make: *** [/home/nailyk/android/cm-12.1/out/target/product/z3/boot.img] Erreur 1

Then my workaround is to do:

cp device/sony/z3/recovery/root/etc/bootrec-device out/target/product/z3/recovery/root/etc/
cp device/sony/shinano-common/twrp.fstab out/target/product/z3/recovery/root/etc/twrp.fstab
mka -j5 recoveryimage

and now everything is fine:

Made boot image: /home/nailyk/android/cm-12.1/out/target/product/z3/boot.img
[...]
Made recovery image: /home/nailyk/android/cm-12.1/out/target/product/z3/recovery.img
[...]
#### make completed successfully (06:00 (mm:ss)) ####

Is there a way to automate file copying when only recovery is built?

What are bests practices for building twrp? ( I would like submit my work for helping TWRP team adding the z3 on an official way )

Thank for reading.

And for making twrp!

P.S.: If a build the whole Cyanogen, everything goes fine and manual copying isn't needed.
[Android Software Development] ferhung:
You need to look at build/core/Makefile.

For cm-13.0, you should look at: review.cyanogenmod.org/#/c/114249/
[Android Software Development] yuweng:
Mentioned it twice on this thread here & here, WoW, its been almost two years already, how time flies & Christmas is around the corner again... :cowboy:
[Android Software Development] cezer kiran:
Guys iam intersted to compile twrp for my device. Should i need to download the the whole omnirom source or i can download only the android_bootable_recovery since i dont need rom i need only the recovery
[Android Software Development] _that:
You need a lot of other projects, but not the complete ROM. You can try using this manifest:

https://github.com/lj50036/platform_manifest_twrp_omni
[Android Software Development] cezer kiran:
What about the download size?

---------- Post added at 10:16 AM ---------- Previous post was at 10:13 AM ----------

Since im newbie having another doubt does the twrp needs vendor tree or device and kernel tree is enough?
[Android Software Development] freibergisch:
Just to clarify:

TWRP-source is now able to make a recovery for newer devices, which dont have custom recoveries, without downloading the full source of cyanogenmod? In the very past of building recoveries (CWM), I had to get the cm files and put in the kernel files and then I was able to build the recovery (hopefully without any issues)...

I got a really new phablet and it is not rootable, after all.. So I need to go the custom-way, as I like it, normally..

-> Can I build a working twrp by editing some files and without downloading tons of sources, first?

If I get it working, I feel better... Devices without root - NoGo... :)

Please tell me, if I am wrong, but it seems to be so easy.. (I know that it would not...)

Best regards

Marcus
[Android Software Development] _that:
Significantly less than the full Android source. Still in the gigabyte range (e.g. you still need the toolchains).

Usually you don't need the vendor subtree (unless you need it for hardware keymaster support).

You still need a significant subset of the full Android source code. Omni 5.1 is currently the preferred tree, but you can also use CM.
[Android Software Development] cezer kiran:
Will it be around 5 gigabyte?
[Android Software Development] lj50036:
No, full android source is more like 20-25 gigs.....

I do have a minimal repo that is about 10 gigs....

Thx Josh
[Android Software Development] cezer kiran:
So i need about 10 gb for "twrp 5.1" branch?
[Android Software Development] lj50036:
That will be without and device tree of kernel source....

Yes, 10GB give or take a few MB's here and there.... :)

Thx Josh
[Android Software Development] cezer kiran:
I already have device and kernel tree for my device. so i need only this. Repo? Is that right?
[Android Software Development] lj50036:
Yes, that is correct, all I was getting at was that the size is going to be diff for you them me...

But the base repo's needed are about 10GB + device/kernel tree....

Thx Josh
[Android Software Development] cezer kiran:
Ok thanks mate
[Android Software Development] cezer kiran:
u said that i dont need a vendor tee for compiling twrp but without vendor tree im facing this error

build/core/product_config.mk:227: *** _nic.PRODUCTS.[[device/sony/wukong_dsds/omni_wukong_dsds.mk]]: "vendor/sony/wukong/wukong-vendor.mk" does not exist. Stop
[Android Software Development] Android-Andi:
Remove the call of vendor/sony/wukong/wukong-vendor.mk inside your device tree or better change from:

# Use the non-open-source parts

$(call inherit-product, vendor/sony/wukong/wukong-vendor.mk)

To

# Use the non-open-source parts, if they're present

$(call inherit-product-if-exists, vendor/sony/wukong/wukong-vendor.mk)

Gesendet von meinem LG-H815 mit Tapatalk

Edit: for reference https://github.com/andi34/device_samsung_p5110/commit/c76798529aca0b23f1b1c8ad1b07d60b2d3b53d2
[Android Software Development] cezer kiran:
is timekeep and thermanager repos are essential? im building only recovery,also how should be omni dependencies file if i have already pulled essential repos? how should i build with prebuilt kernel?
[Android Software Development] cezer kiran:
PRODUCT_COPY_FILES vendor/omni/prebuilt/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.

No private recovery resources for TARGET_DEVICE wukong_dsds

device/sony/yukon-common/mkbootimg.mk:17: warning: overriding commands for target `/home/kiran/source/out/target/product/wukong_dsds/boot.img'

build/core/Makefile:570: warning: ignoring old commands for target `/home/kiran/source/out/target/product/wukong_dsds/boot.img'

Import includes file: /home/kiran/source/out/host/linux-x86/obj32/EXECUTABLES/mkbootimg_intermediates/import_includes

host C: libmincrypt_32 <= system/core/libmincrypt/dsa_sig.c

host C: libmincrypt_32 <= system/core/libmincrypt/p256.c

In file included from /usr/include/assert.h:35:0,

from system/core/libmincrypt/p256.c:35:

/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

# include <sys/cdefs.h>

^

compilation terminated.

In file included from /usr/include/string.h:25:0,

from system/core/libmincrypt/dsa_sig.c:27:

/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory

# include <sys/cdefs.h>

^

how to overcome this error?
[Android Software Development] MSF Jarvis:
[MENTION=912474]Dees_Troy[/MENTION], which compression flags are supported by TWRP??? because I want to compile it within a tight 5 MB limit.
[Android Software Development] vampirefo:
Yeah not going to happen.
[Android Software Development] Dees_Troy:
Ramdisk compression support is determined by the kernel used in the recovery image, not by TWRP.
[Android Software Development] MSF Jarvis:
One guy compiled it for me already, 2.8.7.0 the ui was horrid so I am trying again.

---------- Post added at 01:43 AM ---------- Previous post was at 01:42 AM ----------

Thanks for the help. I figured out the trick.
[Android Software Development] MSF Jarvis:
Thanks for the help. I figured out the trick.
[Android Software Development] Dees_Troy:
TWRP can be made to fit in rather small recovery partitions if one is willing to put in a little extra effort. For example, here's a device with a 5MB recovery partition and a 4.2MB TWRP image:

https://dl.twrp.me/supersonic/
[Android Software Development] Android-Andi:
I noticed twrp compiled on Lollipop is quite bigger than compiled on KitKat - not sure if it's related to GCC?

Maybe compiling on KitKat is useful.

Else i am using lzma compression for recovery ramdisk.

For reference:

https://github.com/omnirom/android_...mmit/01395b525576c67b23b2b95ce0f1e6b208828988

https://github.com/omnirom/android_...mmit/da83fca64c570bdb9b68e29256aafb21cdeef007

If you are compiling on CM12.1 you maybe also need to define

BOARD_CANT_BUILD_RECOVERY_FROM_BOOT_PATCH := true

Or

TARGET_NOT_USE_GZIP_RECOVERY_RAMDISK := true

(imgdiff expects a ramdisk to use GZIP, which is causing a chunk size issue if recovery is using LZMA )

https://github.com/CyanogenMod/android_build/commit/4ae8bf518eb546f72f8f2866ce7acea9d34e9e80

https://github.com/CyanogenMod/android_build/commit/bf6582e6d19c1360ca064097e52b57c334210a39

On Omni RECOVERY_FROM_BOOT_PATCH := isn't defined if a custombootimg.mk is used and won't need any of those 2 flaggs.

https://github.com/omnirom/android_build/blob/android-6.0/core/Makefile#L1118-L1122

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] MSF Jarvis:
http://pastebin.com/tbUtqyXJ

Can anyone help ?? [MENTION=912474]Dees_Troy[/MENTION] ? [MENTION=5153662]Android-Andi[/MENTION] ?
[Android Software Development] Android-Andi:
/bin/bash: flex: command not found

Thats the error.

Run:

sudo apt-get install flex

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] Slimegod:
What is this error derived from http://pastebin.com/AEZYvLmH. I'm building OMNI for the s5 device.
[Android Software Development] Android-Andi:
Whole console output?

Error line must be some lines ahead if i am not wrong

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] tra_dax:
I'm compiling twrp for gt-s7392 and got this error:

bootable/recovery/minuitwrp/minui.h:44:19: note: previous definition of 'gr_text' was here

bootable/recovery/minuitwrp/graphics.c: In function 'gr_font_size':

bootable/recovery/minuitwrp/graphics.c:590:7: warning: pointer targets in passing argument 2 of 'gr_getFontDetails' differ in signedness [-Wpointer-sign]

bootable/recovery/minuitwrp/graphics.c:562:5: note: expected 'unsigned int *' but argument is of type 'int *'

bootable/recovery/minuitwrp/graphics.c:590:7: warning: pointer targets in passing argument 3 of 'gr_getFontDetails' differ in signedness [-Wpointer-sign]

bootable/recovery/minuitwrp/graphics.c:562:5: note: expected 'unsigned int *' but argument is of type 'int *'

make: *** [/home/tra_dax/cm11/out/target/product/kyleve/obj/SHARED_LIBRARIES/libminuitwrp_intermediates/graphics.o] Error 1

make: *** Waiting for unfinished jobs....

Can anyone help me to fix??

Thx in advance.???

tra_dax
[Android Software Development] Android-Andi:
[MENTION=7134332]tra_dax[/MENTION] link your device tree. Seems like you use a custom graphics.c inside your device or common device tree

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] tra_dax:
Here's the device tree:

https://github.com/Grace5921/device_samsung_kyleve

And i m using cm 11 sources

tra_dax
[Android Software Development] Slimegod:
I'm assuming it's a recovery issue based off the previous line. It starts compiling "libincrypt" which has something to do with TWRP.
[Android Software Development] Android-Andi:
I take a look when i have time, at least you miss twrp flags like theme size.

Best base would be omni, since twrp is developed on omni as source base.

Like i said, whole console output please.

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] MSF Jarvis:
I've tried that, didn't fix the issue. The server I use is undergoing maintainance, so I'll have to wait for some time to give you the newer log. Thanks for your help, really appreciate it.
[Android Software Development] Android-Andi:
You need root rights to install flex, maybe you miss other packages too? At least flex showed up in the log

https://github.com/andi34/samsung_g...roid ROMs - Prepare Ubuntu 14.04.3 LTS Trusty

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] MSF Jarvis:
The link's broken[emoji20]
[Android Software Development] Android-Andi:
https://github.com/andi34/samsung_galaxy_tab2_secrets/tree/master/Compileing

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] cezer kiran:
Atlast i have compiled the boot.img and i flashed to my device ,device booted well but there is no recovery !!! Also aftr flashing boot.img the sim cards dint get detected and my phone refused to switch off any help???
[Android Software Development] vampirefo:
Well if you flash a boot.img then that explains why you have no recovery. Flash the recovery.img this time.
[Android Software Development] cezer kiran:
So i need to make recovery.img ?? And flash it in boot partition?? I think my device dont have recovery partition
[Android Software Development] vampirefo:
If you don't have recovery, you don't need twrp.
[Android Software Development] cezer kiran:
Nope for older kernel some developers built boot.img which had twrp in it and we flashed that img file in the boot partition only not in recovery partition
[Android Software Development] tra_dax:
[MENTION=5153662]Android-Andi[/MENTION]

I have updated the tree and i got this error:

http://pastebin.com/WcuKemeA

Thx in advance??

tra_dax
[Android Software Development] cezer kiran:
Do i need a stock ramdisk??? Because i havent included a stock ramdisk
[Android Software Development] Android-Andi:
Depends on what rom you need to flash the boot.img

If recovery is included in boot.img it's a littlebit tricky. You can for example check i9100g on omniroms github to see how it's handeled.

The ramdisk files have to match the rom you use it on.

Gesendet von meinem LG-H815 mit Tapatalk
[Android Software Development] cezer kiran:
Im building recovery for stockrom
[Android Software Development] Android-Andi:
What twrp branch you are using?

Maybe try android-5.1 branch (i haven't compiled on latest 6.0 source yet, not sure if it's made compatible to compile on older rom source yet).

Also i would suggest to build using omnirom source to avoid issues.

Gesendet von meinem LG-H815 mit Tapatalk