yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Andrzej_Andrzej:
TWRP and adoptable storage backup

Hi All,

I was wondering if is it possible to add adoptable storage backup option to TWRP ?

I use adopted storage on my xa (Marshmallow). With new Nougat finally coming for my xa when I flash it I will loose all data on adopted storage and then I will have to make my sdcard public (or format it other way) and then I will have to make it private adopted storage again in order to get it back to work as adopted storage in Nougat.

Is there a way to save time and just backup it and then restore with TWRP or other way ?

I would be interested in adding adopted storage to TWRP GUI so I can tick it and backup it.

Any helping ideas would be much appreciated.
[Android Software Development] _that:
Missing from your post is everything you did before entering "make" - which manifest and local manifests were you using, what was your lunch command, etc.
[Android Software Development] _that:
It should already do that, at least there is code for that - see

TWPartitionManager::Decrypt_Adopted()

.
[Android Software Development] Andrzej_Andrzej:
Will that adoptable storage be included in all backup or separate ?

Is it possible in TWRP to add it to GUI in order to check it ?

When I want to do recovery afterwards should I point it to my sdcard and all my adoptable storage will be restored ?

The problem is that when new stock - rom is flashed adoptable storage is gone and all data on it are lost.
[Android Software Development] Captain_Throwback:
When you backup "Data" it will include adoptable storage automatically.

NOTE: It will not include anything in the "media" folder just like Internal Storage isn't included in a standard TWRP backup.
[Android Software Development] Andrzej_Andrzej:
Will it backup my apps as well and their data, as many apps I have on my adoptable storage using AppMgrIII app, so I moved them to sdcard. Generally my question is:

If I do backup and then restore, will my adoptable storage work as before ? Or will I have to partition it (create it ) again and install all apps again ?

I am aware that "media" will not be included (but thank you for reminding it) and this is why I read this thread to learn to add full backup option to my recovery so make full "media" folder backup possible. Full literally I mean full partition not a portion of it.

In TWRP 3.1.0 finally we have this warning in nandroid backup about not including photos, movies, etc. This is important to know it.
[Android Software Development] Captain_Throwback:
Your adoptable partition should work fine after restore. I recently backed up and restored data from one of my devices (including adoptable apps and data) and it worked perfectly. You shouldn't have to re-partition anything.
[Android Software Development] Andrzej_Andrzej:
I will try, thank you very much for help.
[Android Software Development] ScottDB:
I tried to document everything I entered, but may have left something out:

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

$ repo sync -j4 -f --no-clone-bundle

$ git clone https://android.googlesource.com/device/lge/hammerhead

$ source ./build/envsetup.sh

$ lunch omni_hammerhead-eng

Here's what was returned: ( I copied and saved this because of the error messages...)

=================================================================================================

build/core/product_config.mk:234: *** Can not locate config makefile for product "omni_hammerhead". Stop.

WARNING: Trying to fetch a device that's already there

found the hammerhead device repo

wrote the new roomservice manifest

syncing the device config

Fetching project repo

Fetching project android_device_lge_hammerhead

fatal: Couldn't find remote ref refs/heads/android-7.1

Fetching projects: 50% (1/2) fatal: Couldn't find remote ref refs/heads/android-7.1

error: Cannot fetch android_device_lge_hammerhead

warn: --force-broken, continuing to sync

Fetching projects: 100% (2/2)

error: Exited sync due to fetch errors

WARNING: device/lge/hammerhead/omni.dependencies file not found

build/core/product_config.mk:234: *** Can not locate config makefile for product "omni_hammerhead". Stop.

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

** Do you have the right repo manifest?

================================================================================================

then:

$ make clean

$ make -j3 recoveryimage

I realize some of these commands, etc., may be incorrect. I more or less pulled info from two sources: the OP of this thread, and https://docs.omnirom.org/Setting_Up_A_Compile_Environment
[Android Software Development] _that:
This is your problem. You need to use TWRP's or Omni's device tree instead of AOSP's, and you need to put it (and any dependencies) into the correct location, not into the root of the build tree - either using local manifests or the "breakfast" command.
[Android Software Development] ScottDB:
I did move it to device/lge/hammerhead, but will try it again using the correct device tree.

Thanks for the help. :)
[Android Software Development] image45:
My Device is Wileyfox storm (kipper) with no official builds however up to 3.0.3 stable working flash able images have been available of TWRP. For some reason unofficial builds from 3.1.0 - 3.1.1 can not restore backups.

Does anyone's feel they know why this might have occurred?
[Android Software Development] pix106:
Are you trying to build twrp from sources ?
[Android Software Development] image45:
Potentially, however I was attempting to gain any insight into why a move to 3.1 would suddenly result in builds functions working fine, except when trying to run restore function!
[Android Software Development] pix106:
Imho, maybe your system is mounted RO, and/or fstab is wrong, and/or TWRP was built with always mount system RO flag, and/or something else.

The device tree could help see what's wrong
[Android Software Development] aburezk:
How can I add decryption? All files are encrypted
[Android Software Development] Kasual52e:
What device? Also typically only data is encrypted not the system files.
[Android Software Development] aburezk:
True only data is encrypted my device is p10 lite
[Android Software Development] Kasual52e:
Well I can't say for huawei but this is what I needed for an LG

https://gerrit.twrp.me/#/c/2491/
[Android Software Development] aureljared:
Hi all,

I am currently trying to port 3.1.1 to my device (HTC One X+ international). It builds fine however I am facing a couple of issues:

TWRP does not mount any partition. I have compared my fstab to other device trees that have official TWRP builds and they have the same format. /tmp/recovery.log says

=> Processing recovery.fstab
I:Processing '/dev/block/platform/sdhci-tegra.3/by-name/APP'
E:Invalid block device 'ext4' in fstab line '/dev/block/platform/sdhci-tegra.3/by-name/APP	/system ext4 ro,barrier=0 wait
'I:Processing '/dev/block/platform/sdhci-tegra.3/by-name/CAC'
E:Invalid block device 'ext4' in fstab line '/dev/block/platform/sdhci-tegra.3/by-name/CAC	/cache ext4 noatime,nosuid,nodev,noauto_da_alloc,barrier=0	wait,check
'I:Processing '/dev/block/platform/sdhci-tegra.3/by-name/RCA'
E:Invalid block device 'ext4' in fstab line '/dev/block/platform/sdhci-tegra.3/by-name/RCA	/rca ext4 noatime,rw,barrier=0	wait
[........]

However mounting manually does work:

$ adb shell
~# mount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP /system
~# ls /system
app
bin
build.prop
[...]

The display does not work correctly. It responds to touch (vibrations), but the backlight blinks for a few moments and then shuts off permanently unless I manually set the brightness by doing:

$ adb shell
~ # while true; do echo 100 > /sys/devices/platform/tegra-pwm-bl/backlight/tegra-pwm-bl/brightness; sleep 0.2; done

However I am sure that this step should be unnecessary as pre-3.0 TWRP builds have worked flawlessly on this device. Perhaps it is a kernel issue, but I am no expert in this field.

Looking at dmesg, I see something about violations:

<6>[ 15.240435] tegradc tegradc.0: Using mode 720x1280 pclk=63175000 href=0 vref=1
<4>[ 15.274639] tegradc tegradc.0: DC doesn't stop at end of frame.
<4>[ 15.277386] tegradc tegradc.0: dsi: TaSure mipi range violated
<4>[ 15.277391] tegradc tegradc.0: dsi: mipi range violated
<6>[ 15.428254] [DISP]enrc2b_dsi_panel_disable(604) IN
<6>[ 15.445890] [DISP]enrc2b_dsi_panel_disable(625) is_power_on:0
<6>[ 15.445912] [DISP]enrc2b_dsi_panel_disable(628) OUT
<4>[ 15.458798] tegradc tegradc.0: dsi: TaSure mipi range violated
<4>[ 15.458824] tegradc tegradc.0: dsi: mipi range violated

These messages repeat whenever the display is interacted with (touch or change brightness).

My device tree is here, and my kernel source is here.

Any help would be appreciated. I have been trying to come up with solutions for about a week but still no dice.
[Android Software Development] TimSchumi:
It seems your fstab has the wrong format. More information is in the OP
[Android Software Development] aureljared:
Tried conforming my fstab to the format outlined in OP, but then the recovery does not boot at all. Perhaps it is a problem with how I repacked the image as /proc/last_kmsg does not show info from the latest boot. Will look into that soon.

Thanks though!
[Android Software Development] oF2pks:
Check your enrc2b.mk:

# Recovery

PRODUCT_COPY_FILES += \

$(call find-copy-subdir-files,*,device/htc/enrc2b/recovery,recovery/root)

And replace that with valid OLD twrp.fstab

"Code:

PRODUCT_COPY_FILES += device/lge/hammerhead/twrp.fstab:recovery/root/etc/twrp.fstab

The fstab in TWRP can contain some "flags" for each partition listed in the fstab...."

(For info ONLY Nameless unique repo uses modern fstab2 for twrp3.0)
[Android Software Development] ashyx:
Not Booting will have nothing to do with the fstab.

Your original fstab is the wrong format. It needs to be:

Mnt point - FS type - path - flags

.
[Android Software Development] aureljared:
Thank you! Partitions mount fine now.

I did a fresh build with the fixed fstab and it now boots again, although the display still doesn't work properly. Thanks all!

EDIT: Fixed the display! Turns out some commits I made in the kernel a few months ago broke the display on TWRP. Interestingly, those commits did not break anything when booted in Android.
[Android Software Development] aaronwi:
Having an impossible time trying to get this to compile for the zenfone 3 laser Z01B_

zenfone 3 laser Z01B_1/ ZC551KL

No matter if I use the kernel source or precompiled, and even if the location is incorrect I still get the error:

No private recovery resources for TARGET_DEVICE Z01B_1
build/core/tasks/kernel.mk:109: ***************************************************************
build/core/tasks/kernel.mk:110: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:111: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:112: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:113: * source repository to kernel/asus/Z01B_1/
build/core/tasks/kernel.mk:114: * See http://xdaforums.com/wiki/ROM/Integrated_Kernel_Build
build/core/tasks/kernel.mk:115: * for more information *
build/core/tasks/kernel.mk:116: ***************************************************************
build/core/base_rules.mk:319: warning: overriding commands for target `/root/twrp-2/out/target/product/Z01B_1/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:319: warning: ignoring old commands for target `/root/twrp-2/out/target/product/Z01B_1/root/res/images/charger/battery_fail.png'
build/core/base_rules.mk:319: warning: overriding commands for target `/root/twrp-2/out/target/product/Z01B_1/root/res/images/charger/battery_scale.png'
build/core/base_rules.mk:319: warning: ignoring old commands for target `/root/twrp-2/out/target/product/Z01B_1/root/res/images/charger/battery_scale.png'
build/core/Makefile:1112: warning: overriding commands for target `/root/twrp-2/out/target/product/Z01B_1/ramdisk-recovery.cpio'
build/core/Makefile:1068: warning: ignoring old commands for target `/root/twrp-2/out/target/product/Z01B_1/ramdisk-recovery.cpio'
build/core/Makefile:1118: warning: overriding commands for target `/root/twrp-2/out/target/product/Z01B_1/ramdisk-recovery.img'
build/core/Makefile:1074: warning: ignoring old commands for target `/root/twrp-2/out/target/product/Z01B_1/ramdisk-recovery.img'
build/core/Makefile:1124: warning: overriding commands for target `/root/twrp-2/out/target/product/Z01B_1/recovery.img'
build/core/Makefile:1079: warning: ignoring old commands for target `/root/twrp-2/out/target/product/Z01B_1/recovery.img'
build/core/ninja.mk:172: recipe for target '/root/twrp-2/out/build-omni_Z01B_1.ninja' failed
make: *** [/root/twrp-2/out/build-omni_Z01B_1.ninja] Killed

compile log Here

and boardconfig.mk Here
[Android Software Development] ashyx:
In your boardconfig.mk don't put a slash at the end of your kernel path as this will be treated as another directory and won't pick up the actual kernel binary.
[Android Software Development] aaronwi:
I actually had the extracted boot.img using android image kitchen and put it in that kernel directory, the documentation here is pretty poor on the correct way to do this.

Now I just tried using https://xdaforums.com/showthread.php?t=1659584 to extract the kernel file from boot.img, I removed the trailing slash and put the file named 'kernel' in the same spot, and still get the exact same build error.

No private recovery resources for TARGET_DEVICE Z01B_1
[Android Software Development] Captain_Throwback:
Did you remove the kernel folder?
[Android Software Development] Magendanz:
The latest Android 7.1 firmware for the Rockchip RK33xx series has a separate partition for the kernel so that it's not included in either the boot or recovery images. When I examined the only TWRP build that I could find that worked on these devices by AbduL, it seemed strange because the image didn't include a kernel...but it worked. I was able to modify the fstab to get it working with my device, but there's still a problem with the bootloader message block offset that I need to correct by adding BOARD_RECOVERY_BLDRMSG_OFFSET to the BoardConfig.mk.

While I've got some experience building TWRP recoveries for Amlogic devices, this is the first time I've tried to build one for Rockchip...and I'm not sure how to get it to generate a recovery image without a kernel. Using TARGET_NO_KERNEL := true alone doesn't seem to work. The output shows that it's starting the build with ninja, "ninja: Entering directory '.'" and then "ninja: no work to do."

Can anyone provide a hint?
[Android Software Development] kai-dj:
BoardConfig.mk

If I make a mistake in my BoardConfig.mk (I have an unusual device, for wich I didn't find premade ones [Lenovo Medion X5004]) – and it segfaults or I get this twrp boot loop – would I still be able to boot to system and flash back stock recovery image with FlashFire?
[Android Software Development] vampirefo:
Probably
[Android Software Development] AndroPlus:
Display can't show anything on Xperia XZ Premium

I am trying to port TWRP to Sony Xperia XZ Premium and TWRP itself is booting fine and I can decrypt internal storage successfully,

but display is stuck at manufacture logo and TWRP GUI is not showing.

TW_SCREEN_BLANK_ON_BOOT or TW_NO_SCREEN_BLANK doesn't seems to have any effect.

Does anyone know how to fix displaying GUI of TWRP?

My device tree:

https://github.com/AndroPlus-org/device-sony-maple-twrp

Kernel:

https://github.com/AndroPlus-org/android-kernel-sony-msm8998

TWRP image and logs:

https://drive.google.com/file/d/0B0j3VJ1Xp5N8MzdxX2NiZGp2SHM/view?usp=sharing
[Android Software Development] chris_groessler:
trying to compile TWRP for Samsung S7 (SM-G930F)

Hi,

I'm trying to compile TWRP for my S7. It worked fine, but is using a precompiled kernel. I want to also compile the kernel locally.

What I did:

clone omnirom repo:
-------------------

repo init -u https://github.com/omnirom/android.git -b android-6.0

add this file:
--------------

$ cat .repo/local_manifests/herolte.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project path="device/samsung/herolte" name="android_device_samsung_herolte" remote="TeamWin" revision="android-6.0" />
</manifest>

add this entry to .repo/manifest.xml:
-------------------------------------

<remote name="TeamWin"
fetch="ssh://git@github.com/TeamWin"
review="gerrit.twrp.me" />

Sync repo:
----------

repo sync

Build:
------

$ . build/envsetup.sh
$ lunch omni_herolte-eng
$ make recoveryimage

After flashing the image and connecting via adb I noticed that the kernel wasn't compiled by me:

$ adb shell
~ # cat /proc/version
Linux version 3.18.43-twrp-herolte-xx-1.3 (jc@westerley) (gcc version 5.3.1 20160412 (Linaro GCC 5.3-2016.05) ) #1 SMP PREEMPT Thu Oct 13 21:08:20 EDT 2016
~ #

Looking at my make.log I see the following:

build/core/tasks/kernel.mk:104: ***************************************************************
build/core/tasks/kernel.mk:105: * Using prebuilt kernel binary instead of source *
build/core/tasks/kernel.mk:106: * THIS IS DEPRECATED, AND WILL BE DISCONTINUED *
build/core/tasks/kernel.mk:107: * Please configure your device to download the kernel *
build/core/tasks/kernel.mk:108: * source repository to kernel/samsung/herolte
build/core/tasks/kernel.mk:109: * See http://xdaforums.com/wiki/ROM/Integrated_Kernel_Build
build/core/tasks/kernel.mk:110: * for more information *
build/core/tasks/kernel.mk:111: ***************************************************************

The referenced web page seems to be empty. So my question is how do I plug the kernel compile into the build system?

The required kernel sources seem to be at github.com:jcadduono/android_kernel_samsung_universal8890.git . I haven't found information there about how to include the kernel into the build (like it was explained in github.com:TeamWin/android_device_samsung_herolte.git, file README.md).

Thanks for any help.

regards,

chris
[Android Software Development] Wf.julian82:
Samsung galaxy on7

Hi.. gud eve. I hve my mobile samsung on7.how can i flash my mobile ? I want to upgrade my

Android version.

I appreciate you effort.thanks
[Android Software Development] _that:
Modify your local manifest to clone the kernel source to kernel/$MANUFACTURER/$DEVICE (same subdirs as you already have under device/). Run repo sync to get the sources. Modify your BoardConfig.mk (in device/$MANUFACTURER/$DEVICE) and add:

TARGET_KERNEL_SOURCE := kernel/$MANUFACTURER/$DEVICE
TARGET_KERNEL_CONFIG := $DEFCONFIG

where $DEFCONFIG is the name of the correct defconfig file in arch/arm/configs (or arm64) for your device, and remove or comment out the line for TARGET_PREBUILT_KERNEL.

You're in the wrong thread, post in your device forum instead.
[Android Software Development] chris_groessler:
Thanks a lot! It worked.

Initially it didn't work, I got errors when compiling the kernel.

I did this change to BoardConfig.mk:

diff --git a/BoardConfig.mk b/BoardConfig.mk
index 2f1ae5a..c2d9ff1 100644
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -29,13 +29,14 @@ TARGET_2ND_CPU_VARIANT := cortex-a53

# Kernel
TARGET_USES_UNCOMPRESSED_KERNEL := true
-#TARGET_KERNEL_SOURCE := kernel/samsung/universal8890
+TARGET_KERNEL_SOURCE := kernel/samsung/universal8890
TARGET_KERNEL_ARCH := arm64
TARGET_KERNEL_HEADER_ARCH := arm64
-TARGET_KERNEL_CONFIG := twrp_defconfig
+TARGET_KERNEL_CONFIG := my_defconfig
+#TARGET_KERNEL_CONFIG := twrp_defconfig
TARGET_KERNEL_DEVICE_DEFCONFIG := device_herolte_xx

-TARGET_PREBUILT_KERNEL := $(DEVICE_TREE)/Image
+#TARGET_PREBUILT_KERNEL := $(DEVICE_TREE)/Image
TARGET_PREBUILT_DTB := $(DEVICE_TREE)/dtb.img

# DTB

Initially I had TARGET_KERNEL_CONFIG set to twrp_defconfig, but this didn't pick up the different config from device_herolte_xx, resulting in a compilation error.

Then, after some tries and changes which didn't work, I made my own kernel config file by

$ cat twrp_defconfig device_herolte_xx > my_defconfig

This worked then....

regards,

chris
[Android Software Development] pvineeth97:
I successfully compiled TWRP 3.1.0 for my phone LG K10 but I am unable to get battery status working on TWRP.

Here is my device tree: https://github.com/PVineeth/android_device_lge_m216_recovery
[Android Software Development] NepoRood:
There's a flag for that

# Example
TW_CUSTOM_BATTERY_PATH := /sys/class/power_supply/battery/batt_attr_text

You'll check your stock firmware for proper path...
[Android Software Development] Magendanz:
I just created a TWRP recovery project for the Amlogic q20x reference board (e.g. MECOOL M8S Pro, KM8 Pro, etc. running 64-bit Android 7.1.2). The GitHub repo is here and here's the signed updater: twrp.q20x-3.1.1-0-signed.zip

The one issue I've been seeing with this build is a loss of video sync on startup, which can be remedied by unplugging the HDMI cable and reconnecting it. Anyone have an idea what could be causing this?

UPDATE: Seems the latest OEM recovery for the M8S Pro had a bad*systemcontrol_static binary.* Replacing it with an older rev fixed the display blanking issue.
[Android Software Development] inanloukarim:
i successfully compiled TWRP 3.1.1 for my phone samsung c7pro 2017 but I am unable to mount data,efs,int-sd and ext-sd only can mount system.

error creating fstab

E:can not mount data (invalid argument)

faile to mount storage premission denide

in selecting storage int,ext sd size 0mb

can anyone please help me?

sorry for my bad inglish?
[Android Software Development] NepoRood:
Update or push your device tree(s) to Github, and provide us a link :good:
[Android Software Development] Mudunuri Sriram:
buildconfing.mk

where can i find buildconfig.mk for my device

mine is lava V23GB
[Android Software Development] inanloukarim:
this is my device tree

https://github.com/inanloukarim/android_device_samsung_c7proltechn-twrp.git
[Android Software Development] ashyx:
Not that it's linked to your issue, but I'd remove postrecovery.do from the root folder as it's not required.

I'm guessing you're using the stock kernel?
[Android Software Development] inanloukarim:
Thank you.

I extract kernel from stock recovery.imag and put stock kernel source in kernel/samsung/msm8953.i compiled twrp several time by removing and adding bordconfig.mk lines (looking other devices but not changed errors,only changed compiled recovery seize and all of theme boot up.

In my stock recovery ramdisk I can't found init.recovery.qcom and I take it from c5lte.

Sorry for my bad English.
[Android Software Development] ashyx:
You're issue is likely the stock kernel and SELINUX restrictions. You need to compile the kernel from source with SELINUX in permissive mode.
[Android Software Development] inanloukarim:
How can I do it?
[Android Software Development] ashyx:
Download the source from Samsung and compile on Linux using the relevant Toolchain.
[Android Software Development] Mitsch79:
Hi guys, i have a question regarding twrp. I have setup a build environment and successfully built a rom for my device (jfltexx). I included twrp (recovery variant) and source and stuff, so the rom was built with twrp integrated. The problem is when if flash the rom then the rom is updated but the recovery isn't. I would have to flash the recovery.img manually which in fact is not what i had in mind ^^

So do you know whether there is some additional build flag one has to set to make sure that flashing the rom is updating the recovery as well?
[Android Software Development] _that:
Flashing the ROM will never update your recovery, that happens when you boot the ROM (but that is usually disabled by TWRP if you allow it to write to /system). Don't ask me how that works exactly, I've never done it.
[Android Software Development] narueon:
I am trying to build TWRP using minimal source (lineage). I have put device,kernel, vendor files in appropriate folder. The build stops at 53%. It's because of building kernel I think.

linking the sources.

Build error : https://goo.gl/bLzyqa

Kernel : https://github.com/zf5/android_kernel_asus_T00F

Device : https://github.com/zf5/android_device_asus_T00F

Vendor : https://github.com/zf5/android_vendor_asus

Please help me to build twrp