yashsingh1/xdaforums huggingface dataset:
[Android Software Development] sscsps:
Hello, I have a small question,

My recovery is going out of size limit, I looked around and found that I can use custom bootimg_mk to use LZMA for fixing it, I used that and its fine now.

But when I was looking around, I found something here: https://github.com/omnirom/android_build/blob/android-8.1/core/Makefile#L1359

This is a compression mechanism right there in the source, I wanted to know how I can use that. Anyone knows how I can use that? Instead of implementing a new BOARD_CUSTOM_BOOTIMG_MK ?

EDIT: I found how to do that, You just need to add "LZMA_RAMDISK_TARGETS += recovery" in your device tree(can be in BC.mk) for compressing recovery.img, and "LZMA_RAMDISK_TARGETS += boot" for compressing boot.img
[Android Software Development] jusma:
Hi folks. I managed to compile my recovery, but when I flash and try to enter recovery mode, it runs forever. How can I go about debugging the issue?

There is another recovery on XDA for my same device, and I unpacked and compared the output. Here's where the difference lies:

1) My recovery has cmdline - androidboot.selinux=enforcing and his has androidboot.selinux=permissive

2) My img-tagsoff is 00000100 and his is 07588000

3) My ramdiskoff is 01000000 and his is 07b88000

4) My img-ramdisk.gz files is also 10 mb smaller

I can't use his output, since it does not decrypt data partition and he does not reply back with his device tree source. I have attached mine for your perusal. I downloaded the kernel source from my phone manufacturer, but am not sure how to incorporate it into the device tree.

Any suggestion is appreciated.
[Android Software Development] ashyx:
Do you have the stock recovery image?
[Android Software Development] jusma:
Yes, I do have that as well. BTW, I found another device tree for the previous model of my phone and changed the BoardConfig.mk file further. Will see how the new compiled recovery file is, once done and flashed.
[Android Software Development] dataghost2014:
Thank you for the hard work that went into all this

---------- Post added at 10:29 PM ---------- Previous post was at 10:29 PM ----------

Works great!
[Android Software Development] jusma:
Hi ashyx, I have uploaded an updated device tree, which does not work as well. Can you please review it and suggest what I can do to get it work. I had repo synced minimal twrp omnirom manifest. I also have the stock recovery.

I also have the kernel source with the following files and folder. Not sure how it helps.

android block crypto firmware init Kconfig linaro mm README_Kernel.txt samples sound virt

Android.mk COPYING Documentation fs ipc kernel MAINTAINERS net README_Version.txt scripts tools

arch CREDITS drivers include Kbuild lib Makefile README REPORTING-BUGS security usr
[Android Software Development] ashyx:
Can you post the stock recovery. Also what branch are you building in and what android version is your device running?
[Android Software Development] jusma:
You can download the stock recovery here: https://pan.baidu.com/s/1qXXMmW8

Password is 'jwwu' and just click on the 35.1 button.

I repo synced Branch 7.1 of Minimal TWRP Omnirom:

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

My Android device itself has Android 7.0.
[Android Software Development] ashyx:
Can you post the recovery somewhere else like tinyupload.com?
[Android Software Development] jusma:
Please download from https://ufile.io/duucj
[Android Software Development] ashyx:
Looking at your recovery image these are the correct offsets.

BOARD_KERNEL_CMDLINE loglevel=4 coherent_pool=512K page_tracker=on slub_min_objects=12 androidboot.selinux=enforcing << set to permissive

BOARD_KERNEL_BASE 00478000

BOARD_PAGE_SIZE 2048

BOARD_KERNEL_OFFSET 00008000

BOARD_RAMDISK_OFFSET 07b88000

BOARD_SECOND_OFFSET 00e88000

BOARD_TAGS_OFFSET 07588000
[Android Software Development] jusma:
Hi ashyx. I edited my BoardConfig.mk file like this...

BOARD_KERNEL_CMDLINE := loglevel=4 coherent_pool=512K page_tracker=on slub_min_objects=12 androidboot.selinux=permissive
BOARD_KERNEL_BASE := 0x00478000
BOARD_KERNEL_PAGESIZE := 2048
BOARD_KERNEL_TAGS_OFFSET := 0x07588000
BOARD_RAMDISK_OFFSET := 0x07b88000
BOARD_MKBOOTIMG_ARGS := --base 0x00478000 --kernel_offset 0x00008000 --ramdisk_offset 0x07b88000 --second_offset 0x00e88000 --tags_offset 0x07588000 --pagesize 2048

The good news is that I can now boot into recovery, the bad news is that my phone ONLY boots into recovery and inside TWRP says that there is no OS. I cannot read any of the partitions. The output img-ramdisk.gz file within recovery.img is still 10mb fewer than the other guys.

Do you think it's a problem with my recovery.fstab file? I have attached it for your perusal. I have also yet to make use of the kernel source I downloaded from Huawei website, not sure where that fits into all this.
[Android Software Development] ashyx:
While booted to TWRP post the output of:

ls -laR /dev/block

You can use the terminal or preferably adb shell.
[Android Software Development] jusma:
Hi ashyx, if I use the TWRP terminal the text scrolls over multiple pages and I can't output to sdcard since the partition is not read. If I try to adb shell from my PC, it doesn't detect my phone. However, I did find messages stating that there was an error mounting my partitions.

I guess the problem lies in my recovery.fstab file. I am going to try to make a few changes and see if that sorts things, but appreciate any suggestions to help zero the problem.

---------- Post added at 06:04 AM ---------- Previous post was at 05:45 AM ----------

In my recovery.fstab file, I changed all my paths from...

/dev/block/bootdevice/by-name/boot

..to..

/dev/block/platform/hi_mci.0/by-name/boot

and that solved the problem and now I am able to see my partitions in TWRP. However, it still remains encrypt and I am unable to decrypt nor install any zip nor do nandroid backups.

I had already set "TW_INCLUDE_CRYPTO := true" in my BoardConfig.mk file. What else do I need to check?
[Android Software Development] ashyx:
You probably need the crypto blobs from the stock firmware.

The work around is to simply remove encryption by FORMATTING(NOT WIPE) the DATA partition and then patch the FSTAB of the boot image to prevent re-encryption.
[Android Software Development] jusma:
Is there a tutorial I can follow? I'd prefer keeping the encryption, not only because it's safer, but I want my users to be able to keep their data.
[Android Software Development] jusma:
Or even a device tree from any phone that has decryption working properly. I can try to figure my way to get the required info.
[Android Software Development] ashyx:
You can take a look at the previous device. This guy seems to have the crypto blobs figured out.

Shouldn't be much different.

https://github.com/skinzor/android_device_huawei_hwcan/tree/android-7.1?files=1
[Android Software Development] sarathzzz:
Can You Please Make TWRP Recovery for LYF Flame 8 ( LS-4505, Lollipop) .

I cannot find it anywhere.

So Please????:crying:
[Android Software Development] ananjaser1211:
[MENTION=4899305]ashyx[/MENTION]

Hello, i cant see a button for PM so i assume you dont like to be disturbed with alot of questions, But im having some mounting issues with my TWRP for J5 Pro

https://github.com/ananjaser1211/android_device_samsung_j5y17lte/

And i believe my other twrp for A530F (which you recently made one for it so mine is useless to fix)

Mounting issues are basically, once its mounted and unmounted it breaks, and i need to reboot recovery.

Do you have any clue what could be wrong ? if not May i use fstabs from your J7 Pro Recovery ? I dont see any public trees so im gonna have to unpack it and figure out whats wrong with mine.

Hope its okay with you. Thanks in advance
[Android Software Development] ashyx:
Seems a strange issue. Have you checked the recovery log?

Be my guest to use the fstab.
[Android Software Development] Blackball:
hi, type this:

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

it say this:

fatal: manifest 'default.xml' not available

fatal: remove-project element specifies non-existent project: platform/external/aac

i got this error when i type repo sync:

raceback (most recent call last):

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/main.py", line 531, in

_Main(sys.argv[1:])

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/main.py", line 507, in _Main

result = repo._Run(argv) or 0

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/main.py", line 158, in _Run

copts, cargs = cmd.OptionParser.parse_args(argv)

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/command.py", line 67, in OptionParser

self._Options(self._optparse)

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/subcmds/sync.py", line 189, in _Options

self.jobs = self.manifest.default.sync_j

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/manifest_xml.py", line 360, in default

self._Load()

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/manifest_xml.py", line 407, in _Load

self.manifestProject.worktree))

File "/home/blackball/Schreibtisch/Oreo_TWRP/.repo/repo/manifest_xml.py", line 443, in _ParseManifestXml

root = xml.dom.minidom.parse(path)

File "/usr/lib/python2.7/xml/dom/minidom.py", line 1918, in parse

return expatbuilder.parse(file)

File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 922, in parse

fp = open(file, 'rb')

IOError: [Errno 2] No such file or directory: '/home/blackball/Schreibtisch/Oreo_TWRP/.repo/manifest.xml'

Other repo sync for example lineage work without problems

Edit : 8.0 no problems with repo sync
[Android Software Development] shanman-2:
Hi all,

I'm getting this error while trying to compile twrp for Huawei y6- MYA-L11. (mtk6737t SoC)

libsepol.avtab_write_item: policy version 29 does not support ioctl extendedpermissions rules and one was specified

/home/ted/rom_build/android/system/out/host/linux-x86/bin/checkpolicy: error writing /home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery.tmp

system/sepolicy/Android.mk:146: recipe for target '/home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery' failed

make: *** [/home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy.recovery_intermediates/sepolicy.recovery] Error 1

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

/home/ted/rom_build/android/system/out/host/linux-x86/bin/checkpolicy: policy configuration loaded

/home/ted/rom_build/android/system/out/host/linux-x86/bin/checkpolicy: writing binary representation (version 29) to /home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy_intermediates/sepolicy.tmp

libsepol.avtab_write_item: policy version 29 does not support ioctl extendedpermissions rules and one was specified

/home/ted/rom_build/android/system/out/host/linux-x86/bin/checkpolicy: error writing /home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy_intermediates/sepolicy.tmp

system/sepolicy/Android.mk:107: recipe for target '/home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy_intermediates/sepolicy' failed

make: *** [/home/ted/rom_build/android/system/out/target/product/hwmya_L6737/obj/ETC/sepolicy_intermediates/sepolicy] Error 1

#### make failed to build some targets (07:34 (mm:ss)) ####

I've been trying to fix this for a few days now and no luck! Funny thing is the files are there! If I ignore the error twrp compiles but will not flash.

Any help would be much appreciated.

Thanks.
[Android Software Development] NepoRood:
Link your device tree (put it on GitHub if its not there already)
[Android Software Development] shanman-2:
Hi NepoRood,

Sorry meant to do that,

https://github.com/shanman-2/android_device_huawei_hwmya_L6737

[MENTION=7237874]NepoRood[/MENTION]

I've removed the two offending lines from Android.mk file in system/sepolicy

sepolicy_build_files := security_classes \

initial_sids \

access_vectors \

global_macros \

neverallow_macros \

mls_macros \

mls \

policy_capabilities \

te_macros \

attributes \

ioctl_defines \

ioctl_macros \

*.te \

roles \

users \

initial_sid_contexts \

fs_use \

genfs_contexts \

port_contexts

A new error then points to a xperm in app.te, so I commented out that line!

Then I got same thing in domain.te so I commented out that line!

This is happening in quite a few .te files so I am proceeding as above.

Is this ok?

2nd edit: It boots! :)
[Android Software Development] NepoRood:
Glad you got it, and yes, you were doing the right thing in commenting those lines. If you were building a ROM, it would be different, but this is a recovery :good:
[Android Software Development] ananjaser1211:
Im disappointing in my self that checking recovery.log was the last thing i thought of :laugh:

Failed to mount '/system' (Device or resource busy)
I:Actual block device: '/dev/block/mmcblk0p18', current file system: 'ext4'
Failed to mount '/system' (Device or resource busy)
I:Actual block device: '/dev/block/mmcblk0p18', current file system: 'ext4'

Its odd, only happens AFTER flashing any ZIP. maybe i need to disable F2FS support in tree ?
[Android Software Development] divineBliss:
When I open and ADB shell from my Windows 10 PC command prompt while the phone is in TWRP (version 3.0.2-0 for Huawei Ascend XT H1611), I get weird characters at the shell prompt which include "[6n" as shown is post #1 image of https://androidforums.com/threads/help-with-adb-shell-in-twrp.1089942/ .

This does not occur if the phone is in normal operational mode and I connect via ADB using same method with same PC command prompt. :confused:

Thank you for any real tips besides ignoring these character. Pressing the backspace key produces more jumbled garbage characters and it's really challenging trying to type and correct commands from the command prompt while in TWRP :)

I've searched for a long time and been unable to find a solution. If this is the wrong thread for this question, sorry and please direct me to a more appropriate thread.

EDIT: I don't see the problem is if I connect from an Ubuntu command prompt, so must be something to do with Windows vs Linux terminal handling. Would love to see a simple solution that fixes the problem for Windows command prompt window issue.
[Android Software Development] ashyx:
It's not an issue with twrp, its windows terminal incorrectly interpreting the ouput. Use a proper terminal emulator such as the one below.

I use the mini version. Put the adb binaries in the BIN folder to add to your path.

http://cmder.net/
[Android Software Development] TimSchumi:
They force-pushed a fix for that external/aac thing, but it doesn't get picked up automatically, so you have to run your repo init command again
[Android Software Development] Blackball:
Everything is working well again.

But another question.

If I build with Linux as dual boot with windows everything is fine.

If I try to build with virtual machine in windows 10 it can find omni_ file. But it's the same tree as my Linux build. Any ideas?
[Android Software Development] _that:
Should be impossible. Same Linux version in both cases? Or are you running a Linux userspace on WSL? If not, which VM software? Which filesystem and how are you using the same tree from both the physical and the virtual machine?
[Android Software Development] Blackball:
When im at home I check my system to answer you questions.

I know it's oracle software and I use Linux Mint.

With both systems I use the omni minimal 7.1 repo and clone the tree from my github account.

Strange thing for me too was that I had no permissions to . build/envsetup.sh

Solve the problem with chmod 777.

Sorry if u asked strange questions but I'm a newbie with Linux.
[Android Software Development] OrbitronX:
Anyone has any idea why the following error?

I had successfully compiled 3.1.1 and then when I switched to the 8.0 branch to get 3.2.1, that was what I got.

Thanks in advance.

Edit: fixed by adding "-Wl,--allow-multiple-definition" to "CLANG_CONFIG_arm_EXTRA_LDFLAGS :=" found in "build/core/clang/arm.mk".

It's a nasty way of fixing it, but, it works :)
[Android Software Development] shanman-2:
Hi all,

I have compiled twrp 3.2.1-0 for my Huawei y6 MYA-L11. It boots and everything works fine, EXCEPT, adb and usb storage! The output of netstat in twrp terminal is attached.

I have tried killing the abdb process on port 5037 but it just restarts immediately on the same port. It seems like a different adb demon as when I type adbd in terminal is says "unable to install smartsocket listener : address already in use".

adb works fine when os is running.

Any help much appreciated.
[Android Software Development] SexDwarf:
Twrp
[Android Software Development] ashyx:
Cwm
[Android Software Development] DodoGTA:
Philz
[Android Software Development] ashyx:
Stock ;)
[Android Software Development] TimSchumi:
CM/Lineage Recovery
[Android Software Development] shanman-2:
erecovery
[Android Software Development] ashyx:
Lineage Recovery?
[Android Software Development] pix106:
4ext ?
[Android Software Development] Akhilesh S V:
VoLTE
[Android Software Development] Lara_CXM:
Does anyone have or can make it TWRP recovery.IMG file download for Lenovo A889 model? I'm searching for it on Google and everywhere but couldn't find it.

Thank you. I'm a Newbie:)
[Android Software Development] pix106:
This is a development thread : if you try to build twrp from sources, doing the job yourself, you'll get help here.

If not, ask somewhere else :)
[Android Software Development] DodoGTA:
VoWiFi
[Android Software Development] aitor_c:
I am trying to compile TWRP for Sony Xperia XZ.

I have been able to compile using both CM13 tree and minimal-manifest-twrp for lineageos. I have tried TWRP 3.0.2 and 3.2.1.

In both I get a blinking bootscreen, and after it starts, some screen glitches.

In the logs I see it is constantly (several times per second) showing this mesages:

Failed to mount 'firmware': (Device or resource busy)
Failed to decrypt data.
Unable to cecrypt with default password. You may need to perform a Format Data.
Updating partition details...
...done
Unable to mount storage
failed to unmount '/system' (Device or resource busy)

I have tried also with Omni 8.1, but it comes with aosp recovery by default, and I have not been able to compile TWRP (failed to compile).

TWRP 3.2.1 downloaded from twrp page is working OK.

Which android repo should I use to compile twrp for the xperia xz?
[Android Software Development] NepoRood:
Which/What device tree(s) are you using? Provide a link...

That's your problem, get rid of that line in your fstab. Also, TWRP should be built with "eng" and ROMs "userdebug". So each should be built separately, not together.
[Android Software Development] Jay_B:
[MENTION=7237874]NepoRood[/MENTION] Thank you. Really appreciate your help.

This is the device tree I am using :

Device Tree

Actually the ROM compiled correctly. However in the advance reboot option when we selected "reboot recover" it just just keeps rebooting. Then I saw this device tree Xuefer and thought maybe since TWRP is not build-in, it is not able to go to recovery directly when we select reboot to recovery.

Hence I tried to modify the BoardConfig.mk from Xuefer's tree and updated the files in my device tree.

As I said I am new to this I am not sure if I did it correctly. So far my friend "Google" did help a lot now I need someone to point out what's wrong... :)

Thank you again.
[Android Software Development] aitor_c:
I have been able to compile (but failed when running) with these:

github.com/CyanogenMod/android/tree/cm-13.0

github.com/omnirom/android_bootable_recovery/tree/android-6.0

github.com/AndroPlus-org/android_device_sony_kagura/tree/cm-13.0

and these:

github.com/minimal-manifest-twrp/platform_manifest_twrp_lineageos/tree/twrp-14.1

github.com/omnirom/android_bootable_recovery/tree/android-7.1

github.com/AndroPlus-org/android_device_sony_kagura/tree/cm-14.1

I can't put the full links. Not enough posts yet.
[Android Software Development] pix106:
Hi,

I have built TWRP 3.2 for a mt6580 smartwatch, which uses swap, /data/2ndswap file.

Backup restore fails because this file has immutable flag. Changing this flag from command line allows to restore successfully.

I tried changing this flag in an rc script with "on boot" trigger, but it does not work, maybe it's ran too soon, when /data is not yet mounted. If I run the same script from command line it changes the flag.

Anyway, i don't think it is a proper way to deal with it.

Is there a proper way to handle this situation ?

Thanks
[Android Software Development] Jay_B:
Any help on the [MENTION=7237874]NepoRood[/MENTION]

Thank you.
[Android Software Development] NepoRood:
APM not working correctly is likely a ROM side issue, as I said before, you can't build the ROM and TWRP together, they each require different build variants to function properly.

You can't do an "eng" recovery build inside a "userdebug" ROM build, so mention your issue to the ROM development team and see if they have any insight.
[Android Software Development] pix106:
No one has an idea about how to handle swap in a file ?

I thought about excluding from backup and/or restore, modifying TWRP code, but there may be a simple way.
[Android Software Development] ashyx:
Have you tried on post-fs-data instead?
[Android Software Development] shanman-2:
make_ext4fs

Hi all,

I am having problems with restoring the system partition with twrp 3.2.1-0 on my huawei y6 2017. When restoring it uses mke2fs to format the partition and all seems to go well until I reboot and it will not boot the os!

If I use twrp 3.1.1 the restore uses make_ext4fs and all works well even using the backup created with version 3.2.1-0.

My question is how to force twrp to use make_ext4fs?

If I just use rm -rf it works fine!

Edit: found this flag: TW_ALWAYS_RMRF := true

2nd edit: Didn't think I needed this flag, TARGET_USERIMAGES_USE_EXT4 := true, because userdata partition is f2fs, :p! but it's needed to include ext4 binaries! All's good now. :)

Thanks
[Android Software Development] pix106:
Hi,

Using a MT6680 smartwatch, I'd like to exclude /data/2ndswap file from the backups, because it has an immutable flag which stops restoring a backup.

Is there a simple way of excluding some files when creating a backup ?

I searched in partition.cpp, i found a few things about backup_exclusions but i did not manage to get it working for now (i may have used it wrong)

Thanks.

Edit : modified an old post I wanted to re-up...
[Android Software Development] Blackball:
Just question.

I wanna flash a test build of my Rom and I get "error 3"

I never saw that before. Someone have an idea?

Part of log:

failed:out of memory

sysutil: Map of myrom.zip failed

failed to map package myrom.zip

I tried with 3.2.1_0 and 3.1.1

Gesendet von meinem BKL-L04 mit Tapatalk
[Android Software Development] _that:
I guess that myrom.zip is just too large. That's all I can say with the incredible amount of details you provided.

Also, how is this problem related to compiling TWRP?
[Android Software Development] Blackball:
I didnt know thats possible that a zip is too large. I never had this problem before.

Its working work with less as 2GB.

I asked here because i have build the twrp and maybe i can change the max size of flashable zips
[Android Software Development] _that:
Apparently TWRP was able to extract the update-binary just fine, but your update-binary (which is built as part of the ROM) doesn't support big zips. So your problem is with the ROM build, not with TWRP.
[Android Software Development] droopyar:
Someone could help me to build twrp for SM-G570M Nougat 7.0?
[Android Software Development] Wajdi Muhtadi:
Copying baseline ramdisk...

cp: cannot stat '/home/wajdi/Documents/omni/out/target/product/wingray/system/bin/adbd': No such file or directory

ninja: build stopped: subcommand failed.

13:33:35 ninja failed with: exit status 1

anyone has this
[Android Software Development] مضر الحلو:
تم الإرسال من SM-G935F باستخدام Tapatalk