yashsingh1/xdaforums huggingface dataset:
[Android Software Development] ashyx:
As said you need to modify the fstab so it's in the correct format.

Samsung stock FSTAB has the wrong format for TWRP.

It needs to be like the example below:

https://github.com/ashyx/TWRP_Samsung_gt510wifi/blob/Android-6.0/recovery.fstab

---------- Post added at 10:15 PM ---------- Previous post was at 10:00 PM ----------

Are we building for twrp or cwm now?

You need to post your full device tree I.E. Github source.

What you've posted is useless. We need to see your make files.
[Android Software Development] Matt07211:
No, I'll try later when I'm off work.
[Android Software Development] zameer_yus:
i m building twrp now

here is the screen shot of out folders

---------- Post added at 04:23 PM ---------- Previous post was at 03:46 PM ----------
[Android Software Development] zameer_yus:
i unpack the recovery.img file and i figure out that there is recovery.img-dtb file missing inside recovery_unpacked\split_img

i copy copy the missing file from stock recovery then repack recovery.img now phone is booting up in twrp recovery

but its not mounting partations
[Android Software Development] ashyx:
Then you need to look at your fstab file. See the post above to the other member.
[Android Software Development] zameer_yus:
thanks sir for the answer

1st. just wanted to know why recovery.img-dtb was missing while i compiled the recovery ?

2nd. i have follow your guide regarding recovery.fstab , i copy twrpfstab sample from first post of this thread and modified as my device

after that all partitions appears on twrp all , all of them can be mount except DATA

DATA is not mounting ,

to fixt this issue i perform format data from / wipe/formate data

now i can mount and unmount data

but device stucks on boot loop only i can goto recovery mode not system

new fstab file

---------- Post added at 06:25 PM ---------- Previous post was at 06:19 PM ----------

hello sir now i m compiling twrp so far i compile twrp without any error but device is not booing up in recovery

please see my posts for details

https://xdaforums.com/showpost.php?p=71721191&postcount=3066

https://xdaforums.com/showpost.php?p=71721677&postcount=3068

https://xdaforums.com/showpost.php?p=71723191&postcount=3070
[Android Software Development] ashyx:
Looks like you're hitting dm-verity. You must have mounted the system partition in TWRP.

You need to disable dm-verity, to do this you can flash supersu or no-verity-opt-encrypt or remove the verify flag from the fstab.
[Android Software Development] TimSchumi:
I'm getting the 'Kernel does not have support for reading SELinux contexts.' message. I already confirmed that my kernel (which is build from source) has SELinux support, as SELinux can be switched to permissive mode when booting up CM with the same kernel source. Am I missing something obvious?

Device tree: http://www.github.com/SiniTurk/android_device_samsung_cs02/tree/twrp-6.0

Kernel tree: http://www.github.com/SiniTurk/android_kernel_samsung_cs02/tree/twrp-6.0
[Android Software Development] kirito9:
Try the SELinux flag.
[Android Software Development] TimSchumi:
Which? Do you mean the androidboot.selinux kernel cmdline flag?
[Android Software Development] kirito9:
Add TWHAVE_SELINUX := true in BoardConfig.mk.
[Android Software Development] _that:
That won't do anything.
[Android Software Development] TimSchumi:
Any other things I could try?
[Android Software Development] _that:
Post more of the log - does it say "Could not check /cache/recovery SELinux contexts, using /sbin/teamwin instead which may be inaccurate." before that other message? Does /cache/recovery exist?
[Android Software Development] TimSchumi:
No, it just tells the message I posted (Except for something like "MTP enabled").

I can check for /cache/recovery when I'm home.

Are there any logs I could check for more information?

EDIT: /cache/recovery does exist.

I'm getting a weird message when running ls -al btw:

__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules

and

__bionic_open_tzdata: couldn't find any tzdata when looking for CST6CDT.M3.2.0.M11.1.0
[Android Software Development] skoar:
[MENTION=1162986]Captain_Throwback[/MENTION] [MENTION=4878287]_that[/MENTION]

Somehow I was able reduce the recovery.img size to below 8mb and managed to boot into twrp but touch is not working do I need to add any additional flags or something else in my device tree ???
[Android Software Development] zameer_yus:
how to remove the verify flag from the fstab. , can you give me some explanation

because i could see anything called verify flag in fstab file
[Android Software Development] ashyx:
It should be in the boot image fstab on the system partition line.
[Android Software Development] TimSchumi:
Some kernels have it hardcoded, that the touch driver is disabled when booting into recovery. I don't really know where this is managed though, do you have any kernel tree I could look at?
[Android Software Development] skoar:
Uh... sure here is the link

https://github.com/skoar/android_kernel_tegratab/tree/rel-tegranote-r8

(tegra_tegratab_android_defconfig)
[Android Software Development] TimSchumi:
Hmm... Can't find anything concerning the touch driver and the bootmode
[Android Software Development] ashyx:
Are your recovery and boot dtb's identical in size, byte for byte? If not try the boot dtb.
[Android Software Development] _that:
We don't include tzdata by default because it would adds more bloat to the recovery image. But you should run ls -lZ, e.g. on /system/bin, to see if ls can read the SELinux contexts.

How to debug touch issues: https://xdaforums.com/showpost.php?p=71400973&postcount=2884
[Android Software Development] TimSchumi:
'ls -lZ /system/bin' shows 'unknown' on every file
[Android Software Development] _that:
OK, so something is not right in your kernel (or your Android works without SELinux?!).
[Android Software Development] Surge1223:
Oo
[Android Software Development] TimSchumi:
My CM 13 runs in permissive SELinux with exactly the same kernel source

(I still need to patch the system though to support permissive, as I didn't fix up the policies on it yet)
[Android Software Development] chautruongthinh:
help me to fix touch for my device

I compiled TWRP 2.8.x (i used branch android-5.1) and everythings worked great. Then i compiled TWRP 3.1.x (use branch android-6.0) and everthings worked great except touch (I used OTG to test it)

I hope [MENTION=912474]Dees_Troy[/MENTION] or someone can help me to fix touch for my device.

My device: https://github.com/chautruongthinh/android_device_pantech_ef52

Recovery log of TWRP 3.1.0.0: https://pastebin.com/VbEBuaW4

Dmesg: https://pastebin.com/3q4nM2Z5
[Android Software Development] ashyx:
Compiled in android 6 branch using an android 5 kernel? Surprised it even booted. Why don't you just compile in branch 5.1?
[Android Software Development] chautruongthinh:
I compiled with branch 5.1 but i got same problem. I only can't boot when i compile branch 7.1 :D

I tried to add

RECOVERY_GRAPHICS_FORCE_SINGLE_BUFFER := true

to Boardconfig.mk and i can touch but i got black screen
[Android Software Development] morfikov:
I have a question concerning the following info in the build log:

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/tp-link/tp701a
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: ***************************************************************

It simply says that some info is under that link. But there's no info there.

I just wanted to know what I should do in order to build the kernel from source. I have the kernel source code (it can be downloaded from here), but how to integrate it with the rest of the device config tree?

And one more question. How long does it usually take to include a device on the list of the officially supported devices? I just wanted to send the 4 devices I have config for, but I got no reply from the TWRP team. Should I send the request somewhere else of something?
[Android Software Development] ashyx:
I thought you said you'd compiled with branch 6.0, but now you say 7.1? Are you using different kernels?

---------- Post added at 05:51 PM ---------- Previous post was at 05:45 PM ----------

I wouldn't worry about that warning. I don't think there are plans to actually remove prebuilt kernel support just yet.

Pretty much most of the TWRP builds available use prebuilt binaries.

You can contact teamwin on IRC.
[Android Software Development] morfikov:
Yes, but I want to play a little bit with the kernel configuration anyway. So could anyone help me with the setup? So far I just have the kernel source.
[Android Software Development] ashyx:
Don't you think you should just actually compile the kernel source first?

Compiling kernel sources is also out of the scope of this thread.
[Android Software Development] morfikov:
I thought there's some setup to include the kernel source, so when I issue "make recoveryimage", it would do something with it. But if there's isn't, that's fine.
[Android Software Development] _that:
There is. With similar subdirectories to device/$VENDOR/$CODENAME, put your kernel sources into kernel/$VENDOR/$CODENAME, and set the following in your BoardConfig.mk:

TARGET_KERNEL_SOURCE := kernel/$VENDOR/$CODENAME
TARGET_KERNEL_CONFIG := $NAME_OF_YOUR_DEFCONFIG

where $NAME_OF_YOUR_DEFCONFIG is the name of one of the files in your kernel source tree in arch/arm/configs.
[Android Software Development] chautruongthinh:
I compiled with all branch!! I got touch problem with branch 5.1 & 6.0 and i cant not boot with branch 7.1
[Android Software Development] skoar:
[MENTION=1162986]Captain_Throwback[/MENTION] [MENTION=4878287]_that[/MENTION]

I finally got touch working but there are a few more problem. After booting into recovery it automatically reboots after 13-14 seconds + it doesn't retain any changes that I make into settings + mtp is not working ( I think it's because my 'persist.sys.usb.config=adb' in default.prop I think I need to add mtp to it. I came to know about it after I unpacked the ramdisk of recovery.img). I'm attaching my recovery log. I hope I can finally get it right.
[Android Software Development] _that:
Apparently your fstab has the wrong format, read the OP to see how it should be formatted, or look around on https://github.com/TeamWin for examples in other devices trees.
[Android Software Development] ashyx:
Looks like all partitions are mounting just fine except /data which is most likely due to encryption.

[MENTION=8025757]skoar[/MENTION] TWRP doesn't like Samsungs MTP kernel driver.

Your settings will stick if you remove encryption from /data.
[Android Software Development] _that:
Are we reading the same recovery.log? The one attached to https://xdaforums.com/showpost.php?p=71768066&postcount=3103 is from an NVIDIA TegraTab device, and it has several errors saying "Invalid block device 'ext4' in fstab".
[Android Software Development] ashyx:
No, my apologies, dont know what happened there! The recovery log I was looking at was for a Samsung device. Bloomin Samsung download manager or maybe XDA Labs.

Used ADM via browser and it was fine. :silly:
[Android Software Development] morfikov:
Ok, so if my device is arm64, I should look for the config in arch/arm64/configs/ instead, right?

The next thing. I can see multiple files under the arch/arm64/configs/ dir.

$ ls /arch/arm64/configs
defconfig
hq6735_65c_b1p_l1_debug_defconfig
hq6735_65c_b1p_l1_defconfig
hq6735_65u_b1p_l1_debug_defconfig
hq6735_65u_b1p_l1_defconfig
hq6753_65c_b1p_l1_debug_defconfig
hq6753_65c_b1p_l1_defconfig
hq6753_65u_b1p_l1_debug_defconfig
hq6753_65u_b1p_l1_defconfig

So if I understand correctly we have here configs for two devices: MT6735 and MT6753 SoC. The one I'm working on right now uses the MT6735 SoC, but which one file should I choose here? Leaving debug configs alone, I have to choose between _65c and _65u variants. What do the suffixes mean? I diff'ed the two files and they're some differences in the configuration. In the case of _65u variant, the two flags are set:

CONFIG_NFC=y
CONFIG_MTK_SHARED_SDCARD=y

Assuming I chose the second config, the flags I have to add to the BoardConfig.mk file would look like this?

TARGET_KERNEL_SOURCE := kernel/tp-link/tp701a
TARGET_KERNEL_CONFIG := hq6735_65u_b1p_l1_defconfig

And the last question, what about this flag?

TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel

Should this be commented out?
[Android Software Development] kirito9:
Commented out yes. Check your build.prop for your device. It usually tells you which defconfig they used. The setup in the BoardConfig.mk seems right.
[Android Software Development] morfikov:
I got it:

# cat build.prop | grep hq6735_ <
ro.build.flavor=hq6735_65u_b1p_l1-user
ro.build.product=hq6735_65u_b1p_l1
ro.build.description=hq6735_65u_b1p_l1-user 5.1 LMY47D 1488421968 release-keys
# from huaqin/config/hq6735_65u_b1p_l1/al815row/default/system.prop
ro.mediatek.project.path=device/huaqin/hq6735_65u_b1p_l1
[Android Software Development] morfikov:
I think the kernel source is bugged somehow, or I'm unable to build it on my current system. I get tons of the following errors:

scripts/basic/fixdep.c:91:15: error: stray '\32' in program
scripts/basic/fixdep.c:91:16: warning: missing terminating ' character
scripts/basic/fixdep.c:91:16: error: missing terminating ' character
scripts/basic/fixdep.c:92:1: error: stray '\27' in program
scripts/basic/fixdep.c:92:3: error: stray '\312' in program
scripts/basic/fixdep.c:92:6: error: stray '\204' in program
scripts/basic/fixdep.c:92:10: error: stray '\246' in program
scripts/basic/fixdep.c:92:11: warning: unknown escape sequence: '\207'
scripts/basic/fixdep.c:92:11: warning: unknown escape sequence: '\#'
scripts/basic/fixdep.c:92:11: warning: character constant too long for its type
scripts/basic/fixdep.c:92:52: error: stray '\32' in program
scripts/basic/fixdep.c:92:53: error: stray '\307' in program
scripts/basic/fixdep.c:92:55: error: stray '\232' in program
scripts/basic/fixdep.c:92:56: error: stray '\261' in program
scripts/basic/fixdep.c:92:57: error: stray '\363' in program
scripts/basic/fixdep.c:92:59: error: stray '\300' in program
scripts/basic/fixdep.c:92:60: error: stray '\3' in program
scripts/basic/fixdep.c:93:1: error: stray '\263' in program
scripts/basic/fixdep.c:93:2: warning: missing terminating ' character
scripts/basic/fixdep.c:93:2: error: missing terminating ' character

and at the end I get this:

scripts/Makefile.host:118: recipe for target 'scripts/basic/fixdep' failed
make[1]: *** [scripts/basic/fixdep] Error 1
Makefile:421: recipe for target 'scripts_basic' failed
make: *** [scripts_basic] Error 2

I think I'm not going to build this unless someone knows the cause. :D
[Android Software Development] kirito9:
Did you try building outside twrp? If you did and it did build then it isn't bugged. Link to source?
[Android Software Development] morfikov:
Yes, I tried to switch to the dir and use just "make" or "make hq6735_65u_b1p_l1_defconfig" but the same result. Even "make clean" returns errors.

Here's the link to the source (see GPL code).
[Android Software Development] kirito9:
I think you would have to setup the toolchain path when building from the dir but I'm not sure. I do not have any experience building kernels in twrp but I can try to verify your source is "fine".

Edit: Wouldn't it be make zImage from the dir and not make x_defconfig?
[Android Software Development] morfikov:
It would be sufficient just to check. If it builds for you, I'll find the way to fix the problems I have.

None of them is working.
[Android Software Development] kirito9:
Strange, I'll check it.
[Android Software Development] kirito9:
Buggy source, your scripts folder in the kernel. Maybe an expert in C ( [MENTION=4878287]_that[/MENTION] ) can help. I tried fixing that first fixdep.c file (I wasn't able to open is with geany, looks to be corrupted) but then I soon realized that the entire scripts folder maybe even the entire source is buggy.
[Android Software Development] morfikov:
Thanks for confirming that the source is buggy. I think we can just give up on it. Too bad it won't work.

I just move to another task, which is building the LineageOS ROM for my devices. I think in this case I will be building some normal kernel source, and I hope everything will be fine.
[Android Software Development] kirito9:
A fix should be possible as it's just c files that may need editing. It will take some time but if you don't want to continue with it that's fine. Prebuilt kernel should be fine for your LOS ROM. Take that discussion here tho.
[Android Software Development] _that:
Your "source" files are encrypted by "E-SafeNet". This is clearly a GPL violation. Request readable source code from the manufacturer or take your device back as it's defective.
[Android Software Development] morfikov:
I try to ask TP-LINK about the source tomorrow. Maybe they will say something about it.
[Android Software Development] morfikov:
I got answer from TP-LINK unit in my country -- they can't help me with the source.

So I have a quick question. How does this situation affect building LineageOS ROM? Do I have to configure the kernel from scratch? Can the ROM be built or work with some other kernel (which one), or am I supposed to give up on trying to port the ROM to my device? I know it's not the topic for such discussion, but I just want to know whether it's worth trying.
[Android Software Development] vampirefo:
It's OT, but if it's and Android 6 kernel you don't need source to build LineageOS.

I don't have source for my kernel either, I have built both LineageOS 13 and 14 using my stock kernel.
[Android Software Development] _that:
Your options are:

* Escalate the issue to TP-Link's legal department until they comply with the license (note to self: avoid TP-Link products in future buying decisions).

* Use the pre-built kernel - you can't configure or change anything without source (see #1)

* Try to break the encryption - see https://github.com/c3c/E-Safenet
[Android Software Development] AnotherFreakinNoob:
Anyone help with this? https://hastebin.com/eyigegexiv.pas
[Android Software Development] metalgod666:
Lg g5 se (h840)

Is there anyone who started working on the LG H840 version of twrp (or maybe finished it already).

Not having root is like taking the heroin away from a junkie for me.... :(
[Android Software Development] abrakadabra_srb:
building twrp for Nexus5X

I'm trying to build twrp for my nexus 5x and I followed your post. I compiled it successfully, flashed it and it boots. I have a problem with mounting partitions, here is what I did so far:

1. Added PRODUCT_COPY_FILES += device/lge/bullhead/twrp.fstab:recovery/root/etc/twrp.fstab to my BoardConfig.mk

2. Copied twrp.fstab from https://github.com/TeamWin/android_device_lge_bullhead/blob/android-7.1/twrp.fstab

So, my recovery boots but im not able to mount any partition and I know im doing something wrong probably but cant figure out what... Can someone help me please? Btw, when I flash official twrp build on my device, mounting works as expected
[Android Software Development] NepoRood:
Wrong thread for this question. Take a look here
[Android Software Development] _that:
Check the fstab after TWRP starts (it should rename twrp.fstab to recovery.fstab at startup), and the log:

adb pull /etc/recovery.fstab
adb pull /tmp/recovery.log
[Android Software Development] abrakadabra_srb:
Thanks for the reply, here are the files:

recovery.fstab -> https://pastebin.com/xqNYSXCA

recovery.log -> https://pastebin.com/RKWxBL3A

Feels like something is wrong with /dev/block or something like that, I dont have that much experience with partitions. Do you see what could be the problem?
[Android Software Development] ashyx:
All your partition's except /data look mounted to me going by the recovery log.

Looks like /data can't mount because of encryption have you tried Formatting(not wipe) /data to see if it mounts then. Do you have the crypto flag set in your TWRP boardconfig.mk?
[Android Software Development] abrakadabra_srb:
In my latest test I copied all the flags from nexus 5x omni device tree so it includes the encryption flag too.

I haven't tried formating data, I'll check that out. What confuses me is that my build has this problem with my data partition, but if I flash official twrp for my device everything works out of the box. Is there something different that is done for the official builds?
[Android Software Development] ashyx:
Where's your device tree?
[Android Software Development] abrakadabra_srb:
Here it is:

https://github.com/mikalackis/android_device_lge_bullhead/tree/ariel_N2G47F

This is the plain aosp device tree with some of my own modifications. Latest commit on this branch contains modifications I made to include twrp.
[Android Software Development] subhyendu:
I try to flash twrp.img by using flashfy app in my lenovo vibe p1m....after unlocking my bootloder i flash the file...then i try to reboot in recovery.... But twrp is not working...also my phone stock recovery is gone...when i try to enter recovery mode its only reboot...even i cant factory reset my phone....please help me:(
[Android Software Development] NepoRood:
This is a Dev thread, your issue is device specific, click This

Also, your stock recovery is gone because you flashed TWRP, can you do a FR from within the phone itself?
[Android Software Development] subhyendu:
No...factory reset is not working...
[Android Software Development] Rajaa Basumatary:
i want twrp for lava A72