yashsingh1/xdaforums huggingface dataset:
[Android Software Development] inmist:
Thanks!

Thanks.

Is it really unnecessary to copy the vendor files?

I'm twrp build newbie, so check my progress.

1. repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-6.0

rep sync -j4

2. copy samsung s7 edge korea version files(device tree, kernel)

device tree path : /device/samsung/hero2ltekor/

--> (This file was cloned via github. -url : github.com/jcadduono/android_device_samsung_hero2ltekor)

kernel source path : /kernel/samsung/hero2ltekor/

--> (This file was cloned via github. -url : github.com/jcadduono/android_kernel_samsung_universal8890.git)

3. open terminal & command execute

source build/envsetup.sh

lunch

mka recoveryimage

4. Result

I'll ask for confirmation. Thanks in advance.
[Android Software Development] danerrickcuba@gmail.com:
can you please also help me build a device tree for my device?can u guide me where to to do this?

i have went through lots of youtube videos, most are incomplete as subsequent parts are promised but never uploaded!!

any tips please.
[Android Software Development] kirito9:
What is your device chipset?
[Android Software Development] danerrickcuba@gmail.com:
SM T365 (samsung galaxy tab active)(model)

rubenslte(codename)

Qualcomm 400 snapdragon quad 1.2qhz

1.5gb RAM

ro.product.board=msm8926

ro.board.platform=msm8226

I have source code from samsung, and this device is exactly same as samsung tab 4(8",7",10.1"), exception is screen dimensions, battery and if 3G,LTE or only WI-FI

Edit:

With all my exhaustion and repeated fails,I was thinking of going to device tree for the other galaxy tab 4, download the source, and since hardware wise they're perfectly the same, then change codename, models and mount points for /data /system /userdata etc....

But I don't know if this will work, can I port device tree? Then use this ported tree to work on my device?

...you can please, if possible walk me through,I can download sources,or any data needed to accomplish this, I'm currently on bbqlinux OS.
[Android Software Development] brMIKA:
compilation errors

hi, i followed this guide and tried to build a twrp using adapted Minimal device tree, but i cannot build he gave this error:

bootable/recovery/minuitwrp/graphics_overlay.cpp:265:18: error: no member named 'heap_mask' in 'ion_allocation_data'; did you mean 'heap_id_mask'?
ionAllocData.heap_mask =
^~~~~~~~~

you can help me? I'm a newbie

device tree:https://github.com/brMIKA/android_device_samsung_kmini3g
[Android Software Development] pozidrivphil:
Hi,

I've been reading and learning a lot these last couple days about compiling, but I seem to get stuck at the second part of the guide; the device sources. I'd like to compile TWRP for the Samsung XCover 4 (SM-G390F), I've found the kernel here:

http://opensource.samsung.com/reception/receptionSub.do?method=sub&sub=F&searchValue=g390

But where can I find the device tree, or can anyone point me to a good guide to make one myself (is this even feasable for a beginner).

Thanks a lot for all the information provided!!

Edit: I've tried tools extracting it from boot.img and recovery.img, but that doesn't seem to work.

details:

ro.product.board=universal7570

ro.product.cpu.abi=armeabi-v7a

ro.board.platform=exynos5

ro.chipname=exynos7570
[Android Software Development] NepoRood:
Figured I'd answer here, instead of the other TWRP thread...

The only flag TWRP really needs to compile, is the "theme" flag. However, other information will help the process :good:

Jump on Github and look for any other Samsung device with an Exynos chip and working TWRP, then compare to your device for similarities. I've never built for Samsung, but I've done some obscure builds for some generic devices. Making a device tree isn't "easy", per say, but it's not impossible.
[Android Software Development] pozidrivphil:
Thanks a lot for your reply! Yesterday I thought I'd never get this done, but now there's hope ;) I think I found a great device tree here: https://github.com/Siddhant-Naik/android_device_samsung_on5xelte

I went through all the files line by line and changed what I thought appropriate (which wasn't all that much tbh)

However, when I try to compile I get

build/core/base_rules.mk:157: *** frameworks/native/cmds/dumpstate: MODULE.TARGET.STATIC_LIBRARIES.libdumpstate.default already defined by frameworks/native-caf/cmds/dumpstate. Stop.

Edit: fixed by deleting native folder, this gave an error after a while, something to do with battery, so I then deleted native-caf. Still compiling, keeping my fingers crossed. Strange how excited I am over this...
[Android Software Development] pozidrivphil:
Well...

It actually compiled and spewed out a recovery.tar. Incredible. Yay. But...

Yeah, I bricked my phone...

It booted up and said it couldn't pass verification and I had to reset, (that also happened after rooting) so I thought no big deal and hit the reset button. Now it doesn't respond to any buttons, unless I pull out the battery and then boot up in download mode. I'm now downloading the stock image from sammobile, hoping this'll fix the phone.

Any ideas to what could've gone wrong? I thought after compiling I was home free.
[Android Software Development] NepoRood:
You should have deleted the "frameworks/native-caf" folder, and any other CAF folders, you don't have a CAF device ;)

CAF=Code Aurora Forum, which is for Qcom devies.

Remove all CAF related folders, then make clean and build again
[Android Software Development] pozidrivphil:
Yes, I couldn't compile with the native-caf folder, so I deleted it and it compiled just fine. TWRP doesn't work however, in fact my phone is bricked (see previous post).:highfive:

This is the device tree I made: https://github.com/yahooboohooyah/SM-G390F-Samsung-XCover4-device-tree

My vendor folder is empty (apart from the omni folder that was already there), don't know if that's an issue?

Could there be a problem with my dt.img (it's the one from the Galaxy J5 prime)?

Also it's a nougat phone 7.0 and my java:

openjdk version "1.8.0_131"

OpenJDK Runtime Environment (build 1.8.0_131-8u131-b11-2ubuntu1.16.04.3-b11)

OpenJDK 64-Bit Server VM (build 25.131-b11, mixed mode)
[Android Software Development] pozidrivphil:
So I had my kernel in the folder /kernel/samsung/SM-G390F and it compiled fine, I got a recovery.tar which bricked my phone. I now changed this folder to /kernel/samsung/xcover4lte and now I get an error:

preparing StaticLib: libc_common [including /home/theseus/TWRP/out/target/product/xcover4lte/obj/STATIC_LIBRARIES/libc_stack_protector_intermediates/libc_stack_protector.a]

target Prebuilt: (/home/theseus/TWRP/out/target/product/xcover4lte/kernel)

acp: missing destination file

build/core/tasks/kernel.mk:284: recipe for target '/home/theseus/TWRP/out/target/product/xcover4lte/kernel' failed

make: *** [/home/theseus/TWRP/out/target/product/xcover4lte/kernel] Error 2

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

preparing StaticLib: libc_common [including /home/theseus/TWRP/out/target/product/xcover4lte/obj/STATIC_LIBRARIES/libc_syscalls_intermediates/libc_syscalls.a]

preparing StaticLib: libc_common [including /home/theseus/TWRP/out/target/product/xcover4lte/obj/STATIC_LIBRARIES/libc_thread_atexit_impl_intermediates/libc_thread_atexit_impl.a]

preparing StaticLib: libc_common [including /home/theseus/TWRP/out/target/product/xcover4lte/obj/STATIC_LIBRARIES/libc_tzcode_intermediates/libc_tzcode.a]

target StaticLib: libc_common (/home/theseus/TWRP/out/target/product/xcover4lte/obj/STATIC_LIBRARIES/libc_common_intermediates/libc_common.a)

I tried to manually create a kernel folder in /out, but to no avail..

I imagine that the compiler couldn't find the kernel in the original folder, but it still compiled a recovery.tar, is this possible?
[Android Software Development] NepoRood:
First, what source are you using (Lineage/CM or Omni)?

Second, you need your dt.img from your device.

And 3rd, you need to compile and flash a recovery.img, which should be in your out folder once make has completed successfully.
[Android Software Development] pozidrivphil:
I'm using omni.

I spent the weekend trying another route, namely porting TWRP. I actually got TWRP booted, but there was something wrong with the partitions, nothing could be loaded, a bunch of errors.

So I went back to compiling. (I'll give some detail here for other users). I extracted the stock recovery.img from the phone, then used carliv image kitchen and extracted kernel.img and dt.img and looked at the kernel info file. Now I placed these files in my device tree folder and edited boardconfig.mk with the info from the kernel info file and directed it to the prebuilt kernel (this way i didn't need the samsung source kernel files)

TWRP boots!! :D:D

But of course this ain't the end of it. There's a verification error, which can probably be solved, but TWRP fails to connect with my computer. ADB devices doesn't work, I get device driver errors on windows (tried a few different drivers), while linux doesn't see a thing when I plug in the phone. ADB sideload or MTP don't work either..

Any suggestions?

Thanks a lot for this topic and the help provided, can't believe I've come this far.
[Android Software Development] xDreDz:
My.. my brain is bleeding. I cant do this ( N935F )
[Android Software Development] melsawah:
Great post ! Can’t wait to twrp my Honda 2017 HU , is twrp available for 4.2.2? I did not see that in the minimal tree
[Android Software Development] tazzarias:
Hello there,

Attempting TWRP build for a Huawei MediaPad M3 Lite 8.0, model CPN-W09 tablet. I'm using the omni minimal source.

I get the below exception, not sure how to proceed next?

make: *** No rule to make target '/home/alan/omnirom/out/target/product/cpnw09/system/bin/linker', needed by '/home/alan/omnirom/out/target/product/cpnw09/obj/SHARED_LIBRARIES/libbmlutils_intermediates/teamwin'. Stop.
[Android Software Development] tazzarias:
**bump** anyone know of a workaround to the linker error?
[Android Software Development] NepoRood:
Provide a more complete log (put on pastebin or similar service) and a link to your device tree for more help, above error is not much to go on...
[Android Software Development] tazzarias:
Taking on a fun challenge, no pre-existing device tree exists for this one, so I started with the default template.

Full logs posted: https://pastebin.com/2PUzniFb
[Android Software Development] NepoRood:
It is a fun challenge and I've done it a couple times myself :good:

You should upload your device tree to Github, that way, myself and others can see exactly what you're working with.

According to the log, you don't have a recovery.fstab and with your error, you probably haven't set the path in your init.rc, for starters...
[Android Software Development] tazzarias:
OK, I'll look into the github upload ... in the meantime, I see a couple of fstabs, whose content I'm sure I'll need to refine, but I want to confirm if their location makes sense:

device/huawei/cpnw09/recovery/root/etc/twrp.fstab

device/huawei/cpnw09/recovery/root/etc/recovery.fstab
[Android Software Development] NepoRood:
Location looks correct, did you extract from the boot or recovery image of your device?
[Android Software Development] tazzarias:
I wish that extraction were possible, no one's achieved root for this device yet (not that I could find after extensive google searches), and Huawei won't make the recovery images available. Although they do make the kernel source available, which I obtained for this TWRP build attempt.

That location and pair of files are what's in the template device tree in github: https://github.com/lj50036/android_device_vendor_codename

Although I'm puzzled, if the location looks ok, why is the build reporting that it can't find it?
[Android Software Development] NepoRood:
Because the recovery.fstab is empty, have you tried using adb shell commands?
[Android Software Development] tazzarias:
Oh, that's interesting - I took the exception to mean that the file didn't exist at all.

I am populating the file with some educated guesses, I'll try the adb shell as well to see if I can gather what I need.

---------- Post added at 05:03 PM ---------- Previous post was at 04:44 PM ----------

Placed a single-row entry in there, re-tried the build, but the same message occurs. Not sure why, but the build is acting as if the recovery.fstab file doesn't exist?
[Android Software Development] DEVILOPS 007:
To add f2fs support would I just edit the board config file or do I need to do something with f2fs tools? I'm not sure how that area works. Please help.
[Android Software Development] brylant238:
I have problem with download repo, when i enter repo init minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-7.1

then is two error

fatal: manifest 'default.xml' not available

fatal: remove-project element specifies non-existent project: platform/external/aac
[Android Software Development] NepoRood:
Use this init command in your TWRP directory:

repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-7.1

For the second, remove that project from the "remove.xml" file before you sync the repositories
[Android Software Development] brylant238:
still i use the code , all time is the same error
[Android Software Development] NepoRood:
Go to your TWRP directory and type:

ls -a

Post the output here
[Android Software Development] brylant238:
krugermatz@ubuntu:~/android_move$ ls -a

. .. .repo

krugermatz@ubuntu:~/android_move$
[Android Software Development] NepoRood:
Ok, now:

cd .repo && ls -a

Again, post the output...
[Android Software Development] brylant238:
krugermatz@ubuntu:~/android_move$ cd .repo && ls -a

. .. manifests manifests.git repo

krugermatz@ubuntu:~/android_move/.repo$
[Android Software Development] NepoRood:
cd ../
# You should be at: krugermatz@ubuntu:~/android_move$
rm -rf .*

Then redo your init
[Android Software Development] brylant238:
Okay, what's next? stil is the same error when i get download repo
[Android Software Development] TimSchumi:
Reinit your repo, they force-pushed a fix, but it doesn't get picked up automatically.
[Android Software Development] kirito9:
Can confirm, got the same error before but everything is fine now.
[Android Software Development] David B.:
Before I try following these instructions, are they still up-to-date? I would like to try compiling a build of TWRP for the Nexus 6 because the current release has decryption issues with LineageOS 15.1.
[Android Software Development] NepoRood:
It's relevant enough, just follow the links and use the newer branches (which aren't listed in the OP). Also, keep in mind: For Nougat (Omni-7/CM-14) or Oreo(Omni-8/LOS-15) build repos, you need OpenJDK 8

If you run into any issues, post here and we'll try to help :good:
[Android Software Development] Elliot Anderson:
Help me,please!!

I can't compile TWRP for my phone.It's Yu Fly F9.

A new brand from china.This model with chipset snapdragon 653,ram 6gb,rom 128gb and resolution of display 1440x2560.

The OS base on android 7.1.1 is called Yu OS v1.0.

I'm not yet root it.So I hope anyone can help to me compile TWRP for it.I will greatful very much.

I'm write by English not fluently so I hope you feeling sorry for me.

Thanks you very much!!
[Android Software Development] D3AMON514:
Nice guide.i will try these instructions.
[Android Software Development] bassbounce:
When syncing the onmi source Twrp isn't in the source.

The recovery that is in the folder is the default aosp recovery...

And where can I put the device tree? The device isn't on github.

Also the kernel source is only in zip so where I need to unpack it?
[Android Software Development] NepoRood:
This is the latest stable TWRP repo, https://github.com/omnirom/android_bootable_recovery, which is based on Android 8.1 (9.0 PIe, may not be ready yet)

IF your device isn't on one of the Gits, you'll have to make your own tree, kernel goes in the "kernel/vendor/device" folder, ie: kernel/google/marlin
[Android Software Development] lehmancurtis:
What should I pass to BoardConfig.mk in order to include dt.img to ensure the device tree blobs are compiled as part of my image files?
[Android Software Development] lehmancurtis:
[Edit]Removing previous comment[/Edit]
[Android Software Development] wings110:
big thx for sharing.
[Android Software Development] JuanM2020:
Would it be the same steps for android 10? If not could you provided an updated tutorial?
[Android Software Development] palmbeach05:
Yes, just make sure you have things changed for sar compatibility
[Android Software Development] exocetdj:
having real trouble lunching for d2x (samsung galaxy n10 plus 5g)

im getting this

build/core/product_config.mk:243: *** device//d2x//omni_d2x.mk: PRODUCT_BRAND must be defined.. Stop.

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

Traceback (most recent call last):

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

fetch_device(device)

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

git_data = search_gerrit_for_device(device)

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

build/core/product_config.mk:243: *** device//d2x//omni_d2x.mk: PRODUCT_BRAND must be defined.. Stop.

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

** Do you have the right repo manifest?

despite setting up a tree

Building tree using: recovery.img

Found gzip comression in ramdisk

Making omni_d2x.mk

Making Android.mk

Making AndroidProducts.mk

Making kernel.mk

found universal9825 platform

Found 64 bit arch

Build fingerPrint:

tree ready for d2x at device//d2x

Warning :- Check recovery fstab before build

[MENTION=7187684]ianmacd[/MENTION] any ideas?
[Android Software Development] ianmacd:
The path to your device tree should be ./device/<manufacturer>/<model>, so you're missing the samsung parent directory in this case.
[Android Software Development] NepoRood:
You'll need to see if you can find a similar device (ie: same SoC) and start with that
[Android Software Development] cliverlong:
Trying to build TWRP for Samasung Galaxy tab 4 SM-T533

First, I am trying to install LineageOS 17.1 on a Samsung SM-T533 tablet.

However, I can't get TWRP to launch. I have found TWRP 3.0 for the device, I can install it using Odin 3.14, but I can't launch TWRP to try to install a LineageOS ROM - the tablet hangs "Set Warranty Bit :recovery" when I press VOLUP+HOME+POWER and does not load TWRP.

A developer suggested I try to build my own TWRP for this device.

I am following the instructions here

First , I have no knowledge of building Android applications and only basic Linux knowledge - for example I have no idea what repo init is for - so some of my statements may make "little sense" or I may have made an "obvious" mistake - hopefully I have made it clear where I am at knowledge-wise but I am trying to follow the instructions provided.

I am trying to build on a Ubuntu 20.04

1. I have successfully installed java OpenJDK 7.0 - I only got one error when I installed networkx which I installed manually

2. I have installed repo

3. I am trying to repo sync minimal sources - because the instruction say that is fine for building TWRP. When I type

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

I get error message in response to repo init

/usr/bin/env: 'python': no such file or directory

But Python is stalled in the machine. If I type "python3" at the terminal prompt I get into the python environment and see the prompt ">>>"

So I cannot proceed with the compiling of TWRP.

Can someone help?

Thanks
[Android Software Development] NepoRood:
I'm not sure if the minimal manifest will work for your purpose, I do know you need to use Python 2, however. You just need to create a symlink. Do the following in your working directory (where you are trying to compile TWRP):

mkdir ~/bin && ln -s /usr/bin/python2 ~/bin/python

Next, you need to edit your .bashrc:

nano ~/.bashrc

Add the following at the bottom:

#Python2
export PATH=~/bin:$PATH

Save and close, then source your bashrc in the working directory:

source ~/.bashrc

It's been quite a while since I've compiled TWRP, but you likely need newer sources for building...
[Android Software Development] tek3195:
Can someone tell me why I am getting this error ? I've built TWRP, SHRP and PBRP in the past as well as Lineage 17.1 and /e/OS for my device. This is a new and clean install of Ubuntu and I can't get anything to build.

FAILED: /home/tek3195/twrp/out/target/product/gts4lvwifi/android-info.txt

/bin/bash -c "(build/make/tools/check_radio_versions.py ) && (echo "board=sdm710" > /home/tek3195/twrp/out/target/product/gts4lvwifi/android-info.txt )"

File "build/make/tools/check_radio_versions.py", line 56

print "*** Error opening "%s.sha1"; can't verify %s" % (fn, key)
[Android Software Development] NepoRood:
Which version of Ubuntu? You probably need to be using Python2, instead of 3
[Android Software Development] tek3195:
It was Cinnamon Remix 20.04.1 with python2.7 and 3.8 installed same as I had before. I think it was something in the OS. I switched back to LMDE4 and everything is building good.
[Android Software Development] MaheshTechnicals:
Great post. But I have a new article. In that article you can Compile Recovery From Source. You can Compile any custom recovery using your smartphone.
[Android Software Development] Aks BRAR SOTHA:
Will

iit work for 8.1 oreo?
[Android Software Development] lehmancurtis:
Y

9 source will work for 8 and some 7
[Android Software Development] lehmancurtis:
I've used Android 9 branch of minimal manifest twrp to compile for devices ranging from 6.x to 9.0. It does sometimes require matching the specific branch, but I haven't had any not work so far.
[Android Software Development] kusti420:
which would be...?
[Android Software Development] edward0181:
Pitty there is yet no good guide on how to compile TWRP on Android-11 devices (like my Samsung Galaxy A-12)

Can compile for Android 10 without issues, but not on 11. So can;t test it, as my device is on 11
[Android Software Development] tagcart:
Hey,

So I am working on trying to port TWRP to my samsung Tab A7 lite.

Pretty new to all of this so sorry in advanced for any dumb questions.

I used TWRP device tree generator (had to change prefix of everything to twrp from omni) and Minimal Manifest for 11. I was able to create the device tree and finally lunch and compile with "mka bootimage" and it seemed to complete without error, but when I dig into out/target/product/[deviceName] I have no boot.img file.

I also tried with "mka recoveryimage" but still nothing.

Am I doing something wrong?
[Android Software Development] iftekharriyad:
@Hacker432 Couldn't download the codes for minimal sources.

repo init -u git://github.com/lj50036/platform_manifest_twrp_omni.git -b twrp-6.0
Downloading Repo source from https://gerrit.googlesource.com/git-repo
remote: Finding sources: 100% (54/54)
remote: Total 54 (delta 13), reused 54 (delta 13)
repo: Updating release signing keys to keyset ver 2.3

... A new version of repo (2.15) is available.
... You should upgrade soon:
cp /root/.repo/repo/repo /usr/bin/repo

Downloading manifest from git://github.com/lj50036/platform_manifest_twrp_omni.git
fatal: remote error:
Repository not found.
manifests: sleeping 4.0 seconds before retrying
fatal: remote error:
Repository not found.
fatal: cannot obtain manifest git://github.com/lj50036/platform_manifest_twrp_omni.git

What to do man?
[Android Software Development] DiamondJohn:
Its been a while since I compiled TWRP and used GIT, but you dont appear to have cloned the repository. and hence " Repository not found."

https://github.com/lj50036?tab=repositories

so there is no

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

Have you tried the standard source

repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-6.0

PS: you should also

... A new version of repo (2.15) is available.
... You should upgrade soon:
cp /root/.repo/repo/repo /usr/bin/repo