yashsingh1/xdaforums huggingface dataset:
[Android Software Development] DiamondJohn:
Its been a while since I was builtding, but I was building multiple ROMs. I use to use virtual drives on portable drives. Further to this, I had the ROM code on a different partition, which was a different file on the drive (and aalso a different drive), and mounted the ROM partition when needed at the desird location. There are also lots of articles on how to shrink virtual drives (I use Oracle VBox and am assuming you use the same). Also, having the ROM on a different partition meant if the ROM was small (as is with TWRP), I could simply delete and re-create that single partition, without affecting the system dirve. I also had different system drives (ie virtual; machiones) using the same ROM partition at different times.
[Android Software Development] tyler19820201:
Just an advice: do not use VM for twrp developing...I was also trying it. Lot of hassle...I think better to do on native system. But it is up to you. I have trial boot: Win10 Archlinux and Kubuntu20.04. Doing development only at debian...
[Android Software Development] tyler19820201:
Device tree: https://github.com/tyler820201/OnePlus8T/tree/OP8T20210530

Vendor tree: prebuilt

Kernel Source: prebuilt

Error log: https://del.dog/epemetylop.txt

As this should be an insufficient RAM capacity regarding googling i was trying:

make clean && make -j# recoveryimage (reducing j# number. I was trying j# 1 2 3 4)

However i have 16GB DDR3 RAM in my laptop and regarding system monitor does not use it much during compilation process. I am using kubuntu 20.04LTS
[Android Software Development] ineedroot69:
i fix it apparently you just need to use disk defragmenter created for ubuntu from 89GB to 52GB also there's provably a better way since it took me 3 hours to defragment it manually
[Android Software Development] ineedroot69:
should i compile it for you?
[Android Software Development] tyler19820201:
if you can...yes.

modell number is KB2000 just in case if u need...
[Android Software Development] ineedroot69:
sorry for really late reply i went on hawaii for vacation does this phone have recovery partition?

cuz you can use different command for it ....

mka recoveryimage ~> twrp for device with recovery partition

mka bootimage ~> twrp for device without recovery partition
[Android Software Development] tyler19820201:
it has recovery partition.

fastboot flash recovery_a & fastboot flash recovery_b filename.img

so u need mka recoveryimage

Good luck for build...If u can build i am happy to assist you with testing.

However nobody could build a fully working version of twrp for this phone yet...
[Android Software Development] edward0181:
I re want to help building for Samsung a12 sm-a125F and do understand it works differently on ramdisk partitions with Samsung. Is there a guide for how to compile on this device?
[Android Software Development] bhanu9009:
I want to build twrp for Android 11 for a specific device.

I have build tree with me.

GitHub - omnirom/android_bootable_recovery at android-11

Contribute to omnirom/android_bootable_recovery development by creating an account on GitHub.

github.com

the code above looks like AOSP a11 there is code added related to twrp in above project..

How to build for android 11?
[Android Software Development] Badli789:
just want to ask where can i get my samsung device source code
[Android Software Development] albatron34000:
i builded twrp for android 11 from porting officiel twrp Android 10 using AIK

the only problem i have is data encryption, when i wipe data recovery work fine

but when setup device and data been encrypted irecovery stuck at blinking twrp logo

and to enter recovery i must erase data using fastboot then reboot to recovery.

how can i fix this ?
[Android Software Development] edward0181:
For some stupid reason, I can't get my recovery image to boot in Emulator... always the same issue on kernel syncing;

Failed to execute /init (error -8)
Starting init: /bin/init exists but couldn't execute it (error -8)
Starting init: /bin/sh exists but couldn't execute it (error -8)
Kernel panic - not syncing: No working init found. Try passing init= option to kernel. See Linux Documentation/admin-guide/init.rst for guidance.

Call Trace:
dump_stack+0x57/0x86
panic+0xe6/0x24b
? rest_init+0xbc/0xbc
kernel_init+0x119/0x131
ret_from_fork+0x1f/0x30
Kernel Offset: 0x21a00000 from 0xffffffff80200000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
Rebooting in 5 seconds..

Donna wanna risk bricking my phone by flashing the recovery image untested.

ps. It's a Samsung device (a12) which needs a ramdisk-recovery normaly.

nevermind if I make a bootimage or recoveryimage with TWRP, the emulator just doesn't want to start.
[Android Software Development] AceSheep:
I can't compile on AOSP Android 11. When I use the manifest of twrp-10 (android 10) all is ok, can compile just fine. I tried both manifests and both stopped working after compiling the manifest

Is the manifest still not complete, or am I missing something?

https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp -b twrp-11

https://github.com/omnirom/android_bootable_recovery -b android-11

Device tree: https://github.com/itzmonvw124/xiaomi_twrp_device_camellia

============================================
ninja: no work to do.

#### build completed successfully (4 seconds) ####
[Android Software Development] edward0181:
Do have the same issue. In the end ninja has no work to do...
[Android Software Development] daboross:
Edit: I've gotten help from the TWRP Zulip (linked in readme of https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp). No longer need assistance here. See edit at end of message.

Is there any way to build TWRP for a new device without binary blobs?

I'm trying to build for a device on the SM4350 platform, and A) no stock rom is available, B) no custom ROMs have been ported yet, and C) there are no other older devices on the same SM4350 platform with either of those two :(

I've been trying to modify an existing android_device repository into one for my device (https://github.com/daboross/android_device_oneplus_holi), but I'm not having a lot of luck.

Since I'm basing it off of the oneplus_fajita manifest, there are some leftover references to common device files. If I leave those in, I get a failing build - since, well, they don't match my device configuration.

But if I take them out, I get the following error upon running "mka recoveryimage":

$ mka recoveryimage
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=16.1.0
TARGET_PRODUCT=aosp_holi
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm64
TARGET_ARCH_VARIANT=armv8-2a
TARGET_CPU_VARIANT=cortex-a76
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.13.0-0.rc6.45.vanilla.1.fc34.x86_64-x86_64-Fedora-34-(Workstation-Edition)
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ1A.210205.004
OUT_DIR=out
============================================
[ 99% 282/283] finishing build rules ...
FAILED:
In file included from build/make/core/main.mk:1327:
In file included from build/make/core/Makefile:5574:
vendor/twrp/build/tasks/kernel.mk:104: error: BOARD_KERNEL_IMAGE_NAME not defined..
02:31:30 ckati failed with: exit status 1

#### failed to build some targets (37 seconds) ####

I'm using https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp, as my device comes stock with Android 11, so it seemed best to use an Android 11 recovery rather than one older than the device. Maybe I should use the omni-9.0 branch? But I don't know if that would work either without vendor blobs...

Any and all advice or help is appreciated.

Edit: that exact error may have been because I removed the prebuilt kernel without providing a new one.... So - any advice on adding rules to build a fresh kernel or prebuilt kernel for Android 11?

Edit: If I re-include the prebuilt kernel image, it compiles, but does not produce a recovery.img. Any advice or things I'm obviously missing in that repository right now?

Edit: I've gotten help from the TWRP Zulip (linked in readme of https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp). No longer need assistance here.

What I had wrong was A) BOARD_USES_RECOVERY_AS_BOOT was set, which means it generates boot.img instead of recovery.img, and B) the base repo I used (https://github.com/TeamWin/android_device_oneplus_fajita) was pretty old. I'm now using https://github.com/theincognito-inc/android_device_oneplus_kebab instead.
[Android Software Development] HemanthJabalpuri:
I just want to share my fixes here from the error I got.

Deceyption failed but boots to TWRP for Realme Narzo 20 RMX2193 Android 10 with following in recovery.log

I:File Based Encryption is present
fscrypt_initialize_systemwide_keys returned fail
fscrypt_initialize_systemwide_keys returned fail
fscrypt_initialize_systemwide_keys returned fail
I:Setting up '/data' as data/media emulated storage.

I have fixed it with below flag

PLATFORM_VERSION := 16.1.0

See this commit https://github.com/HemanthJabalpuri...mmit/93ae5bd11ab8328a6e458abb10d66a8902516808

Also many Mediatek devices have non standard decryption process, so we have to refer to more trees for working of decryption

Here are some of working decryption trees

- https://github.com/TeamWin/android_device_redmi_begonia

- https://github.com/Redmi-MT6768/omni_device_xiaomi_merlin

- https://github.com/HemanthJabalpuri/twrp_infinix_X687

- https://github.com/HemanthJabalpuri/twrp_realme_RMX2185

- https://github.com/ADeadTrousers/twrp_device_Unihertz_Atom_LXL
[Android Software Development] Aitra:
So what about MT6853 on Realme Q2 brother? Can it decode well? I very much hope there will be TWRP released on MT6853.
[Android Software Development] rohitrss:
The guide on 1st page still valid or there is an updated version somewhere in the thread? I am asking this because it says "Omni 9.0 is recommended for now unless your device has a super partition" but what if device is on Android 11 even in that case I should use android-9.0 branch or I should use android-11 branch only?

I want to port TWRP for Galaxy M40 with Android 11 installed.

Any tips/suggestions would be really appreciated as I am gonna do this for the first time.
[Android Software Development] Frank_Dpunkt:
How can I contact someone from the development team to get support?

I have made a stupid mistake.
[Android Software Development] tagcart:
I also was having this problem and found that you must add the BOARD_RECOVERYIMAGE_PARTITION_SIZE flag in your BoardConfig.mk.

I believe it is a new requirement in android 10 and up. I found the solution here: https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp/issues/2#issuecomment-890281986

Here is how you calculate the value of BOARD_RECOVERYIMAGE_PARTITION_SIZE for your device. Obviously do not use the values in the example below:

Connect to your device with ADB shell

gts7lwifi:/ $ ls -l /dev/block/by-name/recovery
lrwxrwxrwx 1 root root 16 2019-04-12 05:57 /dev/block/by-name/recovery -> /dev/block/sda23
gts7lwifi:/ $ cat /proc/partitions | egrep 'sda23'
259 7 84852 sda23

Then

84852*1024 = 86888448

Then set in BoardConfig.mk for your device:

BOARD_RECOVERYIMAGE_PARTITION_SIZE := 86888448

With all that said, I was able to compile TWRP for Android 11 and get a recovery.img to output, but it didn't seem to work on my device (Galaxy Tab A7 Lite). After flashing with Odin, I just get a black screen when trying to enter recovery. Hopefully someone out there with more experience could shed some light!
[Android Software Development] tagcart:
So a bit of an update. I am able to get TWRP to boot but have no touch. Not backwards or up-side-down, but no input at all. Waiting on a usb c> usb adapter to show up so I can try a mouse. I rebuilt my device tree and used a BoardConfig.mk from another user as a template.

From what I have found, some devices will not load the touch drivers in recovery. However I do see that some people are able to edit the recovery kernal and change some parameters and get touch working. http://factopea.blogspot.com/2020/05/solution-mtk-to-fix-touch-not-working.html#CHKOS

I followed this along but working with 64bit instead but cant seem to find tpd_i2c_probe when i cat /proc/kallsyms. I am very new to most of this and have VERY limited knowledge when it comes to HEX.

If anyone is out there that can help, I would be so grateful. So damn grateful.
[Android Software Development] JohnFromIT:
I'm in the same boat right now on my mi 11 ultra. If anyone has any advice I would appreciate it

Device Tree

GitHub - AngryBeeSec/android_xiaomi_star_twrp: Alpha build of twrp for the Xiaomi Mi 11 Ultra

Alpha build of twrp for the Xiaomi Mi 11 Ultra. Contribute to AngryBeeSec/android_xiaomi_star_twrp development by creating an account on GitHub.

github.com

Kernel

GitHub - MiCode/Xiaomi_Kernel_OpenSource at star-r-oss

Xiaomi Mobile Phone Kernel OpenSource. Contribute to MiCode/Xiaomi_Kernel_OpenSource development by creating an account on GitHub.

github.com
[Android Software Development] Duhjoker:
im having a compiler error when trying to compile twrp for android 10 and pixel 3a sargo. it gets to about 14% percent then it says

Hastebin: Send and Save Text or Code Snippets for Free | Toptal®

Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.

hastebin.com
[Android Software Development] g465559090:
sudo apt-get install python3.8
[Android Software Development] mr_reaper:
ima try to make twrp or orangefox for nord n200
[Android Software Development] mdbshuvo:
So, a noob question here, my device has a super partition, what should I use instead of Omni 9.0.
[Android Software Development] Fytdyh:
So I got an 2.8 twrp. How can I update it to the latest version of twrp (3.6)? The device in question isn't officially supported, it's a Huawei Mediapad m5 lite (BAH2-W19).
[Android Software Development] a-dead-trousers:
Searching the Internet for an "unofficial" release someone else made and made it available for download.

Creating your own TWRP release by setting up a device tree, exporting/importing the latest kernel from your stock rom and compling it. See the first post and various other guides on the internet on how to do that.
[Android Software Development] Elips.Busdc:
I can compile a twrp.img, and it can boot my device by command "fastboot boot twrp.img".

how can I compile a twrp.zip that use for flash the twrp recovery to my device?

thanks.
[Android Software Development] a-dead-trousers:
try "fastboot flash recovery twrp.img" ;)

If you want to flash a newer version from within twrp you need to switch to "Image" (Under "Install")
[Android Software Development] Elips.Busdc:
thanks for your answer, but i got bad news!

run command "flash recovery twrp.img" fail: can't write recovery partition. run command "fastboot flash boot twrp.img", my device reboot to twrp olny, can't reboot to android.

install twrp.img in twrp, using install image and update ramdisk, my device can't start normally, just looping in "android" screen.

So what I'm interested in is, how do I compile a .zip upgrade package like the official TWRP release
[Android Software Development] Travisholt92:
Have you tried the button that says "install this TWRP" ramdisk doesn't work for me either and this is the route that works for us. Also you need to disable verity and verification with a vbmeta flash

(It might be multiple vbmeta partitions depending on your device. Mine for instance has vbmeta and vbmeta_system)

because you're modifying the contents of a partition that has an AVB signature
[Android Software Development] a-dead-trousers:
Sounds like an A/B device then. Sorry, I don't know how to setup those but I think it requires you to "combine" boot and recory into one image to flash (like super containing system, product and vendor)

There is also an official img release for installation with fastboot. The zip is for installation from within recovery.
[Android Software Development] Travisholt92:
Needs flag "board_uses_recovery_as_boot :=true" also make bootimage instead of make recoveryimage

twrp_n200/BoardConfig.mk at 2c863de74f26c8381bb24a4ae935c7fe0fdc3876 · Travisholt92/twrp_n200

Contribute to Travisholt92/twrp_n200 development by creating an account on GitHub.

github.com

Here is my tree for reference (gki-5.4 msm-holi/sm4350)
[Android Software Development] Elips.Busdc:
"Flash current TWRP" button can work!

I think i should read the source code to learn more about the function of this button.

thank you very much!
[Android Software Development] Sayujya_Bagchi:
Can u make it for lenovo tab m7 tb-7350f please anyone
[Android Software Development] Travisholt92:
Kernel source for this is available from Lenovo on their website
[Android Software Development] C0rn3j:
Your first link to android_bootable_recovery has the correct text but wrong hyperlink.

"You can currently use Omni 6.0, Omni 7.1, Omni 8.1, Omni 9.0, CM 13.0, CM 14.1, CM 15.1, LineageOS 16.0 source code. Omni 9.0 is recommended for now unless your device has a super partition."

It would be nice to include a recommendation for what to do in case it does have a super partition. I am assuming latest?
[Android Software Development] moocow1452:
If one wanted to try and compile TWRP for the Oculus Go, but the unlocked firmware provided by Facebook only gave access to /boot and /system and the Go is set up as a legacy SAR device, is there anything that would be able to be done with it, or am I pretty much SOL?
[Android Software Development] Tokth:
I am new and looking to create the twrp recover images for my Moto G Stylus 5G 2022 (MilanF). I know there are twrp files for the 2021 model (Denver/Osaka). Are is it a good idea to use these as a base for my attempt or should I try to compile from scratch?
[Android Software Development] tek3195:
Never flash files not made for your device. You could use the 2021 model (Denver/Osaka) device trees as a base to start editing and build from source maybe. Talk to the dev for that device, they will know what you need.
[Android Software Development] Tokth:
My intuition told me I would have to compile from sources using last year's model as a starting point.

As for the dev for my specific device, I'm not certain there is one.
[Android Software Development] tek3195:
I meant the dev for last years model. Depends on how much they changed between years.
[Android Software Development] JengaMasterG:
Hello! I'm hoping to find somebody who could help me out with developing TWRP for the Microsoft Surface Duo. I'm having trouble with getting touch to work. I have the vendor blobs and device tree, but I'm not sure what I'm missing.

I'm using 11.0 minimal branch from TeamWin to build TWRP. It boots up on the device, but touch doesn't work and dm_verity is on so /data can't be accessed and system can't be mounted.

Here are the vendor blobs:

GitHub - JengaMasterG/vendor_microsoft_duo at surfaceduo/11/2022.215.137

Vendor Blobs for Microsoft Duo. Contribute to JengaMasterG/vendor_microsoft_duo development by creating an account on GitHub.

github.com

Here is the device tree:

GitHub - JengaMasterG/device_microsoft_duo at 11.0

Device Tree for Microsoft Surface Duo. Contribute to JengaMasterG/device_microsoft_duo development by creating an account on GitHub.

github.com

Any help is appreciated! Thanks!

Edit: I've uploaded the logs I have been pulling from the TWRP build

Surface_Duo - Google Drive

drive.google.com
[Android Software Development] tek3195:
Check TWRP Building Support Group on telegram. If you fill out their error template you should get the help or answers you need.
[Android Software Development] JengaMasterG:
I'm getting help on the Zulip support page!
[Android Software Development] ues_t:
I am confused about my device tree, can you please help me to see the current parameters

For example USB.qcom.rc I don't know where this file came from

GitHub - x1906875173/android_device_oneplus_negroni

Contribute to x1906875173/android_device_oneplus_negroni development by creating an account on GitHub.

github.com
[Android Software Development] Travisholt92:
android_device_oneplus_negroni/device.mk at 4621e5d7260d6b6a5669e592496ac8c875c06c63 · x1906875173/android_device_oneplus_negroni

Contribute to x1906875173/android_device_oneplus_negroni development by creating an account on GitHub.

github.com
[Android Software Development] ues_t:
Thanks for the reminder, but I don't understand what the problem is, hope it can be pointed out
[Android Software Development] Travisholt92:
You haven't provided any information about your problem aside from your device tree. Nobody is going to look through your device tree and pin point your "problem" without knowing what the problem is. Please provide additional information about your issue. Feel free to PM if you'd like.
[Android Software Development] XRed_CubeX:
it is extracted from boot.img
[Android Software Development] ddogishere:
Hello, can someone help me build twrp for MINIX u22 xj max (s922). Thanks.
[Android Software Development] Malvik:
Hey, I just build a twrp recovery for fossil gen 6 but stuck on the loading screen, adb shell is accessible. Can anyone help with it ?
[Android Software Development] PattasuBalu:
17:03:20 ************************************************************
17:03:20 You are building on a machine with 15.5GB of RAM
17:03:20
17:03:20 The minimum required amount of free memory is around 16GB,
17:03:20 and even with that, some configurations may not work.
17:03:20
17:03:20 If you run into segfaults or other errors, try reducing your
17:03:20 -j value.
17:03:20 ************************************************************
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=11
TARGET_PRODUCT=aosp_arm
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=generic
HOST_ARCH=x86_64
HOST_2ND_ARCH=x86
HOST_OS=linux
HOST_OS_EXTRA=Linux-5.15.0-47-generic-x86_64-Ubuntu-22.04.1-LTS
HOST_CROSS_OS=windows
HOST_CROSS_ARCH=x86
HOST_CROSS_2ND_ARCH=x86_64
HOST_BUILD_TYPE=release
BUILD_ID=RQ1A.210205.004
OUT_DIR=out
PRODUCT_SOONG_NAMESPACES=device/generic/goldfish device/generic/goldfish-opengl
============================================
[100% 1/1] out/soong/.bootstrap/bin/soong_build out/soong/build.ninja
FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -l out/.module_paths/Android.bp.list -b
out/soong -n out -d out/soong/build.ninja.d -globFile out/soong/.bootstrap/build
-globs.ninja -o out/soong/build.ninja Android.bp
***************************************************************************
Could not find ui.xml for TW_THEME: not set
Set TARGET_SCREEN_WIDTH and TARGET_SCREEN_HEIGHT to automatically select
an appropriate theme, or set TW_THEME to one of the following:
landscape_hdpi landscape_mdpi portrait_hdpi portrait_mdpi watch_mdpi
****************************************************************************
(theme selection failed; exiting)
17:03:20 soong bootstrap failed with: exit status 1

#### failed to build some targets ####

I am getting this error while compiling i double check TW_Theme
[Android Software Development] lij62279:
Hello, can someone help me build twrp for S905X4. Thanks.