yashsingh1/xdaforums huggingface dataset:
[Android Software Development] $_Vladislav:
And how did you fix the error with the removal of the kernel?
[Android Software Development] ashyx:
By changing the name of the device. This is what solved it.

It seems the compiler doesn't like that name and throws a wobbler, maybe something in the sources has a similar name.
[Android Software Development] Joel16:
Hey, can someone please help me with this compilation error. Essentially I get up to the point of building the recovery image, and at 93% it fails for some unknown reason. Maybe it's just me but I don't see any errors, it just says make[2]: Nothing to be done for 'dtbs'. and exits after failing to build the kernel. While I'm knew to android rom development, I have developed for other platforms before like Unix/Linux, Nintendo Switch, PSP, 3DS etc.

I have attached a full copy of my log file.

Where the error seems to occur:

Building DTBs
make: Entering directory '/home/joel/twrp_satsuki/kernel/sony/msm8994'
CC scripts/mod/devicetable-offsets.s
GEN scripts/mod/devicetable-offsets.h
HOSTCC scripts/mod/file2alias.o
HOSTLD scripts/mod/modpost
make[2]: Nothing to be done for 'dtbs'.
make[2]: Nothing to be done for 'dtbs'.
make: Leaving directory '/home/joel/twrp_satsuki/kernel/sony/msm8994'
ninja: build stopped: subcommand failed.
make: *** [build/core/ninja.mk:152: ninja_wrapper] Error 1
make: Leaving directory '/home/joel/twrp_satsuki'

#### make failed to build some targets (10:58 (mm:ss)) ####
[Android Software Development] Micha_Btz:
twrp for zangyapro

Hi there,

I'm a beginner for twrp building for a new device. So I try to follow the guide and added

<remove-project name="LineageOS/android_bootable_recovery" />

<project name="omnirom/android_bootable_recovery" path="bootable/recovery" revision="android-8.1"/>

to my lineage 15.1 manifest, sync the repo and create first changes to board config

https://github.com/Micha-Btz/android_device_bq_zangyapro/tree/lineage-15.1-twrp

an build test gives:

Since I have set TW_THEME := portrait_hdpi in boardconfig i didn't understand this, also the busybox error confuses me. There is no busybox in my LOS tree, do I need this?

Micha
[Android Software Development] _that:
Looks like you didn't run lunch for your device, so the build process didn't pick it up.

Yes (unless you build with the toolbox option). Try adding busybox to your local manifest from an OmniROM repo.
[Android Software Development] Micha_Btz:
Thanks, now I'm a little bit further, just to stop on the next problem, it's hard to find solves for compiling errors even in this thread.

I have added busybox.

Here is something wrong with the path, even the dir is there.

~/handy/build/lineage-15.1$ fd res-xhdpi

bootable/recovery/res-xhdpi

I have grepped the whole source, but don't found a definition.

Any tipps too ?

Micha
[Android Software Development] pix106:
You synced twrp source in bootable/recovery, but with TWRP_VARIANT=twrp, it should be in bootable/recovery-twrp

I would try to sync twrp in bootable/recovery-twrp changing the path in manifest, or remove TWRP_VARIANT, but it's been a long time since I last built twrp using lineage/CyanogenMod source
[Android Software Development] $_Vladislav:
Yes, I did it! Without renaming the device! Just copied the kernel to the output folder and that's it!

Size 26,3 MB
[Android Software Development] ashyx:
I tried that, but it kept getting deleted during the build process. :silly:

Your size is the same as mine. I have managed to reduce it a few megs. Possibly could be reduced even further, but I'd check your partition size again as it seems a bit small at 20mb.
[Android Software Development] Micha_Btz:
I have renamed it, but seems to be not right, then it missed the other directory. Without TWRP_VARIANT=twrp it compioles nothing.

Don't know to get further, will try with minimal twrp repo.

Micha
[Android Software Development] pix106:
Both recoveries sources may be needed, you can try to sync without removing lineage recovery, and syncing twrp in recovery-twrp.

Minimal twrp repo is indeed a simpler build environment for twrp than lineage, imho
[Android Software Development] Micha_Btz:
since twrp minimal sync, I tried your tipp, it runs but build anything:

I still miss some really important thing, I think.

hm
[Android Software Development] pix106:
The "tip" is the normal way to build twrp source inside a lineage source.

Twrp minimal is a minimal omnirom tree with everything needed to build twrp.

Did you sync twrp minimal tree inside lineage source ?!

It's not meant to be mixed with other source :)
[Android Software Development] Micha_Btz:
No, I don't mix the sources. In Germany the internet is not so fast, sync is not finished. The LOS tree would be the best, but since I don't know why it not try to build a recovery, I had to figure out why. Maybe I get an idea with omni minimal.
[Android Software Development] pix106:
Ok, I got it bad so.

In LOS source, If you have lineage normal recovery in bootable/recovery, twrp in bootable/recovery-twrp, and RECOVERY_VARIANT in Boardconfig, source should be fine. be sure to make clean after sync.
[Android Software Development] Micha_Btz:
I have cleaned more times, but more than posted above is not happen. Did I have to change everything outside the zangyapro device repo, maybe in the Board repo

LineageOS/android_device_bq_sdm660-common ?

I need a hint, I have no idea.

---------- Post added at 17:40 ---------- Previous post was at 16:45 ----------

Worked! Since the device has no recovery partition , mka bootimage is the right one. It has some problem, /system is not mountable and device encryption doesn't work.

Now try to figure out, which fstab is used and why system is not mountable.
[Android Software Development] Micha_Btz:
most official twrp repos are using a prebuilt kernel, what are the advantages of that and how can I build such a kernel from my LOS device tree?
[Android Software Development] pix106:
Prebuilt kernel is the "already built" kernel you extract from your stock rom.

Using the kernel from stock rom is usually enough for twrp.
[Android Software Development] The_Walking_Playground:
Hi,

A prebuilt kernel is simply one that is included as a binary along with the source, rather than being built along with it. It doesn't have to be the kernel from the stock boot or recovery image, though that is typically where they originate. I have seen kernels used from Lineage or Omni source as prebuilts too.

TWP
[Android Software Development] Sassano:
Anyone can help me?? I'm building TWRP but have some error, after boot on it my screen is inverted

Edit: buttons work normally, only the screen is inverted and is unusable
[Android Software Development] ashyx:
The flags you need are posted in the OP.
[Android Software Development] $_Vladislav:
Tell me how to reduce its size?
[Android Software Development] Sassano:
Hi, I have only a TWRP.img with me, I can resolve this problem after unpacking and editing some files?
[Android Software Development] ashyx:
You can use the flag BOARD_HAS_NO_REAL_SDCARD := true

Also you can reduce the size of the ramdisk using LZMA compression.
[Android Software Development] $_Vladislav:
Well, I used LZMA compression. It significantly reduced the size of the recovery. But, for normal operation, I need to remove a few KB.

Stock Recovery Size: 20573 KB

Size built TWRP: 20643 KB

I tried to remove some languages ​​and compress images, but the recovery does not work, the screen turns on and off

And can this affect the bit depth? 64-bit processor and 32-bit Android system. That is, I need to build a 32-bit recovery for compatibility with Android?
[Android Software Development] ashyx:
You've compiled twrp for a 64bit device. However I doubt the device is running in 64bit mode.

Due to its low specs the firmware is likely 32bit.

Download Cpu-x and check the specs.
[Android Software Development] $_Vladislav:
Yes, I knew that. Android works in 32bit mode.

And if i put the firmware with 64 bit Android for example with Project Treble. Will it work?

Since most of the firmware is made under arm64.

64bit processor is in this smartphone. Samsung Exynos 7 Quad 7570

UPD: It seems to me that the kernel does not support LZMA compression. The screen turns off and on again.
[Android Software Development] ashyx:
There are both arm and arm64 treble builds.

As for the kernel not supporting lzma that would be unusual as pretty much every Samsung kernel I've come across has supported lzma.
[Android Software Development] $_Vladislav:
I looked at the defconfig of this kernel, and there support is disabled
[Android Software Development] ashyx:
Have you modified the kernel source in any way?

If not then unless Samsung have released the source with a different config, according to the defconfig LZMA ramdisk compression is set.

CONFIG_RD_LZMA=y
[Android Software Development] $_Vladislav:
Yes, I included support for LZMA in the kernel source. Now at assembly again an error.

https://jenkins.twrp.me/job/j2corelte-test/49/consoleFull
[Android Software Development] ashyx:
Kernel missing error again.

cp: cannot stat '/builds/out/target/product/j2corelte/obj/KERNEL_OBJ/arch/arm64/boot/kernel': No such file or directory

Also you've included support for LZMA but not GZIP.

Are you using this kernel in the build?

By the way it seems the kernel is running in 64bit mode according to the kernel source.
[Android Software Development] $_Vladislav:
I use the kernel source code, which includes LZMA support. It is built but for some reason is missing. I also left the prebuilt kernel, because it was not built without him
[Android Software Development] ashyx:
As I mentioned previously, this issue happened with me as it gets deleted before the build completes and the only way around it was to change the device name.
[Android Software Development] Micha_Btz:
Hi,

I have tried a new way with the omni tree and started from scratch to use also the A/B partitions of my zangyapro device. Here is the device tree https://github.com/Micha-Btz/zangyapro_twrp

But build stop and I don't understand why, can someone have a look please.

ninja: error: '/home/mdomann/handy/build/omnirom-oreo/out/target/product/zangyapro/obj/STATIC_LIBRARIES/bootctrl.sdm660_intermediates/export_includes', needed by '/home/mdomann/handy/build/omnirom-oreo/out/target/product/zangyapro/obj/EXECUTABLES/update_engine_sideload_intermediates/import_includes', missing and no known rule to make it
09:44:39 ninja failed with: exit status 1

Here the full log https://gist.github.com/Micha-Btz/f00eeb01464ca1c29fe3d41b9da91be9

I do have included recovery/root/vendor/lib64/hw/bootctrl.sdm660.so so what needs the build too?

TIA Micha
[Android Software Development] $_Vladislav:
I tried to change the name of the device, it did not help.

Previously, it did not help either. I do not know how you built with a different name of the device
[Android Software Development] ashyx:
Did you rename EVERYTHING? Device name, device folder, make files?

https://github.com/ashyx/TWRP_Samsung_j2coreltedd
[Android Software Development] $_Vladislav:
Yes! Renamed everything. I see no reason to change the name, it is not so on my device. I have j2corelte, or even j2coreltecis. :mad: :(
[Android Software Development] Micha_Btz:
so, my twrp builds fine with the minimal twrp manifest, but I have some problems with mounting partitions. I have some ideas and read some threads to solve this. Do I need more than saystem,vendor, boot, SDcard and maybe USB OTG as partitions.

There are a lots of other partitions too, like see in the attached picture.

One thing with make's its hard to debug is, that adb logcat is not working and also the recovery.log is not verbose or helpfull. Can someone give me advice, how I can increase the loglevel of recovery.log or make adb logcat work?

I have attach a pic of the log.

Device tree

https://github.com/Micha-Btz/zangyapro_twrp

thanks Micha
[Android Software Development] ashyx:
Your fstab looks like it has the wrong paths.

Post your fstab from the stock recovery and the one you are using for twrp.
[Android Software Development] Micha_Btz:
I think in the original LOS recovery is used this file https://github.com/LineageOS/androi...mmon/blob/lineage-15.1/rootdir/etc/fstab.qcom and currently used is this one https://github.com/Micha-Btz/zangyapro_twrp/blob/android-8.1/recovery/root/etc/recovery.fstab I think.

I have to clean up the repo and I will do it as soon I have time.

That my recovery is not logging makes me more crazy, so I can't see whats wrong.
[Android Software Development] ashyx:
Yep your fstab format is completely wrong.

You need to correct it to use the same format as the one below.

https://github.com/ashyx/TWRP_Samsung_j2coreltedd/blob/master/recovery.fstab
[Android Software Development] $_Vladislav:
So, I renamed the kernel "kernel" to "image" and the building has reached 99% and again some kind of error.

https://jenkins.twrp.me/job/j2corelte-test/60/consoleFull
[Android Software Development] ashyx:
Why don't you just use the prebuilt kernel instead of building the kernel from source?

The error is in the kernel build.

You can fix the kernel source later.
[Android Software Development] $_Vladislav:
I wanted to build a kernel with LZMA support. There is no sense in building on the prebuilt kernel, since either it will not start or it will be large
[Android Software Development] ashyx:
Irrespective of whether the kernel is prebuilt or not the ramdisk will still be built with LZMA compression.

Also regardless of whether the produced recovery.img boots or not, your goal here should be completing the build, not introducing other compiler errors.

You can fix the kernel source later.
[Android Software Development] $_Vladislav:
OK, I used the prebuilt kernel and the build was successful.

https://jenkins.twrp.me/job/j2corelte-test/62/consoleFull
[Android Software Development] pix106:
To reduce size, you may have already tried : do not include extra languages, disable crypto, use toolbox.
[Android Software Development] Micha_Btz:
So, I have made some progress and rebuild my fstab https://github.com/Micha-Btz/zangyapro_twrp/blob/android-8.1/recovery.fstab

Know I can mount /sdcard /vendor and /system, /recovery and /cache doesn't exist. Mount data not works, but thats not important for now.

I still see no device in adb devices when I connect my phone and logging don't work at all. I can work with the terminal in twrp on the phone, but thats not funny.

One great issue is also, when I boot to system the device doesn't start. I tries some time and then it's going back to recovery.
[Android Software Development] ashyx:
Mounting data requires formatting the data partition using the FORMAT DATA button to remove encryption.

You can still pull the recovery log by either going to Advanced>copy log. Ensure microsd card is selected for storage.

Or you will find the log in cache/recovery/last_log.

Lastly you can use adb:

adb pull /tmp/recovery.log
[Android Software Development] samarium:
I guess that if adb devices doesn't work, adb anything else isn't going to work either.

Might be a case of incorrect drivers for windows or uncorrect udev setup for linux? For linux do lsusb before and after connecting device, and see if there is a new usb device. If so then you probably have to setup the udev rules?
[Android Software Development] Micha_Btz:
The problem is, that the usb device is not recognise when pluged in. Since the link to /dev/block/bootdevice is also missing I think my init script is not started or failed for some reasons. Since adbd is on the device, I would try to start it by hand and see whats going on. adb pull is not possible. Since I'm completely new to build twrp it is sometimes hard to understand how things going together. The main articles from dees_troy are good, but how go further is quite hard to find out.

One thing for which I have no idea for the moment is, why the device is not booting to the normal LOS rom. I build the kernel from source, so it is the same kernel that boot LOS in normal way.
[Android Software Development] jahidinbedod:
any help

How to change default language zh_CN.xml to en.xml ?

help me
[Android Software Development] ashyx:
The default language already is English.
[Android Software Development] jahidinbedod:
yes English ready but default China

how to default to English?
[Android Software Development] ashyx:
Is this a prebuilt build or source built.

Every twrp I've ever built defaults to English.
[Android Software Development] Android-Andi:
English is default, but can be changed by a flag:

https://github.com/omnirom/android_bootable_recovery/blob/android-9.0/Android.mk#L373-L377
[Android Software Development] PWn3R:
Anyone have any feedback on those logs I posted? I can't seem to get the thing to run keymaster4 only, which I think is the problem. I tried commenting it out in the configuration in the device folder, but the keymaster3 service keeps starting and then failing.

Edit: I'm ****ing retarded. I wasn't compiling with "make clean" and it was including all the service files that had been in the first compile. I removed them this morning and was successful. I don't even want to think about how much time I wasted in the last two days because of not using make clean. It was one thing when I was doing it on a 4vCPU machine. I'm using my desktop at home which is a 7980xe and a full compile takes less than 1 minute.
[Android Software Development] PWn3R:
So it works now, but my device fails safety net now. Do I need to put a signature for the recovery image somewhere?
[Android Software Development] icxj1:
Does your kernel have functionsfs?
[Android Software Development] PWn3R:
I posted my build, which is working and decrypting data on my device. However, I have users that downloaded my build complaining that they are not prompted for a password to decrypt their data. The device I built this for is the Xiaomi Mi Mix 3. Does anyone have any suggestions on how to resolve this issue for them? I did format data from TWRP on my device the other day, because when I was trying to get this to work, I corrupted my userdata partition.
[Android Software Development] k4y0z:
So I'm trying to port TWRP to a device that doensn't have a display.

I can boot up the recovery-image and get an ADB-shell.

It seems like recovery is crashing though.

Here is the crash, that loops over and over:

[ 14.305781] <0> (0)[161:recovery][name:fault&]recovery[161]: unhandled level 1 translation fault (11) at 0x00000000, esr 0x92000005
[ 14.307262] <0> (0)[161:recovery][name:fault&]pgd = ffffffc01c0d3000
[ 14.308052] [name:fault&][00000000] *pgd=0000000000000000, *pud=0000000000000000
[ 14.308971] <0> (0)[161:recovery]
[ 14.309391] <0> (0)[161:recovery]CPU: 0 PID: 161 Comm: recovery Not tainted 3.18.19+ #1
[ 14.310388] <0> (0)[161:recovery]Hardware name: MT8163 (DT)
[ 14.311084] <0> (0)[161:recovery]task: ffffffc01c8c3980 ti: ffffffc00372c000 task.ti: ffffffc00372c000
[ 14.312307] <0> (0)[161:recovery]PC is at 0x7faedd297c
[ 14.312948] <0> (0)[161:recovery]LR is at 0x7faf218774
[ 14.313588] <0> (0)[161:recovery]pc : [<0000007faedd297c>] lr : [<0000007faf218774>] pstate: 00000000
[ 14.314737] <0> (0)[161:recovery]sp : 0000007fff29dd80
[ 14.315374] x29: 0000007fff29dd80 x28: 0000000000000000
[ 14.316034] x27: 0000007fae0716e8 x26: 0000007fae0716e0
[ 14.316695] x25: 0000007fae0716f0 x24: 0000007fae09d030
[ 14.317357] x23: 0000007fae01c1f0 x22: 0000007faf28b000
[ 14.318018] x21: 0000007faf28b000 x20: 0000000000000438
[ 14.318680] x19: 0000000000000780 x18: 000000000000000a
[ 14.319342] x17: 0000007faedd2968 x16: 0000007faf28b910
[ 14.320003] x15: 0000007fae08d447 x14: 0000000000000000
[ 14.320665] x13: 0000007faf263a91 x12: 0000000000000074
[ 14.321326] x11: 0000007faf263ce6 x10: 000000000000000a
[ 14.322022] x9 : 0000007faee10830 x8 : 0000000000000000
[ 14.322683] x7 : 0000000000000000 x6 : 0000000000000007
[ 14.323345] x5 : 00000000ffffffd0 x4 : 0000000000000020
[ 14.324007] x3 : 0000007faf0c1278 x2 : 0000007faf0f5210
[ 14.324668] x1 : 0000007faf0f2000 x0 : 0000000000000780
[ 14.325331] <0> (0)[161:recovery]

if I start recovery manually I am getting this:

I:Lun file '/sys/devices/platform/mt_usb/musb-hdrc.0.auto/gadget/lun0/file'
I:Find_File: Error opening '/sys/class/backlight'
I:Find_File: Error opening '/sys/class/leds/lcd-backlight'
I:Unable to locate brightness file
I:LANG: en
Segmentation fault

Any help is appreciated.
[Android Software Development] k4y0z:
Thanks, I was able to get it working:

https://github.com/omnirom/android_bootable_recovery/compare/android-9.0...chaosmaster:no-screen
[Android Software Development] zainifame:
Can I compile twrp from havoc source??
[Android Software Development] DiamondJohn:
Havoc-OS Is a ROM source, not a recovery source.

What you should be able to do is use the same device trees that you use to compile Havoc-OS to compile a TWRP.
[Android Software Development] Ibuprophen:
I only have some working knowledge regarding TWRP (in general) but, did you use the files located in your (following) vendor folder?

https://github.com/TheMuppets/proprietary_vendor_google/tree/lineage-16.0/crosshatch

You will need to download your proprietary vendor folder.

Remember that you should set it up to allow missing dependencies when your building TWRP.

From what I know, this is because those are the files it needs for building TWRP.

Anytime your missing dependencies, your going to get an error because it doesn't have all the needed files in order to be built.

I hope that I had explained this okay via text... :eek:

Good Luck!

~~~~~~~~~~~~~~~

UNLESS asked to do so, PLEASE don't PM me regarding support. Sent using The ClaRetoX Forum App on my Enigma Machine {aenigma = Latin for "Riddle"}.
[Android Software Development] wangdaning:
Device/Kernel/Vendor are all in the folder. Minimal Omni suggested an exclude, maybe I should try without that.
[Android Software Development] Ashish Gupta1999:
hi ,

i have 3 questions

1. My device asus zenfone lite l1 (za551kl) - i compiled twrp for it , but it is not treble twrp as not showing app partitions while installing images like (system , vendor etc) , so what chages i do to make it treble compatible

here is twrp tree - https://github.com/A2HI2H/android_de...us_asus_x00r_5

2. On twrp my device internal storage gets encrypted , after format data also it again gets encrypted after restart , how to make twrp to decrypt data by default ?

3. format data through twrp also makes the camera and flashlight to not work , this happened in both stock rom and gsi , tried cleaned install also

---------- Post added at 09:41 AM ---------- Previous post was at 09:41 AM ----------

hi ,

i have 3 questions

1. My device asus zenfone lite l1 (za551kl) - i compiled twrp for it , but it is not treble twrp as not showing app partitions while installing images like (system , vendor etc) , so what chages i do to make it treble compatible

here is twrp tree - https://github.com/A2HI2H/android_de...us_asus_x00r_5

2. On twrp my device internal storage gets encrypted , after format data also it again gets encrypted after restart , how to make twrp to decrypt data by default ?

3. format data through twrp also makes the camera and flashlight to not work , this happened in both stock rom and gsi , tried cleaned install also
[Android Software Development] Jleeblanch:
So I successfully compiled twrp for a new device, but unfortunately it's not even starting. When doing fastboot boot twrp.img, it reboots and shows the boot logo, then after a moment it reboots back to the bootloader.

My question is, is there a way I can tell what's causing it to not even start? ADB seems outta the question as it's not even booting at all. I've checked kmsg, all the files in /sys/fs/pstore/. Not sure what else I can check. Any thoughts or pointers in the right direction would be greatly appreciated.

In case it helps, here is my twrp device tree

-> https://github.com/Jleeblanch/android_device_motorola_lake/tree/twrp-9.0

Here is the kernel source used for the prebuilt kernel

-> https://github.com/Jleeblanch/kernel_motorola_sdm660/tree/twrp-lake
[Android Software Development] ashyx:
Which android version does this kernel boot on?
[Android Software Development] Jleeblanch:
The device was released with Android 9.0