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

htimsxela

Senior Member
Sep 18, 2011
110
54
0
Arroio do Meio
More interesting findings...

android/lineage/kernel/letv/msm8994/drivers/power/reset/msm-poweroff.c shows some possibilities for adb reboot:

Code:
    if (cmd != NULL) {
        if (!strncmp(cmd, "bootloader", 10)) {
            qpnp_pon_set_restart_reason(
                PON_RESTART_REASON_BOOTLOADER);
            __raw_writel(0x77665500, restart_reason);
        } else if (!strncmp(cmd, "recovery", 8)) {
            qpnp_pon_set_restart_reason(
                PON_RESTART_REASON_RECOVERY);
            __raw_writel(0x77665502, restart_reason);
        } else if (!strcmp(cmd, "rtc")) {
            qpnp_pon_set_restart_reason(
                PON_RESTART_REASON_RTC);
            __raw_writel(0x77665503, restart_reason);
        } else if (!strcmp(cmd, "dm-verity device corrupted")) {
            __raw_writel(0x77665508, restart_reason);
        } else if (!strcmp(cmd, "dm-verity enforcing")) {
            __raw_writel(0x77665509, restart_reason);
        } else if (!strcmp(cmd, "keys clear")) {
            __raw_writel(0x7766550a, restart_reason);
        } else if (!strncmp(cmd, "oem-", 4)) {
            unsigned long code;
            int ret;
            ret = kstrtoul(cmd + 4, 16, &code);
            if (!ret)
                __raw_writel(0x6f656d00 | (code & 0xff),
                         restart_reason);
        } else if (!strncmp(cmd, "edl", 3)) {
            enable_emergency_dload_mode();
        } else {
            qpnp_pon_set_restart_reason(PON_RESTART_REASON_UNKNOWN);
            __raw_writel(0x77665501, restart_reason);
        }
    }
We know of:

adb reboot: reboot normally (to system)
adb reboot bootloader: into fastboot mode
adb reboot recovery: into recovery mode
adb reboot edl: into emergency download mode
adb reboot rtc: ?
adb reboot dm-verity device corrupted: ?
adb reboot dm-verity enforcing: ?
adb reboot oem-: this one must be followed by an unsigned long.

Regarding the last one, I found this:

This is commonly done on Android devices, in order to reboot the device into fastboot or recovery mode. It also supports custom OEM specific commands, via "reboot oem-<value>".
Source: https://lwn.net/Articles/667292/
 

htimsxela

Senior Member
Sep 18, 2011
110
54
0
Arroio do Meio
I'm really newbie with Android... :S
Now I can compile and boot TWRP recovery with Lineage-16 but adb doesn't work.

Code:
~$ adb devices
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Android Debug Bridge version 1.0.41
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Version 30.0.2-6538114
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Installed as /home/android_build/platform-tools/adb
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] 
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:155] _adb_connect: host:version
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a76657273696f6e 000chost:version
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 4f4b4159 OKAY
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:189] _adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303034 0004
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303239 0029
List of devices attached
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:387] adb_query: host:devices
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:346] adb_connect: service: host:devices
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:155] _adb_connect: host:devices
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a64657669636573 000chost:devices
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 4f4b4159 OKAY
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:189] _adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:364] adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303131 0011
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=17
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=17 got=17 3262396162343333096f66666c696e65 2b9ab433.offline [truncated]
2b9ab433	offline
Always offline. But when I boot into the real twrp recovery, everything works. I already inspected all .rc files, init, properties... Everything I can think of. No luck.

And to make things even worse, after opening the device to try finding TX/RX serial pads, I kinda damaged the touchscreen and now the entire right side oscillates between "touching itself" or not working at all. So, even though I can enter recovery, I cannot issue commands like setprop, grep, ps... Everything containing the letter "p" doesn't work, unless I use some clumsy stuff like typing 'get*rop*' then hitting TAB for autocompleting... WHAT A PAIN!

Seriously... I'm about to give up.
 

earistodemos

New member
Nov 25, 2018
1
0
0
I'm really newbie with Android... :S
Now I can compile and boot TWRP recovery with Lineage-16 but adb doesn't work.

Code:
~$ adb devices
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Android Debug Bridge version 1.0.41
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Version 30.0.2-6538114
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] Installed as /home/android_build/platform-tools/adb
adb D 06-15 17:15:26 27378 27378 adb_trace.cpp:187] 
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:155] _adb_connect: host:version
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a76657273696f6e 000chost:version
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 4f4b4159 OKAY
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:189] _adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303034 0004
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303239 0029
List of devices attached
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:387] adb_query: host:devices
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:346] adb_connect: service: host:devices
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:155] _adb_connect: host:devices
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:107] writex: fd=3 len=16 30303063686f73743a64657669636573 000chost:devices
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 4f4b4159 OKAY
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:189] _adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_client.cpp:364] adb_connect: return fd 3
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=4
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=4 got=4 30303131 0011
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:81] readx: fd=3 wanted=17
adb D 06-15 17:15:26 27378 27378 adb_io.cpp:97] readx: fd=3 wanted=17 got=17 3262396162343333096f66666c696e65 2b9ab433.offline [truncated]
2b9ab433	offline
Always offline. But when I boot into the real twrp recovery, everything works. I already inspected all .rc files, init, properties... Everything I can think of. No luck.

And to make things even worse, after opening the device to try finding TX/RX serial pads, I kinda damaged the touchscreen and now the entire right side oscillates between "touching itself" or not working at all. So, even though I can enter recovery, I cannot issue commands like setprop, grep, ps... Everything containing the letter "p" doesn't work, unless I use some clumsy stuff like typing 'get*rop*' then hitting TAB for autocompleting... WHAT A PAIN!

Seriously... I'm about to give up.
Hello htimsxela, any new luck with the build, i am so glad that finally there is someone who is trying to bring out the best for our Max x900, i am so curios why non of the os developers like lineage or Pixels and more never gave interest for helping you to develop or achieve your goal, i have the phone since 2016 and i love it, this year i have replaced the battery with a new one and its like brand new except the OS which is stuck with Android 6, i am not a developer but i am so interested in making my phone to feel a fresh build of OS. So Please dont give up keep trying and i am sure you will find a way to make it work.
 
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone