yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Hacker432:
SOLVED

Guys I've tried different device trees but I can't compile twrp

Here is my error :(

https://pastebin.com/WapTZpDB

Here are my sources https://github.com/Hacker432-Y550/android_device_huawei_y550

Please help me

SOLVED

Inviato dal mio HUAWEI Y550-L03 utilizzando Tapatalk
[Android Software Development] NepoRood:
BOARD_HAS_SCREWED_UP_CHIP = : true

I'm trying to build for 2 different devices, both RCA tablets (I know they cheap, but why spend a lot of money just to brick something when you're a "newb" lol). However, I can't seem to get TWRP 3 to work properly. For "Device A", the screen is in "Portrait" mode, but the actual touch points are in "Landscape". For "Device B", it's just the opposite (screen "Landscape", touch points "Portrait").

It doesn't seem to matter which flags I use to compile, nothing changes. Well, I can use the "BOARD_HAS_FLIPPED_SCREEN := true" flag, and the screen will flip, but the touch points are still off. I "clean" and "clobber" for every build, am I missing a flag? TWRP works on both devices, backup and restore, but only if you can find the right place to touch the screen (which I'm about use to at this point, lol)

Any advice would be appreciated,

Nepo
[Android Software Development] Startrek852:
Have you tried "RECOVERY_TOUCHSCREEN_SWAP_XY := true"?
[Android Software Development] NepoRood:
Yes, I've tried all the flags that I know of, separate and together, but it just won't work. Here's a look at my TWRP flags from the last build:

#TWRP
TW_THEME := landscape_hdpi
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
TW_CUSTOM_BATTERY_PATH := /sys/class/power_supply/battery
TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID := true
RECOVERY_GRAPHICS_USE_LINELENGTH := true
BOARD_HAS_NO_REAL_SDCARD := true
RECOVERY_SDCARD_ON_DATA := true
TW_NO_SCREEN_BLANK := true
TW_NO_SCREEN_TIMEOUT := true
TW_EXCLUDE_SUPERSU := true
TW_FLASH_FROM_STORAGE := true
TW_NO_EXFAT_FUSE := true
TW_NO_EXFAT := true
TW_MAX_BRIGHTNESS := 255
TW_NO_REBOOT_BOOTLOADER := true
TW_FLASH_FROM_STORAGE := true
BOARD_HAS_LARGE_FILESYSTEM := true
RECOVERY_TOUCHSCREEN_SWAP_XY := true
# RECOVERY_TOUCHSCREEN_FLIP_Y := true
# RECOVERY_TOUCHSCREEN_FLIP_X := true
# BOARD_HAS_FLIPPED_SCREEN := true
TW_CUSTOM_CPU_TEMP_PATH := /sys/devices/virtual/thermal/thermal_zone1/temp
[Android Software Development] DigiAngel69:
Fails to compile:

target SharedLib: libcrecovery (/home/dev/androidbuild/android/system/out/target/product/vs985/obj/SHARED_LIBRARIES/libcrecovery_intermediates/LINKED/libcrecovery.so)

target thumb C: libflashutils <= bootable/recovery-twrp/flashutils/flashutils.c

system/core/healthd/healthd_mode_charger.cpp:943: error: undefined reference to 'res_create_display_surface'

collect2: error: ld returned 1 exit status

make: *** [/home.dev/androidbuild/android/system/out/target/product/vs985/obj/EXECUTABLES/healthd_intermediates/LINKED/healthd] Error 1

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

make: Leaving directory `/home/dev/androidbuild/android/system'

#### make failed to build some targets (06:14 (mm:ss)) ####

This compiles when I don't specify twrp as recovery though.
[Android Software Development] MSF Jarvis:
Make theme capital. Won't help, but that's a requirement.
[Android Software Development] a1smkshp:
I have a backup that was emailed to me to restore my phone that has no OS installed. I downloaded it to my sdcard and now I dont know what to do next

*yes I have twrp recovery

*I tried backup/restore

*I copy and or moved files

*I tried install but I dont see the files in that option but I do see it in file manager so I can confirm its there

*I dont have access to a computer right now

Help please and thank you
[Android Software Development] Startrek852:
Did you place the folder in the TWRP/BACKUPS folder? If you have done that, try this: Make a backup of any small partition, then go into the folder and subfolders that the backup created, delete the files in there, then copy system.ext4.win, system.info, and recovery.log into the folder then try restoring.
[Android Software Development] a1smkshp:
I don't think I did that. I remember placing it in "LGbackups" not "twrp" I haven't done your second option yet but ill keep that in mind thanks.

I actually ended up going to a wireless repair shop and the guy clean the inputs and is going to flash it from the computer free of charge. So I lucked out =)
[Android Software Development] Hacker432:
Twrp backups must be in TWRP/BACKUPS

Inviato dal mio HUAWEI Y550-L03 utilizzando Tapatalk
[Android Software Development] a1smkshp:
Ok let me make sure I got this correct

*I insert the sdcard with backup to phone

*I move files to internal /twrp/backup.....

*I start the backup process

(storage:internal storage)

*I wipe cache

*I do the restore
[Android Software Development] Hacker432:
Yes that's correct

Inviato dal mio HUAWEI Y550-L03 utilizzando Tapatalk
[Android Software Development] a1smkshp:
Awesome ill remember that thank you. I figured it shouldn't matter where I placed the files
[Android Software Development] Startrek852:
Or you can make a TWRP/BACKUPS folder on your SD Card then place it there.
[Android Software Development] a1smkshp:
Ok...Im still suspicious of that phone because I feel like I did all options the correct way. But im going to make sure I do it this way.

Btw I found an old Samsung galaxy rush lying around and it works....but it can be super slow most of the time. My guess is that its running on 4.1...there are no higher official updates and theres not much I can find in forums. Any custom roms you can recommend or a diagnostics on why its extremely slow.
[Android Software Development] matt4321:
This thread is not for requesting TWRP for a specific device.

Forum moderator,

matt4321
[Android Software Development] MSF Jarvis:
https://gist.github.com/MSF-Jarvis/0c6a19483e002911af84

I have started compiling a list of all TWRP flags, will be making an XDA Thread with the descriptions as soon as it is completed.
[Android Software Development] vampirefo:
That would be great.
[Android Software Development] yuweng:
Good initiative bro, this thread is actually for intermediate but now it is flooded with newbies, its good that you'll start a new thread on this, i'm just too lazy for that.... :o

Long time ago, i wrote a script for building TWRP, with option to sync full or part-source, create device tree, build it, push it to the device & even create & upload device tree to github.... :cool: Contact me in pm if you're interested to further developed it.... :cowboy:
[Android Software Development] MSF Jarvis:
I am in! I have a micro plan with GitHub, so if you want we can have a private repository to work with. And the newbies were what got [MENTION=4878287]_that[/MENTION] in trouble, so yes, this IS a good initiative.

---------- Post added at 04:10 PM ---------- Previous post was at 03:41 PM ----------

Compiling the list is done. Now only XDA Thread has to be made. It would be helpful if some of the more experienced people would help me with descriptions of the flags I couldn't understand the use of
[Android Software Development] MSF Jarvis:
http://xdaforums.com/android/software/twrp-flags-boardconfig-mk-t3333970

:good:
[Android Software Development] DigiAngel69:
No help with this eh? I can build CM12.1 just fine when I don't specify twrp as the recovery option...thoughts anyone?
[Android Software Development] belfastraven:
I've just been lurking here and am new to building TWRP; but did you check the file

healthd_mode_charger.cpp and make sure the #Include for "minui/minui.h" is there, and check to make sure that the .h file is itself OK? Compiling with another recovery won't necessarily use those files from the TWRP recovery directory.

FWIW
[Android Software Development] a1smkshp:
Twrp backup takes up too much memory. if transfer it to google drive and download it to sdcard when its needed will i have problems. Or will it be a headace? Probably sounds like a simple question but usually nothing is that simple.
[Android Software Development] image45:
The only issue I have is the time over various WiFi pots due to various speeds to transfer it to and from Google drive.
[Android Software Development] DigiAngel69:
Just checked they are both there...thank you. I guess my last shot at this is to try this:

https://github.com/lj50036/platform_manifest_twrp_omni

However with "brunch <device_name>" the device name is fuzzy for me...is is just "vs985"? or something else?
[Android Software Development] Startrek852:
This is not a request TWRP for your device thread. TWRP 3.0.0-0 already exists for your device: http://xdaforums.com/showthread.php?p=65663897
[Android Software Development] DigiAngel69:
Where does one get the omni_<device>-eng file?
[Android Software Development] Hacker432:
It's a lunch option

This option is in vendorsetup.sh file in the device folder

Inviato dal mio HUAWEI Y550-L03 utilizzando Tapatalk
[Android Software Development] Startrek852:
First of all, the command is lunch, not brunch. Second of all, you would use omni_vs985-eng for your device name.
[Android Software Development] DigiAngel69:
Hrmm....is it not a file? This is what I've done per the page:

repo init -u git://github.com/lj50036/platform_manifest_twrp_omni.git -b twrp-5.1

repo sync

build/envsetup.sh

but here's what I get when I try this. I think I'm missing a step somewhere. Thanks for the help:

lunch omni_vs985-eng

build/core/product_config.mk:222: *** Can not locate config makefile for product "omni_vs985". Stop.

Your device can't be found in device sources..

Traceback (most recent call last):

File "build/tools/roomservice.py", line 296, in <module>

fetch_device(device)

File "build/tools/roomservice.py", line 265, in fetch_device

git_data = search_gerrit_for_device(device)

File "build/tools/roomservice.py", line 78, 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: vs985 not found,exiting roomservice

build/core/product_config.mk:222: *** Can not locate config makefile for product "omni_vs985". Stop.

** Don't have a product spec for: 'omni_vs985'

** Do you have the right repo manifest?
[Android Software Development] vampirefo:
Where is your device tree?

For cm12.1

I don't use Omnirom source, may try soon, my guess you are better off downloading full source rather than just a partial source.
[Android Software Development] DigiAngel69:
Ah..yea that's the step I'm missing...how do you get a device tree?
[Android Software Development] vampirefo:
You make it, or you find someone that has one for your device.
[Android Software Development] Startrek852:
Not sure if this will work, but try copying the device/lge/vs985 folder from your CM source code folder to /device/lge in the new folder, then try lunch cm_vs985-eng. FYI, building with the twrp-5.1 branch will give you 2.8.7.1, not 3.0.0-0. You need the twrp-6.0 branch for 3.0.0-0.
[Android Software Development] DigiAngel69:
Thanks...I had to do this (why this isn't on https://github.com/lj50036/platform_manifest_twrp_omni I have no idea):

in directory device/

git clone https://github.com/TeamWin/android_device_lge_vs985

mkdir lge

mv android_device_lge_vs985 lge/vs985

so now I have that and I successfully complied recovery.img. Thanks for the info on 6.0...I thought that was the android version 8-|. My last step in this is apparently needing to compile a custom trwp kernel as the entire point of the exercise is to get encryption working on my LG G3. An exciting experience to say the least. Thanks again.
[Android Software Development] Startrek852:
Just so you know, if you made any changes to your BoardConfig.mk in the CM source, you should copy any changes to your new BoardConfig.mk, then make cleam and recompile once you get the twrp-6.0 branch.
[Android Software Development] DigiAngel69:
Thanks...just verified that the TeamWin vs985 kernel has no crypto :( Wonder why that wasn't complied in....odd.
[Android Software Development] vampirefo:
Are you sure TWRP works on encryption? I don't use encryption.
[Android Software Development] MSF Jarvis:
TWRP works good with crypto if your BoardConfig.Mk has the flag for it :

TW_INCLUDE_CRYPTO := true

You can check your device repo at TeamWin to see if it exists in your TWRP build or not.
[Android Software Development] vampirefo:
I don't need it, the other user needs twrp to support encryption, none of my devices are encrypted.
[Android Software Development] a1smkshp:
True, but that's tolerable. If i just physically insert SD into computer do i have to make any special changes to files( e.g.properties ). Or simply drag and drop method?
[Android Software Development] DigiAngel69:
Very helpful thank you!
[Android Software Development] vampirefo:
I noticed a problem today with both cm13 and omni 6 source both build an x86 twrp recovery, that's unusable due to black screen.

Now both build a useable TWRP 2.8.7.0 recovery.

If I download omnl 5.1 source it will build useable TWRP 3.

So for some reason TWRP 3 and omni 6 aren't compatible neither is cm13.

cm12.1 can build useable TWRP 3, that's what I use for my main source.

Today I decided to use cm13 and omni source for a change, took a while to figure out both aren't compatible with TWRP 3 for x86.
[Android Software Development] Startrek852:
That's good to know. I've been building with CM13, so I'll try Omni 5.1.
[Android Software Development] a1smkshp:
Ok so im having a backup/restore issue.

*i inserted sdcard with backup into my laptop

*i went to the driver selected the folder TWRP>BACKUPS>6018a8af>select file(right click>send to>mydocuments)

*i tested it by wiping my sdcard and placing the copy files onto sdcard

*Went to recovery

*tried to move files to TWRP>backups

*it said some falure about kernal and now its messed up.

*i dont really have care too much about phone as it is a cheap galaxy rush to experiment
[Android Software Development] vinaykharayat:
Sorry for asking this can you please tell how to compile it? means we want Linux for it?

I m noob I compiling sources hope you will help :)
[Android Software Development] MSF Jarvis:
[MENTION=912474]Dees_Troy[/MENTION], purpose defeated.
[Android Software Development] Startrek852:
Umm.. This thread is titled How to COMPILE TWRP. Read the dang thread and you'll find out.
[Android Software Development] DigiAngel69:
Well I'm getting closer.....I'm trying the CM route, not Omni. Currently fails to compile with "Kernel modules not enabled". Googled with not much success...anyone have a pointer for this? Thanks.
[Android Software Development] TheLoonyRebel:
So I have an odd ball one here. Right now working on the Insignia Flex 10.1 NS-P10A6100 tablet. I have it rooted and trying to find the BoardConfig.mk file. The odd thing is that I can't seem to find the file at all searching with Root Explorer or even the folder that's mentioned in the main post. I did find /devices under /sys (/sys/devices) but that's as far as I've gotten. This tablet is running 5.0.1 and it's near stock-ish Android. Has anyone had luck with perhaps some of the other Insignia tablets that's fairly recent on this?
[Android Software Development] MSF Jarvis:
I've never seen a boardconfig stashed into the system, and that /devices is not what this thread wants. Device here meant your device tree which will ALWAYS have a BoardConfig.mk
[Android Software Development] TheLoonyRebel:
Yeah I stupidly misread the main post as the boardconfig being on the device. No it's in the device source which sadly for this device isn't available (I mean it's a MediaTek processor and there's nothing on Insignia's site for source download). :crying:

Thanks for nudging me to re-read things.
[Android Software Development] Startrek852:
You can make your own device tree. Or, you can call Insignia (1-877-467-4289) and ask for the source code.
[Android Software Development] TheLoonyRebel:
I posted on Insignia's forums asking for the source code.
[Android Software Development] vinaykharayat:
bro can you gimme the link please?
[Android Software Development] vampirefo:
This is nothing but a 8127, what is so odd or special about it? mtk device trees are all over github.

I built a cwm recovery a few weeks back for a similar device, if you took two minutes to Google device tree for mtk you would have found all kinds of them.

http://xdaforums.com/showpost.php?p=65469790&postcount=461

Even my cell phone is an mtk. So there is nothing odd or special about mtk.

---------- Post added at 10:40 AM ---------- Previous post was at 10:39 AM ----------

A link for what? The first post in this thread tells you how to build twrp.
[Android Software Development] Hacker432:
Why I can port a working cwm but not the twrp with the same device tree? :(

Inviato dal mio HUAWEI Y550-L03 utilizzando Tapatalk
[Android Software Development] vampirefo:
You can.
[Android Software Development] Startrek852:
Because you need to create a twrp.fstab file. Once you've created the twrp.fstab file, add a PRODUCT_COPY_FILES flag to your device.mk to copy it to the ramdisk. Check the example provided in the OP.
[Android Software Development] hoangthanh21:
How to Installer TWRP for Oppo R7s Plus (China), Snap 615, ram 4gb, Rom 64gb, please helpme?
[Android Software Development] EdwinMoq:
Hello.

I'm trying to compile TWRP for the LG Optmius L9. This device has an 10mb recovery partition and TWRP didn't fit so I used LZMA compression to make it fit. But for some reason it doesn't boot. It just get stuck at the LG logo. These are my build flags:

#TWRP
ifeq ($(LCD_BACKLIGHT_LM3530),true)
TW_BACKLIGHT_PATH := "/sys/devices/platform/omap/omap_i2c.2/i2c-2/2-0038/brightness"
else
TW_BACKLIGHT_PATH := "/sys/devices/platform/omap/omap_i2c.2/i2c-2/2-0036/brightness"
endif

TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
TW_MTP_DEVICE := /dev/mtp_usb
HAVE_SELINUX := true
RECOVERY_GRAPHICS_FORCE_USE_LINELENGTH := true
TW_THEME := portrait_hdpi
BOARD_HAS_NO_REAL_SDCARD := true
TW_INTERNAL_STORAGE_PATH := "/data/media"
TW_INTERNAL_STORAGE_MOUNT_POINT := "data"
TW_EXTERNAL_STORAGE_PATH := "/external_sd"
TW_EXTERNAL_STORAGE_MOUNT_POINT := "external_sd"
TW_INCLUDE_CRYPTO := true
TW_FLASH_FROM_STORAGE := true
TW_NO_REBOOT_BOOTLOADER := true
TW_MAX_BRIGHTNESS := 255
TW_HAS_DOWNLOAD_MODE := false
TW_CUSTOM_CPU_TEMP_PATH := /sys/devices/platform/omap/omap_temp_sensor.0/temperature

And this is my twrp.fstab:

# mount point	fstype	device

/boot	emmc	/dev/block/platform/omap/omap_hsmmc.1/by-name/boot
/recovery	emmc	/dev/block/platform/omap/omap_hsmmc.1/by-name/recovery
/system	ext4	/dev/block/platform/omap/omap_hsmmc.1/by-name/system
/cache	ext4	/dev/block/platform/omap/omap_hsmmc.1/by-name/cache
/data	ext4	/dev/block/platform/omap/omap_hsmmc.1/by-name/userdata length=-16384
/persist	ext4	/dev/block/platform/omap/omap_hsmmc.1/by-name/persist
/external_sd	vfat	/dev/block/platform/omap/omap_hsmmc.0/by-num/p1	flags=display="Micro SDcard";storage;wipeingui;removable

I don't really know what's wrong since the recovery doesn't even load, therefore no adb nor logcat. I was hoping someone out there can give some advice as to why it isnt booting.

Thanks in advance.
[Android Software Development] TheMeddlingMonk:
Hi EdwinMoq,

Sounds like the problem I'm having (trying to build TWRP for my ancient Toshiba AT100 Thrive). I have yet to solve it, but concluded the issue is that I am not building a working kernel.

Have you tried building the kernel separately and testing it with the Android Emulator?
[Android Software Development] bigsupersquid:
if you can get the device to reset into a working rom from the bad recovery boot without powering off, and your rom kernel has debugging enabled, you might be able to get /proc/last_kmsg for clues
[Android Software Development] EdwinMoq:
No, i haven't tried that. I think it is required to build the recovery with the kernel, since the kernel contains most drivers for the phone. I may be wrong though.
[Android Software Development] TheMeddlingMonk:
Yes, it will still build the kernel, but you can tell the build process to use a prebuilt kernel instead of the one built during the TWRP compile with this setting in BoardConfig.mk:

TARGET_PREBUILT_RECOVERY_KERNEL := path/to/prebuilt/kernel/relative/to/build/root
[Android Software Development] EdwinMoq:
And thats the main issue. The device doesn't boot anything as long as the compiled recovery is present, it just gets stuck and does nothing. I find it really weird, since it should at least boot into the rom. But neither the recovery nor the kernel boot if the compiled recovery is present. I don't really have how to debug it.

---------- Post added at 07:13 PM ---------- Previous post was at 07:10 PM ----------

Which comression algorithm are you using? And does the prebuilt kernel have the drivers for it?
[Android Software Development] TheMeddlingMonk:
In my case, I am just able to fit a gzipped kernel + TWRP into the recovery partition (I am attempting to build using the OmniROM 4.4 sources + manufacturer supplied kernel source and my device's recovery partition is 6MB).

If I ever get it working and want to patch the kernel (currently 2.6.39.4) up to a later version, I'll need to get LZMA working.

Unfortuantely, though, I've not yet been able to get anything to work with the kernel, so I have tried building it separately and testing with the Android Emulator. No luck getting that to boot, either, so have been sitting on it for a few weeks, mulling over what to do next.
[Android Software Development] EdwinMoq:
Have you tried to build an older twrp version?
[Android Software Development] TheMeddlingMonk:
No, I haven't, given that the recommendation in the opening post of this thread was OmniROM 4.4 or higher. My end goal is to get OmniROM 4.4 working on the tablet, though, so I need the SELinux support. I suspect my problem is in building the kernel, though, since I can't get either the 2.6.39 or 3.10 AOSP kernels to boot in the emulator (when using the config from the emulator's ICS ROM) either.
[Android Software Development] EdwinMoq:
So you don't have a working recovery for you device?
[Android Software Development] TheMeddlingMonk:
I do. It's an older version of CWM that another developer built and does not include SELinux support, so it's fine for ICS ROMs, but not suitable for my goal of porting OmniROM 4.4 to my tablet.
[Android Software Development] EdwinMoq:
You could start with an older twrp version, like 2.7.1, which supports selinux and has better chances of fitting on your tablet. Or get it to work with lzma. I managed to get the recovery to only 5.9 mb of size with lzma. Now to get it to boot...
[Android Software Development] ankar84:
Hi, Dees_Troy!

TWRP is realy great project!

I have a few questions to you.

Today I compiled TWRP 2.4.4.0 for my Onda V972.

In file BoardConfig.mk I must set partitions size, witch one can get with command cat /proc/mtd in any terminal emulator. But on my Onda V972 there is no /proc/mtd, but I have /proc/partitions

When I input command cat /proc/partitions I get size of all tablets partitions in blocks. But, as I understood, I need to put partitions size in BoardConfig.mk in bytes. So, I just multiply size in blocks at 512. Did I was right? What can happen when the size of the filled partitions wrong?

It is first question.

And second is...

I always get Unable to mount `/recovery` in TWRP shell. In recovery.log I see:

I:Can`t probe device /dev/block/nandg
E:Unable to mount `/recovery`
I:Actual block dsvice `/dev/block/nandg`, current file system: `ext4`
I:Unmounting main partitions...
[Android Software Development] C3C076:
Trying to build TWRP 2.5 but the resulted recovery image exceeds my recovery partition size by about 250kb... Any tips for stripping down the image to fit within 6 MB? (can't do anything with the kernel since no sources are available thus I am forced to use the prebuilt image)