yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Professor Woland:
Not at all, I would like to find solution but just run out of them.

I will try this, but one thing, this is for lzma not for lz4 and they are not the same, right?

Should I write LZ4 instead of LZMA in this flag?
[Android Software Development] bigsupersquid:
You'd probably have to modify whatever makefile in the android_build directory which calls out the variable instead, or the flag most likely wouldn't be recognized.
[Android Software Development] Professor Woland:
Hm, thanks a lot

I'll look into it as soon as I get to PC

ok so, I've put flag "BOARD_NEEDS_LZ4_MINIGZIP := true" in boardconfig and then edited build/core/config.mk to recognize the flag (edited LZMA TO LZ4 and pointed to usr/bin/lz4 instead of /usr/bin/lzma) and it build it with lz4 ramdisk, but still hanging on "waitning on ram dump" so I just unpacked and repacked recovery image I didn't change anything and try to boot and it booted fine this is ridiculous.
[Android Software Development] Professor Woland:
Ok, this is getting weird I tried even building with custombootimg.mk (excluded "BOARD_NEEDS_LZ4_MINIGZIP := true" flag) and it builds fine and even ramdisk is in lz4 format. It should be working right? Hell no. But when I unpack recovery.img and repack it (using osmosis android image kitchen) without touching anything and try to boot that instance of recovery it boots without problem. Any toughts on this one?
[Android Software Development] gee one:
It sounds like compression is not the issue?

Maybe the boot image is getting a different command line or is being loaded into a different chunk of memory?

Maybe you're cursed and need to use a hex editor to compare the headers?

See if the kitchen toolkits are changing anything else?

Can you post the original file and working file?
[Android Software Development] Professor Woland:
Well it is compression but that is top of the iceberg it seems.

How do you mean boot image is getting a different command line or loaded into different chunk of memory?

I'm cursed probably, however I don't know how to use hex editor and what should I look for.

I compared unpacked images of working one and original one, there is no difference at all however there was difference in size in few files but one is empty file and and one is file containing 4 characters, I don't know how it is possible that empty file in working recovery can be size of 9 bytes and in original 1 or 0 bytes. But the content of files is exactly the same.

I will post original recovery and working one tomorrow or later, I'm now on windows to unbrick phone.. ( I tried building with 7.1 Omni sources and it got some conflict probably with forced encrypt because I got same results when I was poking around forced encrypt last time, I can't disable the damn thing)

edit:
[MENTION=2790198]gee one[/MENTION]

here they are in attachments original-untoched recovery and working one just unpacked and repacked without touching anything

original

working
[Android Software Development] gee one:
Well. the hex editor shows that you aren't cursed. :D The headers are identical except for the fields that indicate file sizes.

I dumped the ramdisk and kernel- and I noticed this.

# file working.img-ramdisk.lz4 original.img-ramdisk.gz
working.img-ramdisk.lz4: LZ4 compressed data (v0.1-v0.9)
original.img-ramdisk.gz: LZ4 compressed data (v1.4+)

I suspect that you are using an incompatible version of LZ4 or maybe the version is confusing the bootloader/SPL or what ever unpacks the ramdisk.. I couldn't get lz4 to recognize the .gz extension, but if I changed the name to .lz4 it would happily decompress it.

#lz4 -d original.img-ramdisk.gz
Cannot determine an output filename

I'm on Debian Jessie:

*** LZ4 Compression CLI 64-bits r122, by Yann Collet (Sep 18 2014) ***

My suggestions are to see if you can roll back the version of lz4 in your build environment to older???? This is just a wild guess!!
[Android Software Development] Professor Woland:
first one question, did you mean to install older version of liblz4 packages or to use older version in /external/lz4 in repository or something else?

Ok, so this is what I tried:

try to point it to use lz4 bin from kitchen instead of one in /usr/bin and nothing has changed

delete complete contains of folder external/lz4 and replace it with contents of this one still the same

removed liblz4 it was r131 packages and installed oldest one which support ubuntu 16.04 see this and still the same

every time when i unpacked recovery.img and run "file" on ramdisk it was returning

LZ4 compressed data (v1.4+)
[Android Software Development] gee one:
I guess you want to roll back which ever one is actually compressing your ramdisk, although it seems like you tried all the likely candidates already.
[Android Software Development] Professor Woland:
It seems that I didn't catch the right one since it's still the same, maybe someone else is to blame maybe mkbootimg?

however when I run file on files in bin folder of the kitchen for all it was saying

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.10.47, stripped

My kernel is 4.10.*, so my only tought is to try to build on version of ubuntu which uses 3.10 kernel, or to try 3.10 kernel on ubuntu 16.04, I know it's dumb idea so if anyone has any other I'm all ears

Update:

i set up virtual machine with 12.04 ubuntu on 3.10.* kernel and build on it i installed oldest version i could find r114 and replace even /external/lz4 but it's the same recovery won't boot out of the box, and it returns v1.4 so it's probably something else off I'll try to replace everything in build tree with files in osmosis repo used to build his kitchen and see what happens
[Android Software Development] DiamondJohn:
Default a partition to not backup?

It seems like it would be simple to find, but a thread search and an internet search didn't get me anywhere.:o But I wasnt too sure on what to search for :confused:

I have successfully compiled TWRP for my device (thanks to this thread:good:) , and I have added 2 more partitions to my fstab. The first is the Boot Logo (which appears just before the boot animation), And the second is the PDS (equiv of EFS on other phones). However, these partitions dont need to be backed-up (and especially not restored) every time. However, every time I go to do a new backup they are selected by default, while cache by default is un-selected.

How do I mimic the same for these two added partitions?
[Android Software Development] gee one:
Some of the default settings are in bootable/recovery/data.cpp

The default partitions may or may not be in there as well, but that probably one of the other files in there.
[Android Software Development] pozidrivphil:
Would there be a way to not store backup files in a folder containing the serial number, or to have TWRP ignore this serial number? I want to clone an image from one donor to multiple (identical) devices, but now I need to change the name of the folder for each device to make TWRP recognize and restore the backup.
[Android Software Development] ashyx:
It would be simpler to use adb backup and restore.
[Android Software Development] DiamondJohn:
I didnt see any specific code (well, not in my quick read :o) in regards to not selecting a specific partition. I was hoping it would be a simple partition flag in the fstab, but I have read the OP a couple of times and web searched and found nothing. I guess I will need to either dig deeper into the code myself, or make sure to un-select manually. I am more concerned with other people if I release this build, bricking their phones.
[Android Software Development] ashyx:
Bit confused, if you don't want those partitions backed up or restored then why add them to the FSTAB? :confused:
[Android Software Development] DiamondJohn:
Firstly, my bad regarding cache being unselected by default on restore. This is actually because when I backup, I dont do the cache, so it is of course not available to be backed up:silly:

These two partitions only need to be backed up periodically, if not only once. It is REALLY important to have a backup of your EFS partition (not sure if there is anyway other way to restore it), but its not something you want to mess with if there is nothing wrong with it. As for the Boot Logo, that's just icing, and because i can. But, you may wish to restore an old ROM while keeping your current Boot Logo; which I think would be the general preference.
[Android Software Development] gee one:
I thought that TWRP had an option to back up the EFS partition?? Maybe poke around in the code there and see if there are any clues on how it is treated differently.
[Android Software Development] DiamondJohn:
I am not sure how, as each device has it at a different location, and if mounted by name, on my phone it is PDS not EFS, so that wouldn't work. And I have never seen any reference in the device tree, not that I have read every line if code.
[Android Software Development] ashyx:
As far as I'm aware those partitions aren't selected by default for backup anyway. In fact I don't think any partition is. Once a partition has been deselected it stays that way, they do in my builds or do you mean when restoring only?
[Android Software Development] DiamondJohn:
And maybe thats what I am seeing. As I dont normally select the cache for a backup, it never comes up by default (I had it off the previous time). I think that's the answer. :silly: ie me not understanding how the app behaves. :o
[Android Software Development] pozidrivphil:
Yes, that would be great, but I can't get adb to work in my TWRP build.
[Android Software Development] NZ Razer:
Can someone tell me please, is this tutorial up to date and still currently valid? I have knowledge of Java/Python and C++ and have a new phone that currently no one is really developing for. I'm almost tempted myself to try build TWRP for it then try build LineageOS if I commit.
[Android Software Development] ndrancs:
Not really up to date. But still relevant.
[Android Software Development] Elanza_48:
Getting this error even after setting the TW_THEME flag on boardconfig.mk :(
[Android Software Development] Elanza_48:
OK, I successfully compiled twrp for a samsung device by using "make -j# bootimage" , and I got ramdisk.img. Am I suppose to get this file ?
[Android Software Development] pix106:
Is there a reason why you don't do a "normal" : make recoveryimage ? You would get a recovery.img, to be flashed on recovery partition
[Android Software Development] Elanza_48:
I did it because It is a samsung phone and please check the guide, It is written to use make bootimage instead of recoveryimage.:)
[Android Software Development] DodoGTA:
What's that Samsung phone?
[Android Software Development] Elanza_48:
j7 prime
[Android Software Development] pix106:
That's a pretty good reason :)

I had a Galaxy S2 which needed IsoRec kernel/recovery, but i had forgotten about this
[Android Software Development] ashyx:
Incorrect, the guide is out of date, practically every Samsung device released in the last few years uses a separate recovery partition, you need to use mka recoveryimage or make recoveryimage
[Android Software Development] Elanza_48:
thanks for u help :o
[Android Software Development] DodoGTA:
You're really right :good:
[Android Software Development] pozidrivphil:
Can someone give me a direction on why ADB doesn't work and TWRP doesn't get recognize by any PC? Everything else works fine, compiled without errors..
[Android Software Development] ashyx:
You likely need to make your kernel permissive. However ensure that with MTP disabled that the ADB windows driver is available in device manager. If not manually install it.

MTP needs to use the Google MTP kernel driver not Samsungs.
[Android Software Development] Elanza_48:
please help !! :(

getting this error

No private recovery resources for TARGET_DEVICE on7xelte
build/core/Makefile:1112: warning: overriding commands for target `/home/rajarshi/omni/out/target/product/on7xelte/ramdisk-recovery.cpio'
build/core/Makefile:1068: warning: ignoring old commands for target `/home/rajarshi/omni/out/target/product/on7xelte/ramdisk-recovery.cpio'
build/core/Makefile:1118: warning: overriding commands for target `/home/rajarshi/omni/out/target/product/on7xelte/ramdisk-recovery.img'
build/core/Makefile:1074: warning: ignoring old commands for target `/home/rajarshi/omni/out/target/product/on7xelte/ramdisk-recovery.img'
Starting build with ninja
ninja: Entering directory `.'
ninja: error: '/home/rajarshi/omni/out/target/product/on7xelte/dt.img', needed by '/home/rajarshi/omni/out/target/product/on7xelte/recovery.img', missing and no known rule to make it
build/core/ninja.mk:157: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1

#### make failed to build some targets (19 seconds) ####

my BoardConfig.mk file.
[Android Software Development] ashyx:
Are you sure that dt.img is in the correct directory and named correctly?
[Android Software Development] pozidrivphil:
When I type 'sestatus' in the TWRP terminal, I get:

SELinux status enabled
SELinuxfs mount: /sys/fs/selinux
Current mode: permissive
Mode from config file: permissive
Policy version: 30
Policy from config file: sepolicy

So when I go to mount-> disable MTP, I should use the samsung driver?
[Android Software Development] ashyx:
Doesn't really matter as long as it loads an ADB driver.
[Android Software Development] Elanza_48:
Yup I checked many times. And also checked the flag in BoardConfig.mk file

Though I am compiling on ubuntu gnome am I missing any packages other than mentioned ones ?
[Android Software Development] Rajjubul Hasan:
1112
[Android Software Development] BobbyDev:
This may be a dumb question, but how do I find BoardConfig.mk if I do not have root? I cannot find the directory devices (the post says the file is under 'devices/manufacturer/codename'). Thanks!
[Android Software Development] kingkobra97:
Hello!

I safely build my TWRP, but I have a problem. MTP and ADB works, and I can see the files of my phone, but I can't copy to either the phone or the computer. I can only delete files on my SD and internal memory. Which parameters do I need to fix in init.rc or another files?

Thanks.
[Android Software Development] ashyx:
You don't find it anywhere, you create it then put it in the specified directory.
[Android Software Development] bigsupersquid:
you'll have to link your device tree for people to look at to say what might need changed.

can you adb push/adb pull files OK? if you're running windows, do you have good device drivers?
[Android Software Development] pozidrivphil:
The fact that I can't connect to TWRP through ADB on any device, linux, windows (and all the hardware parameters in computer management->usb device are 000) could have something to do with my boardconfig or init.rc?
[Android Software Development] xDreDz:
Hello? I just want to ask some stuff, because of all phone that I flashed and rooted this is the first time I encountered this

https://xdaforums.com/note-fe/help/custom-binaryrecovery-blocked-due-to-t3701408

And I cant seem to use adb to flash twrp, I can only access download mode and recovery

Sorry if this is out of place but my eyes are bleeding for days of research and I kinda want to be a dev but I dont know whrre to start
[Android Software Development] ashyx:
This is not the place for your issue. If you don't actually know what the issue is then maybe you should give development a miss?

You are FRP locked. Reinstall the stock firmware then enable OEM unlock in developer settings. You cannot use ADB to flash firmware on a Samsung device without root.

I will not respond to any other questions on the subject in this thread. You can find all you need by doing a quick search on Google using the terms above.
[Android Software Development] sscsps:
Hello people, I'm trying to build new twrp for my old device, but I am facing this issue: https://hastebin.com/acitelahuc.vbs

I am using 4.7 toolchain for arm device. It is stock from google. I use this toolchain because 4.8 doesnt work with my kernel, it causes the kernel to have a panic.

Can anyone tell me how I can go about this issue?

I think line 4 of the build log I provided above is where the issue is stated, but I dont know how to fix that.
[Android Software Development] ashyx:
I'm confused as to your comments about changing the tool chain. You shouldn't need to change anything, just use the correct branch for your device or do mean your building the kernel from source with TWRP?
[Android Software Development] sscsps:
The reason for using a different toolchain is when I compile my kernel with 4.8(default one for arm devices on N), the kernel builds but when I run it on my device, it panics and crashes, But when I compile it with 4.7, it works good.

As cm-14.1 or any other N rom dont have 4.7 as default, I have to download it separately and configure my device tree to use it.

it works fine at that point, the ROM builds fine, but busybox gives me that issue(hastebin link in previous post).
[Android Software Development] TimSchumi:
You might want to try cherry-picking those commits into your kernel:

https://github.com/SiniTurk/android...mmit/993bb885e851c893184fe3c8c06fdea1d871c2ba

https://github.com/SiniTurk/android...mmit/758d19b9d43cd602319f3388957b77574bdd1fcd

https://github.com/SiniTurk/android...mmit/cbf8882336fe3c2e5d25600d079663e22f0354d8

Those helped me when I wasn't able to use 4.8 or above.

EDIT: Also, those errors in the build log aren't from busybox. There is the line "arm-eabi-gcc: not found" which probably means that you incorrectly installed the toolchain (or you didn't give the build system the correct path)

EDIT2: Also, I would suggest that you just build with the 6.0 branch (or whatever branch uses your desired toolchain as default) before messing with the toolchain yourself.
[Android Software Development] Temanyan:
Hi all, maybe anybody know how to set that twrp use tw_crypto_use_system_vold instead standard crypto. 1st use default crypto to decrypt data, then after many errors, use tw_crypto_use_system_vold and after that decrypt goes fine, but builded twrp loading about 30 seconds, because first decrypt goes all path until error, and after that goes right decrypt. I want to exclude 1st decryption with errors. Recovery log in attachment. Sorry for my English) Git thread
[Android Software Development] nkk71:
You cannot override normal TWRP decrypt in favor of vold_decrypt, and imho you shouldn't. vold_decrypt is supposed to be a fallback in case you cannot get normal TWRP decrypt to function due to OEM particularities.

I know it may be easier, and sometimes necessary, but from your log it looks like you almost have normal decrypt working.

Why did you disable

TARGET_HW_DISK_ENCRYPTION := true

iirc those error 22s could likely be coming from disabling that.
[Android Software Development] jahidinbedod:
hi dude where i found the line text to change the default language setting on twrp

I want to change the default language setting on custom twrp

please help me ?
[Android Software Development] gee one:
Off the top of my head, I think it's in a file called data.cpp

Maybe...
[Android Software Development] MasterAwesome:
[MENTION=3445844]vetzki[/MENTION] Always glad to help :D
[Android Software Development] ne0zone75:
TWRP issue : filesystem decrypting from recovery... (CyanogenMod 11.0)

Hello,

I'm sharing TWRP builds for GT-I9195/0 over here and recently some users started to report back an issue for decrypting encrypted filesystems from recovery on latest CyanogenMod 11.0 (encryption/decryption is confirmed as fully working on my builds for CM 10.2)...

-> one of my user can decrypt successfully his filesystem until he changes the encryption PIN code : after this TWRP does not accept the correct changed PIN code at all and reports it as wrong :confused: (any encryption keyring issue here ?)

-> another one of my user is unable to decrypt his filesystem at all in any case...

I'm using OmniROM TWRP sources tree (android-4.4 branch) along with CyanogenMod 11.0 sources tree (stable branch) in order to build TWRP.

My TWRP build flags regarding encryption are as following :

TW_INCLUDE_CRYPTO := true
TW_INCLUDE_CRYPTO_SAMSUNG := true
TW_CRYPTO_FS_TYPE := "ext4"
TW_CRYPTO_REAL_BLKDEV := "/dev/block/mmcblk0p24"
TW_CRYPTO_MNT_POINT := "/data"
TW_CRYPTO_FS_OPTIONS := "nosuid,nodev,noatime,noauto_da_alloc,discard,journal_async_commit,errors=panic"
TW_CRYPTO_FS_FLAGS := "0x00000406"
TW_CRYPTO_KEY_LOC := "footer"

Can anybody please help me to find out what's going wrong ?

What approach are you suggesting to me in order to solve this issue ?

Thank you a lot for your assistance :good:
[Android Software Development] KainXSS:
I was able to get cwm working fine up to 6.0.4.8 on my device but trying to port twrp to it just gives me a black flashing screen, any ideas?
[Android Software Development] desalesouche:
i could compile twrp 2.7.0.0 it works fine except one thing: if device is off and i plug it to usb or charger , it reboots in recovery....

may i ask for the fix? i can provide my device twrp device tree...

thanks
[Android Software Development] desalesouche:
twrp 2.7.1.0 with selinux support

Hi. i could build working twrp 2.7.1.0 for huawei honor (u8860)

I could fix reboot in recovery when device is off and plugged to usb or charger...

the two bugs i have left are the followings :

- charging animation doesn"t stay in the center of screen, it goes from center to left then go back to center then left.... etc...

- when i am in recovery and i want to turn off device with twrp"off" button, nothing happen...

if someone can provide me some ideas how to fix?

thanks
[Android Software Development] JekaPinsk:
When pressing off button, TWRP just freezes, so I need to remove battery
[Android Software Development] Shaky156:
Have an issue with TWRP and Tegra Note 7

unable to find TWRP settings

I:Attempt to load settings from settings file...

I:Settings file '/data/media/0/TWRP/.twrps' not found.

Directory exists, data partition mounts fine.

Im assuming, that its unable to find settings is also causing the screen to be scrambled

Any help appreciated

EDIT: screen still scrambled even with twrps settings file loaded

Using tegra device
[Android Software Development] Shaky156:
Get this with tegranote 7 device
[Android Software Development] ne0zone75:
crypto over F2FS concerns with TWRP v2.7.1.0...

Good afternoon,

I would like to know if it is possible to specify two filesystems into this crypto TWRP build flag : 'TW_CRYPTO_FS_TYPE :=' in order to get crypto support from recovery if any of the two target filesystem is used with a flag set to this for example : 'TW_CRYPTO_FS_TYPE := "ext4,f2fs" for adding F2FS support to it...

Thank you for your reply,

Regards

EDIT : Already answered over PM ! :good: The answer is NO : F2FS filesystem by itself is probably not compatible with crypto...
[Android Software Development] Shaky156:
Screen issue has been fixed, have an issue with mounting system partition, from init.rc. Anyone know why its not working???
[Android Software Development] Pons:
Maybe check your fstab and partitions? Kind of hard to help without giving a recovery.log or even saying your device.
[Android Software Development] tomatende2001:
Dear developers.

I'm just a simple user, but I need a custom recovery to root my phone (to use rSAP App, Adaway, Samba). Can one of the developers here please compile TWRP for the "HTC One mini 2"? I do not know how much effort is it and if my question is too much, or not. So I apologize if it is too much. It would please me if it would be possible, thank you.