yashsingh1/xdaforums huggingface dataset:
[Android Software Development] AnotherFreakinNoob:
I'm using an Ubuntu 16.04 LTs with JDK7 to compile. I followed the guide https://nathanpfry.com/how-to-setup-ubuntu-16-04-lts-xenial-xerus-to-compile-android-roms/ to set up my build machine. The compile went smooth (1 kernel error and 1 SElinux policy error that I was able to fix) and I was able make successfully. However I'm having a problem when I make bootimage. The boot.img itself is only 3.1 MB. My out folder consist of the kernel (3.1 MB), boot.img (3.1 MB), ramdisk.img (912 kb), ramdisk.cipo (1.6 MB), and ramdisk-recovery.cipo (10 MB). I've noticed my recovery-ramdisk is made before the kernel is built...

java -jar /home/rick/TWRP/out/host/linux-x86/framework/dumpkey.jar build/target/product/security/testkey.x509.pem build/target/product/security/cm.x509.pem build/target/product/security/cm-devkey.x509.pem > /home/rick/TWRP/out/target/product/i777/obj/PACKAGING/ota_keys_intermediates/keys
----- Making recovery ramdisk ------
Copying baseline ramdisk...
Modifying ramdisk contents...
----- Making uncompressed recovery ramdisk ------
zcat /home/rick/TWRP/out/target/product/i777/ramdisk.img > /home/rick/TWRP/out/target/product/i777/ramdisk.cpio
Building Kernel
make -C kernel/samsung/smdk4412 O=/home/rick/TWRP/out/target/product/i777/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE="/home/rick/TWRP/prebuilts/misc/linux-x86/ccache/ccache arm-eabi-" zImage
make[1]: Entering directory '/home/rick/TWRP/kernel/samsung/smdk4412'

The end of my build looks like so....

make[1]: Leaving directory '/home/rick/TWRP/kernel/samsung/smdk4412'
make[1]: Entering directory '/home/rick/TWRP/kernel/samsung/smdk4412'
INSTALL drivers/net/wireless/bcmdhd/dhd.ko
INSTALL drivers/samsung/fm_si4709/Si4709_driver.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
INSTALL fs/cifs/cifs.ko
INSTALL fs/lockd/lockd.ko
INSTALL fs/nfs/nfs.ko
INSTALL net/sunrpc/auth_gss/auth_rpcgss.ko
INSTALL net/sunrpc/auth_gss/rpcsec_gss_krb5.ko
INSTALL net/sunrpc/sunrpc.ko
DEPMOD 3.0.101-CM-gca2a2d5-dirty
Warning: you may need to install module-init-tools
See http://www.codemonkey.org.uk/docs/post-halloween-2.6.txt
make[1]: Leaving directory '/home/rick/TWRP/kernel/samsung/smdk4412'
mdpath=`find /home/rick/TWRP/out/target/product/i777/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; ko=`find $mpath/kernel -type f -name *.ko`; for i in $ko; do arm-eabi-strip --strip-unneeded $i; mv $i /home/rick/TWRP/out/target/product/i777/system/lib/modules/; done; fi
mdpath=`find /home/rick/TWRP/out/target/product/i777/system/lib/modules -type f -name modules.order`; if [ "$mdpath" != "" ];then mpath=`dirname $mdpath`; rm -rf $mpath; fi
target Prebuilt: (/home/rick/TWRP/out/target/product/i777/kernel)
/home/rick/TWRP/out/host/linux-x86/bin/acp -fp /home/rick/TWRP/out/target/product/i777/kernel /home/rick/TWRP/out/target/product/i777/boot.img

#### make completed successfully (18:35 (mm:ss)) ####

Any clue why my boot.img isn't making properly and how to fix?
[Android Software Development] NepoRood:
Make one then, there's some good info on the first page of this thread :good:

(For a SBS guide, click This)
[Android Software Development] shoey63:
Have you tried

make -j<cpu cores> bootimage recoveryimage

After all, you want a recovery.img, not a boot.img?
[Android Software Development] AnotherFreakinNoob:
I do. Yet I have a Samsung device. So I was under the impression that I needed to run the command make bootimage.
[Android Software Development] shoey63:
So an S2 or Note1? Yes those devices have recovery inside the boot.img. Newer ones have a separate recovery partition, and that is what TWRP is designed for these days. I have no idea how to incorporate TWRP 3.1.0 into such a device. Sorry :(
[Android Software Development] AnotherFreakinNoob:
Its an S2. I used CM 13 trees and android 6.0 to build. Which is 3.0 is it not? I know its possible to build as their is a TWRP 3.0.2.0 for the i777, which is practically identical to my phone, the s959g.
[Android Software Development] shoey63:
Maybe its too big. Try excluding supersu.
[Android Software Development] AnotherFreakinNoob:
Thanks man. I'll give it a try
[Android Software Development] AnotherFreakinNoob:
And.....still no luck. Looks like all my files stayed the same except the ramdisk-recovery.cpio which dropped from 10 MB to 9.7 Here's a photo of my OUT directory
[Android Software Development] NepoRood:
Did you clobber or clean first?
[Android Software Development] trashmaster76:
When I try to build Team Win Recovery with Lineage OS 14.1 source code there is an error.

Something with "libhealthd.cm" (vendor/cm/charger)
[Android Software Development] AnotherFreakinNoob:
I did.
[Android Software Development] morfikov:
I'm working on TWRP port for TP-LINK Neffos X1 (SoC MT6755M). This device is a little bit different compared to those I was working with earlier. The key feature in the case of Neffos X1 is the fingerprint sensor. This device also has some kind of a dedicated encryption chip, and the phone is force-encrypted by default (HW based, and this can't be changed).

I have a working TWRP for the phone already (it decrypts the /data/ partition successfully), but I just wanted to ask about unlocking the /data/ partition under TWRP.

Basically when I boot into TWRP, it decrypts the /data/ partition automatically without any password/PIN/fingerprint (it says something about some default password that was used). Here's the log:

I:Created '/sdcard' folder.
I:Can't probe device /dev/block/mmcblk0p28
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p28', current file system: 'ext4'
I:Can't probe device /dev/block/mmcblk0p28
I:Unable to mount '/data'
I:Actual block device: '/dev/block/mmcblk0p28', current file system: 'ext4'
get_crypt_ftr_info crypto key location: '/dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/metadata'
I:Backup folder set to '/data/media/TWRP/BACKUPS/Neffos_X1'
I:Settings storage is '/data/media'
I:Device is encrypted with the default password, attempting to decrypt.
crypt_ftr->fs_size = 21901279
Using scrypt for cryptfs KDF
Invalid hex string
kdf failed
failure decrypting master key
Failed to decrypt master key
crypt_ftr->fs_size = 21901279
Using scrypt for cryptfs KDF
Enabling support for allow_discards in dmcrypt.
load_crypto_mapping_table: target_type = crypt
load_crypto_mapping_table: real_blk_name = /dev/block/mmcblk0p28, extra_params = 1 allow_discards
Password matches
Data successfully decrypted, new block device: '/dev/block/dm-0'
I:mount -o bind '/data/media' '/sdcard' process ended with RC=0
I:Backup folder set to '/data/media/0/TWRP/BACKUPS/Neffos_X1'
/data | /dev/block/dm-0 | Size: 0MB Used: 0MB Free: 0MB Backup Size: 0MB
Flags: Can_Be_Mounted Can_Be_Wiped Can_Be_Backed_Up Wipe_During_Factory_Reset Wipe_Available_in_GUI IsPresent Can_Be_Encrypted Is_Encrypted Is_Decrypted Has_Data_Media Can_Encrypt_Backup Use_Userdata_Encryption Is_Storage Is_Settings_Storage
Symlink_Path: /data/media/0
Symlink_Mount_Point: /sdcard
Primary_Block_Device: /dev/block/mmcblk0p28
Decrypted_Block_Device: /dev/block/dm-0
Crypto_Key_Location: /dev/block/platform/mtk-msdc.0/11230000.msdc0/by-name/metadata
Display_Name: data
Storage_Name: data
Backup_Path: /data
Backup_Name: data
Backup_Display_Name: data
Storage_Path: /data/media/0
Current_File_System: ext4
Fstab_File_System: ext4
Backup_Method: files
MTP_Storage_ID: 65537

No matter what settings I use in the system (I tried PIN and fingerprint+PIN), TWRP simply doesn't ask for any of those.

Is that a normal thing or is there a way to set some password in the encrypted phones by default like this one?
[Android Software Development] christpp:
Weird log output on LG L Fino (msm8610)

Hello, I am trying to port the latest TWRP on LG L Fino. The device has TWRP 3.0.0 already ported to it using the stock kernel. I am working with a custom kernel which is currently used in the unofficial lineageos 14.1 build for the device created by me.

So, when the device reboots into recovery, the TWRP welcome screen is shown, then the screen turns black for a fraction of a second and the welcome screen reappears. It then gets to the main screen of the recovery. Trying to connect to the device through an adb shell does not work, the device spits out some contents of the log and the adb command exits. I have been able to pull the recovery log from the device which seems to contain duplicates for each log output line:

__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
Starting TWRP 3.1.0-0- on Tue Jan 13 23:27:25 1970
(pid 204)
Starting TWRP 3.1.0-0- on Tue Jan 13 23:27:25 1970
(pid 205)
TW_NO_REBOOT_BOOTLOADER := trueTW_NO_REBOOT_BOOTLOADER := true

TW_NO_USB_STORAGE := trueTW_NO_USB_STORAGE := true

I:TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
I:TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Found brightness file at '/sys/class/leds/lcd-backlight/brightness'
I:Got max brightness 255 from '/sys/class/leds/lcd-backlight/max_brightness'
I:Got max brightness 255 from '/sys/class/leds/lcd-backlight/max_brightness'
I:TWFunc::Set_Brightness: Setting brightness control to 255
I:TWFunc::Set_Brightness: Setting brightness control to 255
I:LANG: en
I:LANG: en
Starting the UI...Starting the UI...

I can see that the recovery gets two pids. I have a feeling that, for some reason, the recovery process gets executed twice.

Nothing is changed on the recovery code itself. I am trying to build the recovery through a lineageos 14.1 repo.

Could anyone provide some help on this? I can provide anything else that might be needed including the boardconfig configuration options.

Thank you very much in advance
[Android Software Development] vampirefo:
Just try make recoveryimage
[Android Software Development] TimSchumi:
Please don't do double posts. I already answered you in the other thread.
[Android Software Development] M.A.P:
Ok.
[Android Software Development] _that:
Please don't quote long meaningless build logs.
[Android Software Development] TimSchumi:
Oops, sorry, I forgot to edit it out here after I edited it out of my Quote on the other thread. Fixed.
[Android Software Development] pix106:
You should use a pastebin service, that's why there's a size limit... :)
[Android Software Development] nkk71:
Or just read the log ;)

...
- BAD RECOVERY DETECTED, NO UNZIP, ABORTING
...
/tmp/updater[53]: unzip: not found
...

seems [MENTION=8098250]NeoBeum[/MENTION] build is missing /sbin/unzip
[Android Software Development] NeoBeum:
I thought so, thats why I was in the chat last night and asked if I needed to include an extractor in external, but dees_troy said no. Maybe its not being linked. Gzip is not the same?

That got mentioned in chat too :)
[Android Software Development] nkk71:
You shouldn't need to include anything, it should be part of busybox (unless if you're using TW_USE_TOOLBOX:=true in which case according to the makefile it would get built separately).

But busybox should be fine. And I'd recommend you switch to 7.1 tree not 7.0 (as it has some needed updates), or a lower one depending on your device.
[Android Software Development] NeoBeum:
Yeah, when I first pulled the 7 tree, I had problems compiling, then I pulled the 7.1 tree, and was able to build, but also found a bug where TWRP excluded SDK 24, so it took me a bit of digging up to find that bit. It ended up being -ge25 and -lt23, dees_troy said to push a fix, but I don't have access, so I just submitted a bugreport in the github.

https://github.com/omnirom/android_bootable_recovery/issues/158

TW_USE_TOOLBOX is set because I had to set a similar flag for the Sony devices as they used Toybox
[Android Software Development] ZawZaw:
Hi...all,

I have one problem while compiling.

Building from minimal source omni.

Could not find ui.xml for TW_THEME:

Set TARGET_SCREEN_WIDTH and TARGET_SCREEN_HEIGHT to automatically select

an appropriate theme, or set TW_THEME to one of the following:

portrait_hdpi landscape_hdpi portrait_mdpi watch_mdpi landscape_mdpi

****************************************************************************

bootable/recovery/gui/Android.mk:163: *** Theme selection failed; exiting. Stop

Please help me.
[Android Software Development] ashyx:
It's clear as day, you need to set the required theme flag in the config.
[Android Software Development] image45:
Since I moved to version 3.1 I get this error when restoring backups. If I return to 3.0.3 it restores fine.
[Android Software Development] image45:
Image of error
[Android Software Development] ZawZaw:
Please show me this config's loacation path.

•••
[Android Software Development] ashyx:
It's in BoardConfig.mk

Add the required flags there.
[Android Software Development] ZawZaw:
Thanks Sir. :good::good::D

•••
[Android Software Development] _that:
Next time read the OP, it's documented there.
[Android Software Development] robterza:
Guys i need help to change the backup folder name, i dont know how to do it.

I have only the "TWRP_recovery.img" and not the source.

In screenshoot, N1 is the default backup folder name, that i would like to change, with N2.

Is there any way to do this? Any help is appreciate
[Android Software Development] _that:
If you don't build from source, you're in the wrong thread.

The backup folder name is generated from the device serial number, and it is usually a bad idea to change it.
[Android Software Development] mauronofrio:
Hi, i have some problems with encryption on new Xiaomi Mi 6. There is FBE-enabled so when i load the twrp i cant read /data (or /userdata how you prefer). I have seen this commit of Dees Troy for Marlin:

https://github.com/TeamWin/android_...mmit/387e7f8770bb1e9dcfaf4648492b9324f681308c

And then i have seen this files:

https://github.com/TeamWin/android_...id-7.1/recovery/root/sbin/pulldecryptfiles.sh

But on Xiaomi Mi 6 there are not vendor partition and i have extracted lib from factory image but there are not libkmcrypto.so and bootctrl.msm8998.so (Marlin have 8996 but Mi 6 have 8998)

This is the TWRP log error :

I:Setting up '/data' as data/media emulated storage.
I:mount -o bind '/data/media' '/sdcard' process ended with RC=0
I:mount -o bind '/data/media/0' '/sdcard' process ended with RC=0
I:File Based Encryption is present
keyname is ext4:a848cb322f6f5050
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail
keyname is ext4:a848cb322f6f5050
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail
keyname is ext4:a848cb322f6f5050
Unable to find device keyring
Failed to install device key
e4crypt_initialize_global_de returned fail

In stock recovery i have found an unlock_key and a verity_key can these files are useful?

In the attachments you can see the problem

Someone can help me?
[Android Software Development] Deltadroid:
If your device requires qcom_common, then you need to use qcom_common from the android-7.1 branch when building twrp 3.1.1. This commit is needed: https://github.com/TeamWin/android_...mmit/c4dab0d6d73f05b70091761e536b751dc9328f49
[Android Software Development] martyfender:
I searched this thread, but couldn't find an answer. Can TWRP be compiled in windows?

I have a Nextbook Ares 8A which has an Intel Atom x5-Z8350 Cherry Trail Processor. I searched the repository for a similar device, about a month ago and didn't find a similar device. What should I start with? The device has Android 6.0.1. Kernel version 3.14.64-x86_64. It has Intel HD Graphics for Atom x5/x7. I am obviously a noob, so any help would be appreciated.

Thanks
[Android Software Development] mauronofrio:
You cant in windows and you cant with that cpu
[Android Software Development] martyfender:
A developer built it for this device in linux, but he hasn't uploaded it to share.

Thanks for your quick response
[Android Software Development] kasper_h:
This is very device specific. If you can find a recovery.fstab for you device for earlier jellybean time, that would also be helpful as fstab version 2 is of recent design.
[Android Software Development] hell_lock:
The last bug that I'm facing.

Resolution:480x800

Graphics are little messed without any touch and they get fixed on touch.

Sometimes, the graphics are fixed without any touch and touch makes them messy. Just reverse of the above process.

Screenshots are attached. Its the same thing everytime.
[Android Software Development] v_superuser:
Is a logcat possible for when you touch the screen? :rolleyes:
[Android Software Development] thewisenerd:
Getevent might help :fingers-crossed:

Twin0ne has explained it nicely here: http://xdaforums.com/showthread.php?t=1875094 ;)
[Android Software Development] hell_lock:
I couldn't get the logcat but here is the recovery.log

http://pastebin.com/6nGwkJ1f
[Android Software Development] v_superuser:
AFAIK, this got nothing to help and only thing it shows that adb can't get o work in the recovery. :/ Try the link thewisenerd gave above, might be of o some help.
[Android Software Development] Pons:
Any chance you guys can update the list of supported devices? I noticed that the m7vzw isn't on the list, but you do have a download available for it. Thanks for making it available.
[Android Software Development] gimmeitorilltell:
I've been working on this same device and I can get twrp to boot up fine. The problem is all the mount points are incorrect & it refuses to show the sdcard & any operating system. ADB Sideload works! I'm getting closer but it still seems like a long journey! PS: I never made the twrp.fstab file, All I really done was add some flags to the boardconfig.mk & the device resolution. Maybe the two of us can get something going here? I was able to adb sideload my old recovery to save the device from odin the first two times. Now I'm stuck after adding a flag that broke the sideload. Gonna try to fastboot flash the old recovery.
[Android Software Development] gimmeitorilltell:
This is the errors I'm getting.
[Android Software Development] F-L-Y-E-R:
Any one can tell what wrong, after I build a recovery and when I boot it it's all messed up and it's pink and it goes sideways :confused:
[Android Software Development] Bhargav97:
It isn't a long journey now if you got everything working except mounts. This same thing happened to me while building for my device.

Twrp requires v1 fstab instead of new v2. From which branch have you taken the sources of your device (cm-11.0?) If cm11 or omni4.4 then just replace the fstab inside with the one from older versions of android or you can even make yourself if you don't have device tree for older android versions (older than cm10.2) by learning from first post. :)

Ensure that you've entered correct resolution of your device in BoardConfig.mk (as it goes sideways) and also the RGB flag is maybe not defined (thats why pink colour), define it and see. For more info on flags- see first post.
[Android Software Development] gimmeitorilltell:
Thanks for your response & I did grab from the cm10.2 tree actually. I've read the first post a few times and even made a personal print out of it. I think that I skipped right past reading that part. I get too deep into thoughts and my adhd kicks in and get me all confused! I'm building again so will let you know the outcome. :good:
[Android Software Development] gimmeitorilltell:
I've got a working build finally. More discussion here if you wish to join in on the action. It's flashing kitkat now!!! Thanks for this thread and all the advice. Here is other discussion. http://xdaforums.com/showthread.php?t=1647575
[Android Software Development] v_superuser:
[MENTION=912474]Dees_Troy[/MENTION] I own a legacy device which already has TWRP 2.6.3.0, so, I was compiling TWRP 2.7 but, the recovery.img size always came to be more than 5 MB(5MB is the device's recovery partition). Can you help me with this, I and [MENTION=4635923]galaxyfreak[/MENTION] tried almost every kernel compression and the least size that came was 5.16 MB. Can few TWRP commits be reverted and/or something could be done with kernel to get smaller sizes?

Thank You! :D
[Android Software Development] bigsupersquid:
If you turn off all debugging options in the kernel it can crunch it down a bit.

Stripping symbols after building too.
[Android Software Development] gimmeitorilltell:
Try compiling with different toolchains such as linaro for better compression or any other toolchain.
[Android Software Development] aweosomeabhijeet:
Hey people! [MENTION=912474]Dees_Troy[/MENTION] Superb recovery and guide though :good:

My problem is the compiled recovery never works on my device.

I've got a Motorola XT530, it has a locked bootloader so I usually fastboot boot the recovery.img.

Firstly I tried to compile with CM9 source. After I issue the command fastboot boot, it lets me to nowhere, it is stuck there only(the vendor logo).

adb recongnises the device in recovery and adb shell returns nothing and also there is no log present after booting normally to the device

Secondly I thought to compile with CM7 as my device is little older and has GB. It compiled and using adb shell gives

- exec '/system/bin/sh' failed: No such file or directory (2) -

I can easily boot CWM from both the trees(CM7,CM9) but can't get TWRP booting by the same. Here are my TWRP flags

DEVICE_RESOLUTION := 320x480
RECOVERY_GRAPHICS_USE_LINELENGTH := true
TW_NO_REBOOT_BOOTLOADER := true
TW_CUSTOM_POWER_BUTTON := 107
TW_ALWAYS_RMRF := true
TW_BRIGHTNESS_PATH := "/sys/class/leds/lcd-backlight/brightness"
TW_MAX_BRIGHTNESS := 255

Also I've tried all pixel formats, none of them works for me. Please provide me light if I'm doing something wrong.

Regards

Edit : And yes one more thing, the recovery works just fine in emulator if I remove LINELENGTH flag(but not the same in device :( ).
[Android Software Development] lj50036:
[MENTION=912474]Dees_Troy[/MENTION]

Hey great work here :good:, I just saw in the product copy the 2nd twrp.fstab is misspelled..:p

Just a fyi... Thx Josh
[Android Software Development] dams161:
[MENTION=912474]Dees_Troy[/MENTION]

hello

I compile TWRP for alcatel idols.

but I can not manage to make a backup of custpack

how to make a backup from another system or data partition as thank you
[Android Software Development] mauronofrio:
I already have it, but nothing change
[Android Software Development] DiamondJohn:
Not really compiling in windows, but I use a VirtualBox Ubuntu running in Windows 7 64bit. Takes a lot of disk and does require hefty memory to spare and a decent CPU, or patience. Memory and disk are the real limiting factor, I think the CPU (if it can run 64bit VBox) will simply mean you will need more patience. Its all 64bit.
[Android Software Development] ashyx:
You can download precompiled ready to go images from below:

http://www.osboxes.org/
[Android Software Development] martyfender:
I am on an old AMD Athlon II X3 435, 2.9 GHz, 4 Gb Ram, Windows 7 64 bit. How much disk space is required for Your Virtualbox Ubuntu install, Android Studio and any other required to compile TWRP? I have setup virtualbox in the past on someone else's Macintosh, so I am familiar, atleast, with an older version of it. Would 4 Gb of memory be my greatest limiting factor? I hate to do this, but maybe duel booting Windows and Ubuntu would be an option, also. Virualbox ran well on that Mac with Windows, but eventually I used Boot Camp to duel boot on that system, and it flew!

Thanks
[Android Software Development] DiamondJohn:
If I am seeing it right, these are blank shells of installed fl;avours of Unix. They are not pre-pared to compile Android or TWRP?

I havent tested it yet myself, but I did notice that when I create a new drive in VBox, I do have the option to create the virtual drives on USB devices (maybe only USB 3, but I dont think so). I personally have a number of drives and spread the files across my drives. I have gone big, so I cant really say what the min would be, but as a wet finger in the air, I have used about 140GB on my virtual PC, but I have many ROM sources installed,