Help building LineageOS for LeEco (LeTV) LeMax 1 (X900/Max1) CN

Search This thread

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
If you're in a hurry and just want to know the latest news, follow this link:

https://xdaforums.com/showpost.php?p=80393641&postcount=58

Keep reading for some background info.


Hi there!

So... I'm trying to port LineageOS (version 15.1) from OnePlus - OnePlus2 device to the LeEco LeMax 1 phone.

Why I've chosen this device to port from?

It has the MSM8994 (Qualcomm Snapdragon 810) SoC, which is the same as Max1, so (supposedly) a kernel compile would not be too much hassle. Besides it also has many similarities in terms of hardware.

What I did for device dir:

I took the tree from https://github.com/LineageOS/android_device_oneplus_oneplus2 and modified it to meet max1 requirements.

Current tree: https://github.com/alexsmithbr/android_device_letv_max1

What I did for vendor dir:

I compared the tree with Max1 tree, excluding everything that was not found in Max1. The plan is to add more vendor stuff if necessary.

Current tree: https://github.com/alexsmithbr/android_device_letv_max1

What I did for kernel dir:

I downloaded Le_Max_OpenSource.zip from opensource.le.com (in fact, as the site is down, I got a copy from http://web.archive.org/web/20180626053054/http://opensource.le.com:80/ and, from there, I found the file I needed was named Le_Max_OpenSource.zip. I got it from here.

The kernel config in this zip file is exactly the same I get from the device itself, with adb pull /proc/config.gz.

Current tree: https://github.com/alexsmithbr/android_kernel_letv_max1

Interesting related threads:

https://xdaforums.com/showpost.php?p=78690008&postcount=7
https://xdaforums.com/leeco-le1-pro/development/cm-14-1-android-7-1-unofficial-letv-t3530173

Other possibly useful resources:

http://web.archive.org/web/20180626053054/http://opensource.le.com:80/
https://xdaforums.com/showpost.php?p=78676206&postcount=2402
These are thanks to @rico69310, specifically this post:
https://www.mediafire.com/folder/ff7hbpa62ivsg/
https://yadi.sk/d/RPfdh3glmhzarw
https://cloud.mail.ru/public/GP9g/cWpyeYbuK/
Another useful resource, in case you brick your X900. This is thanks to @Phsh:
https://xdaforums.com/showpost.php?p=75157516&postcount=2375

Current status

I can build LineageOS 15.1 completely, but, once flashed, the kernel doesn't boot and phone enters bootloader (the penguin screen) and stay there.

What I need

It's pretty obvious I need the ROM working... :)

But the focus now would be to have a working boot.img. I really don't know what I'm doing wrong.

I can't get any logs, as LeEco patched the kernel so that we don't have a last_kmsg. Instead, they apparently put last_kmsg into another partition in /dev/block/platform/soc.0/f9824900.sdhci/by-name/letvconfig2. You can check this in the kernel, file kernel/printk/last_kmsg.c, line 124:

Code:
#define DEFAULT_KERNELLOG_FILENAME "/dev/block/bootdevice/by-name/letvconfig2"
char *kernlog_file = DEFAULT_KERNELLOG_FILENAME;

Well, I tried to give an overview of all steps I took. Please feel free to ask anything or give hints.

Together we can make LeEco LeMax 1 live longer! :)
 
Last edited:

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Thought it would be nice to describe my build process.

Basically I'm following these instructions: https://wiki.lineageos.org/devices/oneplus2/build

Of course these instructions are for oneplus2, but the step-by-step is pretty much the same for any device.

I'm using Ubuntu 18.04.1 LTS, in which I created a user specifically for building LineageOS.

I followed all steps on the above link until breakfast oneplus2, since, at this point, I had to create my own device/vendor/kernel tree, so that I can breakfast it.

To do this, I did:

Code:
# clone max1 device
cd ~/android/lineage/device
mkdir letv
cd letv
git clone https://github.com/alexsmithbr/android_device_letv_max1.git max1

# clone max1 vendor
cd ~/android/lineage/vendor
mkdir letv
cd letv
git clone https://github.com/alexsmithbr/android_vendor_letv_max1.git max1

# setup kernel
cd ~/android/lineage/kernel
mkdir letv
cd letv
# change <path_to_file> to the correct path to Le_Max_OpenSource.zip
# you downloaded from the link on the previous post.
unzip <path_to_file>/Le_Max_OpenSource.zip -d max1
# as the zip has unnecessary subfolders, I just moved them
# to their correct names and deleted other rubbish.
mv max1/LeMax_kernel/kernel/ max1/msm8994
rm max1/LeMax_kernel/ -R

In the end, you need a structure like this:

Code:
~/android/lineage/device/letv/max1
~/android/lineage/vendor/letv/max1
~/android/lineage/kernel/letv/msm8994

Finally, put config.gz in its dir:

Code:
adb pull /proc/config.gz /tmp
gunzip /tmp/config.gz -c > ~/android/lineage/kernel/letv/msm8994/arch/arm64/configs/msm8994-max1-perf_defconfig

Okay, now everything is set up for the build to start.

Code:
source build/envsetup.sh
breakfast max1
export USE_CCACHE=1
ccache -M 50G
export ANDROID_JACK_VM_ARGS="-Dfile.encoding=UTF-8 -XX:+TieredCompilation -Xmx4G"
croot

Just before start building, I choose which kind of build I want:

Code:
choosecombo
Build type choices are:
     1. release
     2. debug

Which would you like? [1] 1

Which product would you like? [lineage_max1] 

Variant choices are:
     1. user
     2. userdebug
     3. eng
Which would you like? [eng]

Now, if you want a normal build, you can enter:

Code:
brunch max1

But, if you want a really verbose log (very useful to debug build errors), you can enter:

Code:
mka -j 4 showcommands

Note that -j 4 means 4 simultaneous jobs. You can specify another number. A rule of thumb is to use <number_of_cpus> * 2.

Now the system should build...
 
Last edited:
  • Like
Reactions: Tircon and Anythest

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
At this point:

https://github.com/alexsmithbr/andr...tree/0f9134dd09c269b2da9008c5598060b9d19ac2ef
https://github.com/alexsmithbr/andr...tree/9ece561a945867ab2af733c5ef890b6df5438a8b

The system builds and mka -j 4 showcommands bacon will build flashable lineage-15.1-20190128-UNOFFICIAL-max1.zip.

Unfortunately, when flashing this zip, and restarting the phone, it will vibrate twice when showing the LeEco first screen, then it vibrates twice again and shows me the penguin screen (bootloader). :(

No luck up to now.
 
Last edited:
  • Like
Reactions: Tircon and Anythest

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Keep up with the good work... I hope you get the kernel working.

Me too! :)

It's so hard to get any help... I've been to freenode as well and nobody wanted to help there. :/

So it feels like a very lonely path. But I'm still on to it.

Currently I'm recompiling everything, now getting "my" tree a bit closer to @ABM30 tree, adapted to LineageOS, instead of CyanogenMod.

Let's see what happens next.

No luck. Boots to penguin (bootloader) screen again. :(
 
Last edited:
  • Like
Reactions: Tircon and Anythest

kerygsxr

New member
Jan 14, 2018
2
1
---------- Post added at 09:37 AM ---------- Previous post was at 09:33 AM ----------

I'm cheering for you. I would very much like 8.1 Good luck ! Good work!
 
Last edited:
  • Like
Reactions: Anythest

Spunkination

Senior Member
Dec 29, 2018
69
8
Me too! :)

It's so hard to get any help... I've been to freenode as well and nobody wanted to help there. :/

So it feels like a very lonely path. But I'm still on to it.

Currently I'm recompiling everything, now getting "my" tree a bit closer to @ABM30 tree, adapted to LineageOS, instead of CyanogenMod.

Let's see what happens next.

No luck. Boots to penguin (bootloader) screen again. :(

Hope you are good friend?

How is the build going?
 

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
I updated the git repositories. The current version compiles as well and I get a ROM at the end, but unfortunately it doesn't boot. I'm probably missing something in the kernel build. I'm still investigating, but I don't even get to the LineageOS logo. When I turn on the phone, it goes straight to bootloader (penguin) screen.

I'll keep trying. Since a build involves a lot (really!) of variables, there's always something new to try.

And it's good that we keep this thread active. Maybe someone with more knowledge shows up and is able to help.

My biggest issue is I can't find a way of seeing what's wrong, since LeEco patched the kernel in a way there is no /proc/last_kmsg file, nor /sys/fs/pstore/console-ramoops. LeEco implemented it in a way the logs would be written to a partition called letvconfig2, but even there I cannot see any logs.

I read another way of seeing kernel logs would be to use the phone's serial port, but then I'd have to reach its main board, which is not an option currently, since this is my only phone.

In other words, my options now resume to keep trying.
 
Last edited:

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Tomorrow I expect to have some time to resume the work. Will give it some more tries. I'm even thinking about checking out a previous version of LineageOS (when it was still called CyanogenMod), then, once I get it working, try to make my way to newer versions.

Stay tuned!

And again: any hints are more than welcome!

I really believe this thread may become kind of a roadmap to compile android for any unsupported device.
 
Last edited:

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Update: by looking at recovery.img and comparing to the recovery partition on device, I noticed the kernel being built by LineageOS doesn't contain any DTBs. Without DTBs, the kernel won't be able to identify the phone's hardware.

How I checked this:

Code:
$ mkdir /tmp/boot
$ cd /tmp/boot
$ unpackbootimg -i ~/android/lineage/out/target/product/max1/recovery.img  -o .
BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 androidboot.selinux=permissive buildvariant=userdebug
BOARD_KERNEL_BASE 00000000
BOARD_PAGE_SIZE 4096
$ split-appended-dtb-master/split-appended-dtb recovery.img-zImage 
ERROR: Appended Device Tree Blob not found!

I'll try to find out how to automatically add DTBs to the images.

I know there was a variable called TARGET_KERNEL_APPEND_DTB, which should be set to true on older (cyanogenmod) versions, but it is now deprecated. So deprecated that even the "deprecated" messages have been removed by now. :)

As far as I could figure out, now the action of appending/not appending DTBs to the kernel image is guessed by variable BOARD_KERNEL_IMAGE_NAME. For example:

To add dtb to kernel image, one would do:

Code:
BOARD_KERNEL_IMAGE_NAME := Image-dtb

To don't add dtb to kernel image, one would do:

Code:
BOARD_KERNEL_IMAGE_NAME := Image

I was hoping this would change something, as for me that variable was defined without the -dtb suffix, but I figured out I broke the kernel build:

Code:
make[1]: *** No rule to make target 'Image-dtb'. Stop.

I guess this is because the original kernel is too old (3.10.84) and it's AndroidKernel.mk still relies on TARGET_KERNEL_APPEND_DTB, as we can see on line 68:

Code:
ifeq ($(TARGET_KERNEL_APPEND_DTB), true)
$(info Using appended DTB)
TARGET_PREBUILT_INT_KERNEL := $(TARGET_PREBUILT_INT_KERNEL)-dtb
endif

Patch the kernel? Wow! This is going deep...

* unpackbootimg is part of the android_bootimg_tools. I got it from here: wget https://storage.googleapis.com/goog...d-serialport-api/android_bootimg_tools.tar.gz
* split-appended-dtb is this tool: https://github.com/dianlujitao/split-appended-dtb
 
Last edited:

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Turns out there are two ways of adding DTBs.

treble_dto_partition_1.png
treble_dto_partition_2.png


By checking my current recovery partition, I noticed DTBs are attached to partition, not to kernel. I also noticed it is not using a compressed kernel. So I'll configure BoardConfig.mk as:

Code:
BOARD_KERNEL_IMAGE_NAME := Image

If I wanted it gzipped, I'd make it Image.gz. If I wanted the DTBs attached to kernel (not to image), I'd do Image.gz-dtb.

Apparently no kernel patch will be needed... Anyway I created a git repository for it, just in case I need to change something.

Again, the build works, but it doesn't boot. :(

As I'm focusing on testing the kernel, I'm using the recovery partition.

I just dumped a copy of it with:

Code:
host$ adb shell
phone$ su
phone# cp /dev/block/bootdevice/by-name/recovery /sdcard
phone# exit
phone$ exit
host$ adb pull /sdcard/recovery

and I'm flashing it over and over to test.

To do this, I do

Code:
host$ adb reboot bootloader
# phone reboots
host$ fastboot flash recovery /path/to/recovery.img
# it flashes, then, holding volume-up, I type:
host$ fastboot reboot

Phone will reboot into recovery and test my image (up to now, I only get back to penguin screen (bootloader)).

To flash back my working recovery image, I do the same as above, just changing the path to recovery image.
 
Last edited:
  • Like
Reactions: Tircon and Anythest

Santey Maas

New member
Apr 21, 2018
2
0
USSR
Bless you and your work

Dude, I would definitely-definitely liked to help; I understand and root for your hard work. But unfortunately I don't possess any knowledge in this area. Yeah, I can flash using manual, but I'm lamer in terms of programming, not even close to IT.
 

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Dude, I would definitely-definitely liked to help; I understand and root for your hard work. But unfortunately I don't possess any knowledge in this area. Yeah, I can flash using manual, but I'm lamer in terms of programming, not even close to IT.

Thanks, mate! I didn't give up yet. :) Each try brings more knowledge and I hope I'm able to share all I'm learning. Sort of paving the road for newcomers.

I rarely meet such wonderful and persistent people like you. I sincerely hope you will succeed and achieve your goal! :good:

Thanks! My hope is that - if I succeed - more people can benefit from my work and give these phones a longer life.
 

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
LeEco Le Max (max1/x900) Secret Codes

A bit off-topic, but here it goes... While looking for a way to debug kernel boot, I came across those famous secret codes you can type on phone screen to access secret/test menus... This site, for example, says you can use code *#*#76937#*#* to have access to a menu where you can enable/disable some log, debug and AT commands options. I tested and it worked with my phone. Not happy enough, I did a

Code:
grep 76937 / -rl

on the phone and found out system/app/LetvDebugUtil/oat/arm64/LetvDebugUtil.odex was the only place where it occurred. Inspecting the file, I found, right next to the occurrence, the code 9439. Just to test, I entered *#*#9439#*#* on the phone and got to a Chinese menu (see attached picture). The translation of these Chinese stuff is "Launch China Telecom Network (CDMA)". I didn't check that box to see what happens. :D

Current known codes

  • *#*#76937#*#* - Menu where you can enable/disable some log, debug and AT commands options.
  • *#*#9439#*#* - Launch China Telecom Network (CDMA)
  • *#*#8888#*#* - Advanced settings. Here you can turn on logging of App, Modem, Net, Kernel, Bluetooth, GPS and WiFi. Logs are stored in /sdcard
  • *#0000# - About phone. Information about each card slot.
  • *#06# - MEID & IMEI numbers.
 

Attachments

  • Screenshot_20190213-183313.jpg
    Screenshot_20190213-183313.jpg
    206.7 KB · Views: 73
Last edited:

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
If you're having this error while trying to build LineageOS:

Code:
FAILED: /bin/bash -c "prebuilts/misc/linux-x86/flex/flex-2.5.39 -o/home/android_build/android/lineage/out/host/linux-x86/obj/STATIC_LIBRARIES/libaidl-common_intermediates/aidl_language_l.cpp system/tools/aidl/aidl_language_l.ll"
flex-2.5.39: loadlocale.c:130: _nl_intern_locale_data: Assertion `cnt < (sizeof (_nl_value_type_LC_TIME) / sizeof (_nl_value_type_LC_TIME[0]))' failed.
Aborted (core dumped)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/android_build/android/lineage'

You're probably having the same issue I'm having with Flex. The easiest option is to recompile it. And it's easy.

Code:
$ cd prebuilts/misc/linux-x86/flex
$ mkdir flex-2.5.39-src
$ cd flex-2.5.39-src
$ tar zxvf ../flex-2.5.39.tar.gz
$ ./configure
$ make
$ cp flex ../flex-2.5.39
$ cd ..
$ rm flex-2.5.39-src -R

The above commands will recompile Flex for your architecture and everything should be fine (with Flex).
 

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Some news regarding the overall progress with LineageOS.

I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.1.x running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).

Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:

As usual, I'll keep you posted.
 
Last edited:

Donnie2Darko

New member
Feb 14, 2019
1
0
Some news regarding the overall progress with LineageOS.

I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.0.1 running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).

Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:

As usual, I'll keep you posted.

Thanks for your effort!
This phone is great and it's pity that it was left without support..
 

htimsxela

Senior Member
Sep 18, 2011
110
54
Arroio do Meio
Some news regarding the overall progress with LineageOS.

I checked out the repo from cm-14.1 (cyanogenmod 14.1) and am now trying to build for it. If it builds, at least we'll have Android 7.0.1 running on device. And - I believe - it could bring some light to start a port to a newer version (Lineage 15.1).

Up to now, I faced the same compile errors I got when compiling for 15.1, so it's being straight forward. I'm anxious to see if it'll boot. :fingers-crossed:

As usual, I'll keep you posted.

BTW if someone is curious out there, here's the CyanogenMod 14.1 branch I'm working on: https://github.com/alexsmithbr/android_device_letv_max1/tree/cm-14.1

It was based on CyanogenMod 12.1 and the code is almost three years old (last commit), so I'm spending some time updating obsolete code, etc.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    If you're in a hurry and just want to know the latest news, follow this link:

    https://xdaforums.com/showpost.php?p=80393641&postcount=58

    Keep reading for some background info.


    Hi there!

    So... I'm trying to port LineageOS (version 15.1) from OnePlus - OnePlus2 device to the LeEco LeMax 1 phone.

    Why I've chosen this device to port from?

    It has the MSM8994 (Qualcomm Snapdragon 810) SoC, which is the same as Max1, so (supposedly) a kernel compile would not be too much hassle. Besides it also has many similarities in terms of hardware.

    What I did for device dir:

    I took the tree from https://github.com/LineageOS/android_device_oneplus_oneplus2 and modified it to meet max1 requirements.

    Current tree: https://github.com/alexsmithbr/android_device_letv_max1

    What I did for vendor dir:

    I compared the tree with Max1 tree, excluding everything that was not found in Max1. The plan is to add more vendor stuff if necessary.

    Current tree: https://github.com/alexsmithbr/android_device_letv_max1

    What I did for kernel dir:

    I downloaded Le_Max_OpenSource.zip from opensource.le.com (in fact, as the site is down, I got a copy from http://web.archive.org/web/20180626053054/http://opensource.le.com:80/ and, from there, I found the file I needed was named Le_Max_OpenSource.zip. I got it from here.

    The kernel config in this zip file is exactly the same I get from the device itself, with adb pull /proc/config.gz.

    Current tree: https://github.com/alexsmithbr/android_kernel_letv_max1

    Interesting related threads:

    https://xdaforums.com/showpost.php?p=78690008&postcount=7
    https://xdaforums.com/leeco-le1-pro/development/cm-14-1-android-7-1-unofficial-letv-t3530173

    Other possibly useful resources:

    http://web.archive.org/web/20180626053054/http://opensource.le.com:80/
    https://xdaforums.com/showpost.php?p=78676206&postcount=2402
    These are thanks to @rico69310, specifically this post:
    https://www.mediafire.com/folder/ff7hbpa62ivsg/
    https://yadi.sk/d/RPfdh3glmhzarw
    https://cloud.mail.ru/public/GP9g/cWpyeYbuK/
    Another useful resource, in case you brick your X900. This is thanks to @Phsh:
    https://xdaforums.com/showpost.php?p=75157516&postcount=2375

    Current status

    I can build LineageOS 15.1 completely, but, once flashed, the kernel doesn't boot and phone enters bootloader (the penguin screen) and stay there.

    What I need

    It's pretty obvious I need the ROM working... :)

    But the focus now would be to have a working boot.img. I really don't know what I'm doing wrong.

    I can't get any logs, as LeEco patched the kernel so that we don't have a last_kmsg. Instead, they apparently put last_kmsg into another partition in /dev/block/platform/soc.0/f9824900.sdhci/by-name/letvconfig2. You can check this in the kernel, file kernel/printk/last_kmsg.c, line 124:

    Code:
    #define DEFAULT_KERNELLOG_FILENAME "/dev/block/bootdevice/by-name/letvconfig2"
    char *kernlog_file = DEFAULT_KERNELLOG_FILENAME;

    Well, I tried to give an overview of all steps I took. Please feel free to ask anything or give hints.

    Together we can make LeEco LeMax 1 live longer! :)
    4
    I finally have some really good news! :)

    TWRP 3.3.1-0 works on Letv Max1/X900! And all compiled from source!

    I just committed these two repositories:

    https://github.com/alexsmithbr/android_omni_device_letv_max1_recovery
    https://github.com/alexsmithbr/android_omni_kernel_letv_msm8994

    With them checked out inside of a OmniROM source tree, one should be able to compile a kernel, its DTBs and all necessary tools by issuing the following:

    Code:
    . ./build/envsetup.sh
    lunch omni_max1-eng
    mka recoveryimage

    The version of TWRP inside OmniROM is 3.1.1, so one may want to get the latest version. Here, I did this:

    Code:
    cd bootable
    mv recovery recovery-orig
    git clone https://github.com/omnirom/android_bootable_recovery.git recovery

    After this, just build the entire OmniROM (commands above).

    If you want to test TWRP on your Max1/X900 device, you can download it from here:

    https://mega.nz/#!fdkzVQKD!K7X2HeYKZD9gHFfKZT89suEzVZv2-d8UNA-SyPAeQcw

    Just unzip the file and issue:

    Code:
    adb reboot bootloader

    Then, if you want to test before flashing, issue:

    Code:
    fastboot boot twrp-3.3.1-0-max1_x900.img

    To flash:

    Code:
    fastboot flash recovery twrp-3.3.1-0-max1_x900.img

    That's all for now, folks! :)
    4
    Tomorrow I expect to have some time to resume the work. Will give it some more tries. I'm even thinking about checking out a previous version of LineageOS (when it was still called CyanogenMod), then, once I get it working, try to make my way to newer versions.

    Stay tuned!

    And again: any hints are more than welcome!

    I really believe this thread may become kind of a roadmap to compile android for any unsupported device.
    3
    Update: by looking at recovery.img and comparing to the recovery partition on device, I noticed the kernel being built by LineageOS doesn't contain any DTBs. Without DTBs, the kernel won't be able to identify the phone's hardware.

    How I checked this:

    Code:
    $ mkdir /tmp/boot
    $ cd /tmp/boot
    $ unpackbootimg -i ~/android/lineage/out/target/product/max1/recovery.img  -o .
    BOARD_KERNEL_CMDLINE console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom user_debug=31 msm_rtb.filter=0x37 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 boot_cpus=0-5 androidboot.selinux=permissive buildvariant=userdebug
    BOARD_KERNEL_BASE 00000000
    BOARD_PAGE_SIZE 4096
    $ split-appended-dtb-master/split-appended-dtb recovery.img-zImage 
    ERROR: Appended Device Tree Blob not found!

    I'll try to find out how to automatically add DTBs to the images.

    I know there was a variable called TARGET_KERNEL_APPEND_DTB, which should be set to true on older (cyanogenmod) versions, but it is now deprecated. So deprecated that even the "deprecated" messages have been removed by now. :)

    As far as I could figure out, now the action of appending/not appending DTBs to the kernel image is guessed by variable BOARD_KERNEL_IMAGE_NAME. For example:

    To add dtb to kernel image, one would do:

    Code:
    BOARD_KERNEL_IMAGE_NAME := Image-dtb

    To don't add dtb to kernel image, one would do:

    Code:
    BOARD_KERNEL_IMAGE_NAME := Image

    I was hoping this would change something, as for me that variable was defined without the -dtb suffix, but I figured out I broke the kernel build:

    Code:
    make[1]: *** No rule to make target 'Image-dtb'. Stop.

    I guess this is because the original kernel is too old (3.10.84) and it's AndroidKernel.mk still relies on TARGET_KERNEL_APPEND_DTB, as we can see on line 68:

    Code:
    ifeq ($(TARGET_KERNEL_APPEND_DTB), true)
    $(info Using appended DTB)
    TARGET_PREBUILT_INT_KERNEL := $(TARGET_PREBUILT_INT_KERNEL)-dtb
    endif

    Patch the kernel? Wow! This is going deep...

    * unpackbootimg is part of the android_bootimg_tools. I got it from here: wget https://storage.googleapis.com/goog...d-serialport-api/android_bootimg_tools.tar.gz
    * split-appended-dtb is this tool: https://github.com/dianlujitao/split-appended-dtb
    3
    I updated the git repositories. The current version compiles as well and I get a ROM at the end, but unfortunately it doesn't boot. I'm probably missing something in the kernel build. I'm still investigating, but I don't even get to the LineageOS logo. When I turn on the phone, it goes straight to bootloader (penguin) screen.

    I'll keep trying. Since a build involves a lot (really!) of variables, there's always something new to try.

    And it's good that we keep this thread active. Maybe someone with more knowledge shows up and is able to help.

    My biggest issue is I can't find a way of seeing what's wrong, since LeEco patched the kernel in a way there is no /proc/last_kmsg file, nor /sys/fs/pstore/console-ramoops. LeEco implemented it in a way the logs would be written to a partition called letvconfig2, but even there I cannot see any logs.

    I read another way of seeing kernel logs would be to use the phone's serial port, but then I'd have to reach its main board, which is not an option currently, since this is my only phone.

    In other words, my options now resume to keep trying.