yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] htimsxela:
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 [MENTION=1620241]rico69310[/MENTION], 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 [MENTION=1060910]Phsh[/MENTION]:

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:

#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! :)
[Android Q&A, Help & Troubleshooting] htimsxela:
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:

# 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:

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

Finally, put config.gz in its dir:

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.

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:

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:

brunch max1

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

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...
[Android Q&A, Help & Troubleshooting] htimsxela:
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.
[Android Q&A, Help & Troubleshooting] Spunkination:
Keep up with the good work... I hope you get the kernel working.
[Android Q&A, Help & Troubleshooting] htimsxela:
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 [MENTION=1728245]ABM30[/MENTION] tree, adapted to LineageOS, instead of CyanogenMod.

Let's see what happens next.

No luck. Boots to penguin (bootloader) screen again. :(
[Android Q&A, Help & Troubleshooting] kerygsxr:
---------- 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!
[Android Q&A, Help & Troubleshooting] Spunkination:
Hope you are good friend?

How is the build going?
[Android Q&A, Help & Troubleshooting] htimsxela:
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.
[Android Q&A, Help & Troubleshooting] htimsxela:
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.
[Android Q&A, Help & Troubleshooting] htimsxela:
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:

$ 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:

BOARD_KERNEL_IMAGE_NAME := Image-dtb

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

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:

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:

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
[Android Q&A, Help & Troubleshooting] htimsxela:
Turns out there are two ways of adding DTBs.

[IMG="Appending to kernel"]https://source.android.com/devices/architecture/images/treble_dto_partition_1.png[/IMG][IMG="Appending to image"]https://source.android.com/devices/architecture/images/treble_dto_partition_2.png[/IMG]

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:

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:

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

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.
[Android Q&A, Help & Troubleshooting] Santey Maas:
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.
[Android Q&A, Help & Troubleshooting] Tircon:
I rarely meet such wonderful and persistent people like you. I sincerely hope you will succeed and achieve your goal! :good:
[Android Q&A, Help & Troubleshooting] htimsxela:
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.

Thanks! My hope is that - if I succeed - more people can benefit from my work and give these phones a longer life.
[Android Q&A, Help & Troubleshooting] htimsxela:
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

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.
[Android Q&A, Help & Troubleshooting] htimsxela:
If you're having this error while trying to build LineageOS:

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.

$ 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).
[Android Q&A, Help & Troubleshooting] htimsxela:
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.
[Android Q&A, Help & Troubleshooting] Donnie2Darko:
Thanks for your effort!

This phone is great and it's pity that it was left without support..
[Android Q&A, Help & Troubleshooting] htimsxela:
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.
[Android Q&A, Help & Troubleshooting] htimsxela:
Yeah, let's see if I can help changing this scenario.
[OnePlus 2 Q&A, Help & Troubleshooting] pclblt:
Hello everyone,

I have encountered an unusual problem with my OnePlus 2 and was wondering if somebody with some android developing experience might be able to help me. What happened was I was using my phone as usual and suddenly it turned off without any warning, even if it had enough energy. When I tried plugging it in it took me straight to the "Your battery is too low. Charge it for a while before powering the device on" message. I tried leaving it plugged in overnight and a few other suggestions and it didn't work, so I bought a new battery and that didn't work too, so my conclusion is that the charge IC is fried and is preventing the phone from turning on. What I would like to know is if there is some way to modify the kernel files to make it skip this check and allow the phone to boot. I can flash the new files on the phone as I can boot into Qualcomm's special mode, and I have the stock rom, which includes all the .img files and more. Any help is greatly appreciated.

Thanks.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
COSP

​

**** Disclaimer: I'm not responsible if you destroy your device. Use at your own risk!!! ****

Welcome to COSP, your new future Android Operating System.

Our goal is to have an Pixel-like android ROM that isn't spying on you and uses as few system space as possible. Also, we provide the option to go completely without GApps using MicroG support.

Why us?

We are focusing on stability and performance, having an debloated ROM is essential for that. Also, we want Users to decide what kind of Store they want to use, either F-Droid or the Play Store.

Also, we take User requests serious. To suggest something, contact us on telegram.

Features:

1) All systemUI tuning elements

2) An handy Network indicator

3) Charging Information

4) Lawnchair and Quickstep as default

5) Quick Settings mods

6) Signature spoofing

OTA Updating for official devices enables Users to get the newest version with ease.

DOWNLOADS:

https://drive.google.com/uc?id=1Wau8S9PHyT5NvxgKx6i9KpXON4Xjwqyn&export=download

BUGS:

1. All the bugs that are common in Pie roms.

2. You tell me.

Sources:

ROM Source: https://github.com/cosp-project/

Kernel Source code: https://github.com/cedric-development/kernel_motorola_msm8937/

Device tree: https://github.com/cedric-development/device_motorola_cedric/

Special thanks to:

[MENTION=6982924]m_vaisakh[/MENTION] for helping me ever since the beginning.

[MENTION=8016271]p8tgames[/MENTION] for the rom, and helping me fix some errors.

[MENTION=4721415]edi194[/MENTION] for the rom.

Subscribe to the thread to get notifications about every update.

-------------------------------------------------------------------------------------------------------------

Changelog:

06/02/2019:

1. Updated the ROM with the February security patches.

2. Added some new features to the manifest.

3. MotoActions still not working(unfortunately). But they will soon.

4. The OTA framework was totally changed, so this update won't be available as an OTA, the new framework will work in future builds. Hence, this update needs to be manually flashed.

08/02/2019

1. Fixed MotoActions.

2. This update, and the ones following this will be available via OTA.

18/03/2019

1. Merged the March security patch.

2. Fixed night light.

3. The OTA is out and should be available.

4. Full changelog can be found here
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
When we get the next build? [MENTION=8250851]AyamDobhal[/MENTION]
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
Can I use the dark theme on settings and can i move the clock from left to right?
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
Can't tell ETA rn as I'm the only one working on this for cedric and I've got school and ****. But yeah might take a bit longer as the keyhandler service for MotoActions is missing and I'll have to add it.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
The color accent picker is something I'm planning to add soon. And about the clock try the systemUI tuner

for dark mode, do try the night mode from developer options
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
Okay understand ... so for the time being without moto actions. I try it if moto actions work, but i think you made a good job.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
Thanks man! Moto actions are something not worth trying as they're added but won't show up due to the missing keyhandler. I'll try to fix it asap though. :)
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] franfilippa:
I just tried your rom and I love it! It's SUPER clean and the added features are great. Although I'm not happy with the AOSP gestures (OnePlus gestures) because this device has a front fingerprint so it just no make sense to me but I'm getting used to it and I think I'm staying here. Thanks a lot.

Sorry for bad english
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
If mean the fingerprint gestures that comes in the next build this is meaning with Moto action.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] franfilippa:
I know, I'm waiting for it
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] cylone:
Hi together,

I tried to flash this ROM today. I got an Error 255. What am I doing wrong?

I have Stock ROM Oreo and the original TWRP for Cedric.

Thanks in advance!
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
The original TWRP is 32bit you need a 64bit TWRP to flash this rom.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] cylone:
Well, this worked, thank you :)

I really like this COSP. Great work! :good:

But unfortunately my SIM cards weren't recognised :(

Perhaps I made a mistake?
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] mrfrantastic:
Did you make a twrp backup? If so, you can restore the EFS partition. You should then have a working signal/sim card.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
welcome mate thanks for your support, the new update(with feb patch and a few other features) is just around the corner.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
Don't forget the download link. ;)
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
coming in less than an hour :)
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] lucki1000:
You can edit your first post and and add what's new or added, as change log.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
done already ;)
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
Sorry for the delay guys but the March patch is out. Took some time as I had exams.
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] sir_overthrow:
I'm going to try the rom. Thank you so much for your work. Long live the cooks !!!
[Moto G5 ROMs, Kernels, Recoveries, & Other Develop] AyamDobhal:
Thanks mate, Tho I'm sad to say, I'm abandoning this as I won't be able to do it this year anymore. It's the last year of my school and I need to get my grades in shape.
[Xiaomi Redmi 6 Pro Questions & Answers] kunal.solanki.965:
hi i don't know if I am posting on the right thread but please devs its a request there are not much rom for redmi 6 pro , it would be great if someone can make a volte fix so that we can use gsi's as volte seems to be the only problem in gsi's Thanks