yashsingh1/xdaforums huggingface dataset:
[Android Software Development] abdulradcliffe:
invalid operand for instruction

I am trying to compile twrp for my device ,OPPO REALME 2 (RMX1805). I have created my device tree and completed all the steps

souce buid/envsetup.sh

lunch <my-device>

when i do mka recoveryimage

it is failing and the error is:

bionic/libc/bionic/libc_init_dynamic.cpp:69:16: error: invalid operand for instruction
void** tls = __get_tls();
^
bionic/libc/private/__get_tls.h:35:47: note: expanded from macro '__get_tls'
# define __get_tls() ({ void** __val; __asm__("mrc p15, 0, %0, c13, c0, 3" : "=r"(__val)); __val; })
^
<inline asm>:1:6: note: instantiated into assembly here
mrc p15, 0, r0, c13, c0, 3
^
1 error generated.
[ 3% 217/6490] target thumb C++: libc_32 <= bionic/libc/bionic/malloc_common.cpp
ninja: build stopped: subcommand failed.
build/core/ninja.mk:157: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
[Android Software Development] XRed_CubeX:
Hi, I have compiled a twrp for a device but it cannot boot the recovery, I tried the version with which it was released then twrp-5.1 and I tried with twrp7.1 but it does not work.

Device tree: https://github.com/XRedCubeX/android_device_e506plus

Last_kmsg : See attachment
[Android Software Development] alexenferman:
Hi I am getting a busybox error while compiling TWRP : (

external/busybox/Android.mk:144: *** build/core: LOCAL_MODULE_CLASS not defined before call to local-intermediates-dir. Stop.

Android .mk an the busybox folder:

141- LOCAL_C_INCLUDES := $(dir $(busybox_autoconf_full_h)) $(BUSYBOX_C_INCLUDES)
142- LOCAL_GENERATED_SOURCES := $(busybox_autoconf_full_h)
143- $(busybox_autoconf_full_h): $(BB_PATH)/busybox-full.config
144- @rm -rf $(dir $($D)) $(local-intermediates-dir)
145- @echo -e ${CL_YLW}"Prepare config for busybox binary"${CL_RST}
146- @mkdir -p $(@D)
147-	$(hide) ( cat $^ && echo "CONFIG_CROSS_COMPILER_PREFIX=\"$(BUSYBOX_CROSS_COMPILER_PREFIX)\"" ) > $(dir $(@D)).config

Can someone help me? Thank you in advance!
[Android Software Development] ruben15prd:
Hi,

I´m trying to build twrp for sm-t110. Compilation has been finished succesfully but when try to flash recovery.img with ODIN, after 30 or 40 secs I got the following error:

XmitData Fail..

I have also tried to flash with dd through terminal emulator with no success.

Can someone help me?.

Thanks.
[Android Software Development] Xing-Xong:
[HELP PLEASE] I have ported TWRP recovery for my device but the /Data partition is not mounting and other partitions like /System is mounting and is accessible. Can anyone help me with this ? :confused: .. And also my TWRP theme is inverted upside/down .. But the touch is okay .. Just the theme got rotated 180° .. :confused:

DEVICE : MICROMAX CANVAS MUSIC M1

MODEL : Q4261

CHIPSET : MT6737M

OS : STOCK (ROOTED WITH MAGISK)

HELP PLEASE !! :angel:

---------- Post added at 11:51 AM ---------- Previous post was at 11:47 AM ----------

If you are ROOTED then .

Try flashify (for root users) available on Play Store.

https://play.google.com/store/apps/details?id=com.cgollner.flashify
[Android Software Development] ruben15prd:
I´m not able to flash with flashify, when i select: "Recovery Image" -> "Choose a file" it gets stuck and nothings appear. I keep it trying.

Thanks, I really appreciate your help. :)

---------- Post added at 09:42 PM ---------- Previous post was at 09:37 PM ----------

I have switched to my second PC, with same USB cable and ODIN 3.07 and flash was succesful, but when I try to enter in recovery mode, screen gets black and system start as usually. Maybe I can get logs from ksmg or something, to discover the error.

Step by step.

Thanks for your help. :)
[Android Software Development] Xing-Xong:
[HELP PLEASE] I have ported TWRP recovery for my device but the /Data partition is not mounting and other partitions like /System is mounting and is accessible. Can anyone help me with this ? :confused: .. And also my TWRP theme is inverted upside/down .. But the touch is okay .. Just the theme got rotated 180° .. :confused:

DEVICE : MICROMAX CANVAS MUSIC M1

MODEL : Q4261

CHIPSET : MT6737M

OS : STOCK (ROOTED WITH MAGISK)

HELP PLEASE !! :angel:
[Android Software Development] lehmancurtis:
Can anyone tell me with twrp flag enables/disables the mtp switch? I had it working, lost my data, and now can't remember how to add it back.
[Android Software Development] rr4e:
me stop the boot logo

can adb pull /tmp/recovery.log

have one failed to mmap framebuffer: Invalid argument

what's this ? :confused: what is mmap framebuffer :mad:
[Android Software Development] Royna:
Hello, I have a samsung galaxy a20e. My phone is running android 10. I have grabbed sources here :

https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni/tree/twrp-10.0-WIP

and put my device tree using a generator made by [MENTION=9769628]SebaUbuntu[/MENTION]. Here is my boardconfig.mk

DEVICE_PATH := device/samsung/a20e

# For building with minimal manifest
ALLOW_MISSING_DEPENDENCIES := true

# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := generic

TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv7-a-neon
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
TARGET_BOARD_SUFFIX := _64
TARGET_USES_64_BIT_BINDER := true

# Kernel
BOARD_KERNEL_CMDLINE := androidboot.selinux=permissive androidboot.selinux=permissive
BOARD_KERNEL_CMDLINE += skip_override androidboot.fastboot=1
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_KERNEL_OFFSET := 0x00008000
BOARD_RAMDISK_OFFSET := 0x01000000
BOARD_SECOND_OFFSET := 0x00f00000
BOARD_KERNEL_TAGS_OFFSET := 0x00000100
BOARD_FLASH_BLOCK_SIZE := 131072 # (BOARD_KERNEL_PAGESIZE * 64)
BOARD_BOOTIMG_HEADER_VERSION := 1
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/prebuilt/zImage-dtb
BOARD_PREBUILT_DTBOIMAGE := $(DEVICE_PATH)/prebuilt/dtbo.img
BOARD_INCLUDE_RECOVERY_DTBO := true
BOARD_MKBOOTIMG_ARGS += --ramdisk_offset $(BOARD_RAMDISK_OFFSET)
BOARD_MKBOOTIMG_ARGS += --tags_offset $(BOARD_KERNEL_TAGS_OFFSET)
BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOTIMG_HEADER_VERSION)
BOARD_CUSTOM_BOOTIMG_MK := $(DEVICE_PATH)/mkbootimg.mk
BOARD_KERNEL_IMAGE_NAME := Image.gz-dtb
TARGET_KERNEL_ARCH := arm64
TARGET_KERNEL_HEADER_ARCH := arm64
TARGET_KERNEL_SOURCE := kernel/samsung/a20e
TARGET_KERNEL_CONFIG := a20e_defconfig

# Platform
# Fix this
TARGET_BOARD_PLATFORM := exynos5
TARGET_BOARD_PLATFORM_GPU := mali-g71

# Assert
TARGET_OTA_ASSERT_DEVICE := a20e

# Partitions
#BOARD_RECOVERYIMAGE_PARTITION_SIZE := 55574528 # This is the maximum known partition size, but it can be higher, so we just omit it

# File systems
BOARD_HAS_LARGE_FILESYSTEM := true
BOARD_SYSTEMIMAGE_PARTITION_TYPE := ext4
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4

# Workaround for error copying vendor files to recovery ramdisk
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
TARGET_COPY_OUT_VENDOR := vendor

# Hack: prevent anti rollback
PLATFORM_SECURITY_PATCH := 2099-12-31
PLATFORM_VERSION := 16.1.0

# A/B
AB_OTA_UPDATER := true
TW_INCLUDE_REPACKTOOLS := true

# TWRP Configuration

TW_THEME := portrait_hdpi
TW_EXTRA_LANGUAGES := true
TW_SCREEN_BLANK_ON_BOOT := true
TW_INPUT_BLACKLIST := "hbtp_vm"
TW_USE_TOOLBOX := true

I typed

export ALLOW_MISSING_DEPENDENCIES=true; . build/envsetup.sh; lunch omni_a20e-eng; mka recoveryimage

And I attached the error screen.

Hoping some developer can point me in the right direction... :o
[Android Software Development] Royna:
(HELP) Error in making twrp with minimal_manifest_twrp

deleted (duplicated)
[Android Software Development] SebaUbuntu:
The build system is trying to build aosp_arm device, so it probably failed at lunching

Can you please only write lunch omni_a20e-eng ?

It should print out the error
[Android Software Development] Royna:
Typed

export ALLOW_MISSING_DEPENDENCIES=true; . build/envsetup.sh; lunch omni_a20e-eng;
[Android Software Development] SebaUbuntu:
$(call inherit-product, build/target/product/embedded.mk)

Remove this line in omni_a20e.mk, not present in Android 10 sources
[Android Software Development] Royna:
Another error

What should I do?

Should I delete this?

Edit: fixed when I deleted "prevent anti-rollback"
[Android Software Development] Royna:
Help me please [MENTION=9769628]SebaUbuntu[/MENTION], It seemed it was working, but I have encountered an error. First pic is the error screen. And the second pic is guide from google. And the third pic is what I see in omni_a20e.mk I don't know what to change in omni_a20e.mk.
[Android Software Development] SebaUbuntu:
Go to external/magisk-prebuilt/prebuilt/Android.mk and remove all "eng" words
[Android Software Development] Royna:
Including Local module tags?

It saids LOCAL_MENU_TAGS := eng
[Android Software Development] SebaUbuntu:
Change it to LOCAL_MENU_TAGS := optional
[Android Software Development] Royna:
[MENTION=9769628]SebaUbuntu[/MENTION], can you help me with this? I have another error and it seems it will be the last error... sorry to ask you so many questions...

error in attachments
[Android Software Development] SebaUbuntu:
Go to omni_a20e.mk

Find everything called "$(TARGET_BOARD_PLATFORM)" and replace it with your chipset name (I see you are building for an exynos device)
[Android Software Development] Royna:
[MENTION=9769628]SebaUbuntu[/MENTION] Ninja reports a bunch of missing files. How can I solve that?
[Android Software Development] SebaUbuntu:
export ALLOW_MISSING_DEPENDENCIES=true may help
[Android Software Development] blastagator:
Ya, I'm getting compile errors! :( I'll keep playing with it though.
[Android Software Development] lj50036:
What kind of error are you getting ?

Thx Josh
[Android Software Development] blastagator:
1) On d800 there was randomly a missing file from frameworks/native/build. Copied in that file.

Specifically phone-xxhdpi-2048-dalvik-heap.mk

2) Crashed on this:

build/core/binary.mk:698: recipe for target '/home/greg/android/omni/out/target/product/d800/obj/STATIC_LIBRARIES/libfs_mgrtwrp_intermediates/fs_mgr_verity.o' failed

make: *** [/home/greg/android/omni/out/target/product/d800/obj/STATIC_LIBRARIES/libfs_mgrtwrp_intermediates/fs_mgr_verity.o] Error 1

[MENTION=912474]Dees_Troy[/MENTION]

I believe in recovery/crypto/fs_mgr/fs_mgr_verity.c line 143:

ext4_parse_sb(&sb);

Should actually be:

ext4_parse_sb_info(&sb);

It looks like this should have been changed when superblock parsing was moved to its own file.

I shall continue my troubleshooting... going alright so far :) -- have to make adjustments to device tree.
[Android Software Development] katinatez:
No; at a stand still, trying to build for OnePlus One (bacon) but get stuck on crypto something something error. I have tried with dees_troy bacon android-5.0 branch, and omni find7op android-5.0 branch but same error I believe it has to do with the crypto mount point for our specific device, but that's a guess. Have not tried android-4.4 branch yet.

Here are my branches I am working with

https://github.com/katinatez/android_device_oppo_bacon

https://github.com/katinatez/android_device_oppo_find7op

Any ideas? Thanks for your reply.
[Android Software Development] desalesouche:
https://github.com/OpenDesireProjec...mmit/348b652a23f431f02f37e94b6ab2e7016fa877f0 hope it will help you?
[Android Software Development] katinatez:
Oh sweeeet, Is that the lenght I enter?

Or how do I find lenght for my device?

Thank You
[Android Software Development] desalesouche:
values are same for all devices
[Android Software Development] Hashbang173:
I successfully compiled TWRP for 5.0 but when I try to boot into recovery it hangs at the bootloader. I'm building for otterx
[Android Software Development] blastagator:
Did you hit any snags while building it? / Have to change anything?

What is your build environment?
[Android Software Development] Hashbang173:
Just used the source from the KindleOtterX github. Build with omni source code. Ubuntu 14.04
[Android Software Development] blastagator:
I got it building but the screen just flickers on and off twice and then black screen.

Progress though!
[Android Software Development] juliusssss:
Yes, i have the same problem with some devices :( :(
[Android Software Development] blastagator:
I think it might be something to do with sepolicy configuration. I am having similar issues with G2.
[Android Software Development] juliusssss:
When i compiled for the first time (with three differents devices) i had problems with this line in /external/sepolicy/domain.te :

# Restrict context mounts to specific types marked with
# the contextmount_type attribute.
[B]neverallow domain {fs_type -contextmount_type}:filesystem relabelto;[/B]

I fixed it and i compiled the recovery without errors but when i enter in recovery it don't recognize the partitions and i get an error creating fstab.

I compiled TWRP 2.8.1 for these devices and they works fine.
[Android Software Development] blastagator:
Ya that line gave me an issue to. There are definitely selinux issues, I think device side. I'm going to play with it more hopefully this evening. On mine I use twrp.fstab and at boot it isn't copying the fstab over and mounting with that. So I'm pretty sure there are permission issues.
[Android Software Development] yuweng:
On my old MTK, 2.8.2.0 on android-5.0 doesn't boot at all even with commenting line 297 of external/sepolicy/domain.te while a XDA friend with a newer MTK got it build by doing the same thing & got the first MTK TWRP Official Build . . . :good:

And i notice with a quick google search, there aren't many 2.8.2.0 build anywhere except for official build so my conclusion : kernel not compatible, idk . . . :o

Try this it boots on my MTK, tested so far, no symlink at adb shell, gotta use busybox ls, couldn't backup image only ext4 so waiting patiently for official merge . . . :cowboy:

Updates

Officially Merged as of today . . . Thank you so much Master Shifu Dees_Troy, working flawlessly . . .
[Android Software Development] desalesouche:
twrp 2.8.2.0 for huawei honor (u8860) and u8800pro

ok i got some progress, inetrnal sd and sd card are showing now and i got mtp working...

but recovery is still not stable

and here is recovery log errors :

__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!

__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!

I:Could not check /cache/recovery SELinux contexts, using /sbin/teamwin instead which may be inaccurate.

E:Cannot load volume /misc!

I:Unable to create /cache/recovery folder.

E:TWFunc::Copy_Log -- Can't open destination log file: '/cache/recovery/log'

I:Copying file /cache/recovery/log to /cache/recovery/last_log

I:Can't unlink /cache/recovery/command

E: DataManager: output_Version -- Unable to make /cache/recovery

any idea how to fix?

recovery.fstab = http://pastebin.com/Ki1h0CvR

http://pastebin.com/v0AFw5jK

thanks all.
[Android Software Development] :
what worked for me,

comment out sepolicy entry/sections in device.mk's including -common sources and either zip or remove the sepolicy directories in those

device_ directories go into out and delete target, re-lunch and run mka/make recoveryimage again.

built out for galaxy tab 3 & 4 10.1 successfully, no issues.

m
[Android Software Development] desalesouche:
§Hi sir , may i ask you if you have working charging animation while device is off and plugged with usb or charger?
[Android Software Development] :
when on stock rom yes, when on custom rom it varies, the custom rom animations were sized/oriented wrong

and when using 4.4.2 samsung kernel sources i get the white battery image and screen remains lit.

for my recoveries i use 4.2.2 kernel sources and then everything goes pretty well.

for selinux in 4.2.x sources enable xattr support, enable selinux, enable selinux boot parameter, set that parameter to 0

and set default security module to selinux.

though on the last one i have set it to unix discretionary access controls and had no issue.

i'm not sure of the sense in a custom recovery being tainted with selinux.

m
[Android Software Development] Royna:
[MENTION=9769628]SebaUbuntu[/MENTION], what is the difference compiling twrp with userdebug or eng?
[Android Software Development] XRed_CubeX:
Never build an userdebug build, recovery needs eng because adb it's insecure (good thing for a recovery because you can't confirm adb authorize on recovery) and automatically enabled and authorized
[Android Software Development] Royna:
That is the reason why the recovery compiled as userdebug did not boot. But I don't have necessary files to build eng. What should I do?
[Android Software Development] XRed_CubeX:
On vendorsetup.sh add "add-lunch-combo omni_(device)-eng"
[Android Software Development] Royna:
I already have that in vendorsetup.sh .....

I am encountering lib error. error screenshot in attachments

If I build with user of userdebug, this error doesn't appears

[FIXED]
[Android Software Development] Royna:
I successfully built twrp. But when I put it on my phone, it bootloops. How can I get the logs?

What I am thinking :

1. Flash stock recovery.

2. Flash TWRP made by me.

3. While bootlooping, it will generate a log.

4. Flash stock recovery to boot into system.

5. Root phone without wiping /cache.

6. Start adb with root permissions.

7. Do 'adb pull /cache/recovery/last_ksmg' via connecting my phone to pc.

8. I got the log.

Will it work? Or tell me a better way to do that.

I am using samsung galaxy a20e, android 10

Edit: It worked. Now I need someone to debug it because I don't know well

Last_kmsg : https://pastebin.com/ns1QXdjS

Last_log : https://pastebin.com/uh0fEnar
[Android Software Development] kakarotvn:
Hello all, is there anyone can help/guide to add feature repair file system to the existing twrp build?

At this time the twrp made by wzsx150 for redmi k30 pro is lacking of this feature. My phone is getting stuck with the encryption /data partition and can not format, wipe, or install anything
[Android Software Development] tek3195:
Take recovery for similar redmi that is fully working and port with yours in AIK.

EDIT: sorry , wrong thread. I thought this was in one for porting without source. my apologies.
[Android Software Development] lehmancurtis:
I've got a successful port that I would like to submit for the official building. https://github.com/lehmancurtis147/android_device_alcatel_U50A_ATT.git -b twrp

For tcl tetra
[Android Software Development] mauronofrio:
Minimal is not ready for now
[Android Software Development] Royna:
What's wrong here? What file should I look? I'm confused...:confused:
[Android Software Development] alexenferman:
Ok, I compiled a TWRP image for the ZTE Avid Plus, and of course, the bootloader is unlocked.

When I boot to Recovery, it stays on the ZTE logo for a few seconds (The boot is initialized) and then it just restarts again to recovery, ending in a loop.

What could cause this? How can I capture logs?

Edit: Could this be SELinux enforcing issues?
[Android Software Development] Royna:
Did you use prebuilt kernel? It may not work

Compile kernel with source
[Android Software Development] alexenferman:
I looked at the SELinux status and it says it is Premissive.

I think I know what I messed up, it's the partition sizes.
[Android Software Development] kakarotvn:
My redmi k30 Pro using EU firmware. But i can not install zip mod for center clock due to system is mounted as read only i guess. Even i have uncheck mount system partition as read only. But it is still happening :)) anyone know how to fix it?
[Android Software Development] palmbeach05:
Translation - my post is entirely unrelated to the topic of this thread.
[Android Software Development] kakarotvn:
I mean, the twrp which i am using is unofficial and maybe it is having some issue there.
[Android Software Development] palmbeach05:
Ok, but this thread is how to compile twrp recovery. not twrp support for a twrp that someone built that has issues. you need to take it up with the maintainer of your twrp, official or not, in your device community
[Android Software Development] kakarotvn:
Hmm so sorry for my mistake. Actually i got it.... But at this time, there is no thread for the Redmi K30 Pro/Poco F2 Pro even i and thousand other guys have requested it from one month ago

https://xdaforums.com/showthread.php?t=1660354&page=2382
[Android Software Development] Spaceminer:
I synced twrp-10.0-WIP and I'm trying to build for the Moto G7 Play, but I'm getting stuck because of missing dependencies. Where do I get bootloader_message.cpp and all it's related files? I found several versions in different Github projects, but I don't know which one to use.

Error:

module init_second_stage missing dependencies: libbootloader_message //system/core/init:init_second_stage strip init
FAILED: /home/android/twrp/out/soong/.intermediates/system/core/init/init_second_stage/android_arm_armv7-a-neon_recovery/init
echo "module init_second_stage missing dependencies: libbootloader_message" && false
module init_second_stage missing dependencies: libbootloader_message
[ 12% 1249/9613] //bionic/libc:common_libc versioner preprocess include
warning: attempted to generate guard with empty availability: obsoleted = 23
warning: attempted to generate guard with empty availability: obsoleted = 21
10:10:59 ninja failed with: exit status 1

I have some questions about this too;

1. Why weren't these pulled automatically when I synced with twrp's sources if they're needed to build twrp?

2. Why doesn't Omni's readme files say that this is needed?
[Android Software Development] MOTO E 2020 User:
Bought Moto E 2020. Unsupported by TWRP and unsupported by LineageOS.

Goal: Compile TWRP and LineageOS and have both on phone.

Step 1) (I am here)

Compile TWRP for phone, and use it to back up existing phone image so that if I subsequently fail at compiling LineageOS and it doesn't work, I can use TWRP to recover.

Instructions:

"If you are using CM/LineageOS, you'll need to place TWRP in the LineageOS/bootable/recovery-twrp folder and set RECOVERY_VARIANT := twrp in your BoardConfig.mk file. "

I plan to eventually use LineageOS but I want to just compile and install TWRP first without LineageOS. What is the 'TWRP' that I would put there? I cloned twrp. I want to make just that. Is that wrongheaded?

Step 2) ( if I ever get past step 1 ) Compile and install LineageOS for my phone using TWRP.
[Android Software Development] TheDevelopper:
I have ported an Android 9.0 twrp successfully from a 6.3'' device to my 6.22'' device, it works fine and I can flash stuff but the display size isn't compatible, so, how can I modify it in order to be a 6.22'' display?

Any help please, that will be generous.
[Android Software Development] palmbeach05:
Yeah, stop porting and build from source.