[Android Software Development] mustang_ssc:
Hi,

After dozens attempts on the last weeks/few months, and more than 1 year from my own side, me and a colleague simply don't find what is not allowing our compiled TWRP boot.

Our device is a Huawei Mediapad T1 10 (codename hwt1a21l) which ships a msm8916 initially with KK and now we have a LP rom.

When flashing it through fastboot it seems to try to boot the recovery but normally it bootloops on the kernel part, before trying to boot the rom. Curiously takes quite time to restart when this happens. When doing some device tree modifications we find it boot the rom but obviously it won't on the recovery.

- The TWRP source used was mainly minimal omni 7.1. We also tried with omni 6.0, 5.1 and LOS 14.1. A long time ago i also used TWRP CM13 one.

- The device tree used lately is mostly this omni one (test branch). On the past we also used a cm14.1 based and many other different i tried on the past.

- On kernel side we use dt.img and kernel files. I don't think this should be a problem as it is more simple to implement and compile than the kernel source and more generalized from what i saw,

unless there is a problem with ours for some reason as compatibility issues

.

On the past this files were extracted from our Kit Kat stock boot.img, but later we extract them from our Lollipop stock boot.img which is the actual one.

- The fstab table is correctly done if im not wrong.

- All the other files from the device tree (Android.mk,AndroidProducts.mk, full_hwt1a21l.mk, ...), except the BoardConfig.mk, should be correct IMO. There is also the system.prop file which i built from our stock LP specifications. Not even sure if this one is mandatory as it brings a lot of parameters that probably conflicts with the boot up attempts.

Lastly, the most likely configuration to cause our TWRP to not boot IMO is the BoardConfig.mk.

We find one of the most likely parameters to cause this is the BOARD_KERNEL_CMDLINE line. We did dozens different attemps on this such as set selinux on permissive, enforcing, remove some content, add, copy from similar devices and from our stock recovery and boot.img, and no luck.

Do you know how properly should this parameter got?

It's an extremely brain teaser for us to simply know this, which may be the trigger of this whole problem.

The #Partitions numbers are on decimal values. I find there are some other device trees which brings them on hexadecimal values, but others on decimal, so i don't really think this could be the issue.

On the #TWRP flags i made also many different attempts such as removing and adding flags. I heard the TW_SCREEN_BLANK_ON_BOOT one can cause some devices to boot up and to others not, so i made both attemps and right now is temporally on the device tree. Same applies to #Qualcomm support flags.

The BOARD_KERNEL_BASE, BOARD_KERNEL_PAGESIZE and BOARD_MKBOOTIMG_ARGS parameters were adapted by getting the specific values from our stock recovery by using a recognized github repo (i don't remember the name) to extract this informationand, dt.img and kernel files.

My assumptions of what could be causing our TWRP to not boot is the following

:

- Incorrect configuration on device tree: This is the most obvious. My main suspect is on the BoardConfig.mk, also i don't dismiss something wrong on the fstab, dt.img, kernel and system.prop files.

- twrp flags: Maybe we lack or have unnecessary twrp flags/parameters. I searched information of flags to add and did some attempts but no luck.

- twrp source (OMNI, AOSP and CM): As previously mentioend, the device tree we have been using lately and more efficiently is the OMNI one, but we also used the LOS/CM ones. Maybe, for some reason i don't understand or even know if has logic, our device can only work on some specific twrp source. I don't really think this but that possibility may exist.

- twrp android version used (8.X, 7.X, 6.X, 5.X): We have been trying to compile mainly with 7.1 twrp source, after months/year ago i did dozens attemps with 6.0 one, basically because all guides, including this one if im not wrong, mention to normally use the latest twrp android version source available as if there is no compatibility issue about using 5.1 android kernel and dt.img files/device tree with 7.1 twrp source.

I found no clarification on internet about why there should not be no compatibility issue on this but seems that for developers is something logical not necessary to mention.

Sorry for the long post.

I don't find anything else to comment at this moment, if i miss something please tell me. Hope someone could shed some lights on this topic as after such big amount of time and effort (if im not wrong since 2016 from my own side) we are not able to boot up this, it would be simply great to get it.

Thank you all.

EDIT:

Finally got it to work! :)

The blocking points were that i needed to use 5.1 OMNI TWRP source + adding the cmdline from our 5.1 stock recovery image. Unfortunately i didn't have this stock recovery based on LP (i was using the data from our KK recovery) as Lollipop was only released on Chinese model, therefore not able to get it nowhere, fortunately a kind user sent me all the Lollipop package.

After this it booted but with a weird touchscreen issue. I discovered thanks to this and this one that an existing touchscreen input was interfering with TWRP one.

Many thanks to [MENTION=4939189]aicjofs[/MENTION] for this useful post, and specially for [MENTION=4478781]yuweng[/MENTION] not only for the post but also for the continuous help he delivered me on this topic, ending on a successful TWRP recovery :)