Porting PixelExperience to my Mi 10S with known device tree? - Android Q&A, Help & Troubleshooting

I have a Mi 10S where I really want to have an AOSP-like ROM installed. However, this model was only released in China so there isn't a corresponding board here at XDA where I can find some decent ones off the shelf. I am personally familiar with programming so I think it would be a good idea to port one myself. I choose Pixel Experience because it's popular and it has quite some documentation.
To my knowledge to port a ROM I need both a base ROM and the source code for the new ROM. I now have in hand a fastboot image of Mi 10S's official MIUI. Furthermore, Xiaomi seems to be open-sourcing its kernel source code and device tree (which I suppose is good news?) On the Pixel Experience end, I follow the guide on their website and cloned and initialized their repo. It seems that all I need then is to create a device configuration for PE's build system, but I don't know where to start.
I do know that PE has a port for Mi 11X (alioth), which uses the same CPU as my phone. Interestingly both models seem also to be sharing the same device tree and kernel (in the same branch on Xiaomi's github repo). I suppose then I can copy Mi 11X's device configuration for PE and tinker with it a bit. However, the structure of Pixel Experience's device configuration doesn't really resemble the device tree I see on Xiaomi's website (I suppose either of them is "non-standard"?), so I am stuck not doing what to do next. Any suggestions?

Well did you tried a generic system image
Generic system images | Android Open Source Project
source.android.com

I have the same problem. I don't know where to begin after I created build environment as per Pixel Experience build tutorial.
Anyone can shed some light?

Null Pointer Exception said:
I have a Mi 10S where I really want to have an AOSP-like ROM installed. However, this model was only released in China so there isn't a corresponding board here at XDA where I can find some decent ones off the shelf. I am personally familiar with programming so I think it would be a good idea to port one myself. I choose Pixel Experience because it's popular and it has quite some documentation.
To my knowledge to port a ROM I need both a base ROM and the source code for the new ROM. I now have in hand a fastboot image of Mi 10S's official MIUI. Furthermore, Xiaomi seems to be open-sourcing its kernel source code and device tree (which I suppose is good news?) On the Pixel Experience end, I follow the guide on their website and cloned and initialized their repo. It seems that all I need then is to create a device configuration for PE's build system, but I don't know where to start.
I do know that PE has a port for Mi 11X (alioth), which uses the same CPU as my phone. Interestingly both models seem also to be sharing the same device tree and kernel (in the same branch on Xiaomi's github repo). I suppose then I can copy Mi 11X's device configuration for PE and tinker with it a bit. However, the structure of Pixel Experience's device configuration doesn't really resemble the device tree I see on Xiaomi's website (I suppose either of them is "non-standard"?), so I am stuck not doing what to do next. Any suggestions?
Click to expand...
Click to collapse
I have a version shared by the Chinese. However, it has a fingerprint error

Related

"contemporary" device specific code

I am new with the rom development and I would like to know if there is a way to create device specific code (mostly the device tree and the proprietary blobs) depending on the desired android sdk version. To be more specific, my device (Huawei P8 Lite) will not get an official nougat update and I would like to know the prerequisites and a good guide to follow, in order to create (and contribute to others - currently active devs) device specific code for my phone, since there is no open source for this phone.
Thanks in advance.
Many might think that this could be duplicate, but I haven't seen any question regarding the connection of the device tree and the android version ...

[Questions] Kernel source issues when compiling LOS/TWRP

Hello guys.
This question is specially for devs or advanced users with development skills.
My question is related to the kernel source of one of my devices, Huawei Mediapad T1 10 (codename: hwt1a21l). I got the kernel source from the oficial Huawei website and uploaded it to a github repo. My device, which has a msm8916 chiset, doesn't have any development (roms, recoveries, device tree, etc) and his rom, EMUI 3.0, is based on Kit Kat 4.4.2.
I have been trying to bring development for this tablet many months ago because the stock rom is too deprecated for the hardware that has, with the msm8916 there is a huge potential to bring it a lot of development.
Well, i'm going to summarize my problems when trying to bring development for the device:
To get started development, for example a LineageOS build i needed a solid base to start with: device tree, propietary blobs and kernel source, so i got all of them. I ported the device tree from another one very similar to mine (with the same chipset), extracted the propietary blobs with the build tools from the source and got the kernel source from the Huawei website. So everything seemed to be good, but when i start the build process with my Linux machine (repo sync > source build/envsetup.sh > breakfast hwt1a21l > brunch hwt1a21l) i always receive thousands of build error by the kernel source, and i have been fixing (or at least avoid) a lot of them but it never ends, so i don't know if it's worth to keep trying to "fix" them or if i'm wasting my time.
So, what i have been trying to do: i have been trying to build a LineageOS 14.1 and TWRP recovery with my device tree This: Mustang-ssc/android_device_huawei_msm8916-common ported from this one from @dianlujitao : dianlujitao/android_device_huawei_msm8916-common and the specific kernel source for my device downloaded from the Huawei website Mustang-ssc/android_kernel_huawei_hwt1a21l. Here ends the summary.
So after a lot of hours, days and nights over the last months trying to make progress with this and not getting any help from the few devs i asked after seeing my lack of progress i decided to publicly ask for help.
The questions:
1. I have the official kernel source (Mustang-ssc/android_kernel_huawei_hwt1a21l) which i didn't have success to compile it, and then i saw the kernel source from a device almost identical to mine (same chipset, brand, ram, ...) (dianlujitao/android_kernel_huawei_msm8916). Can i use that kernel source as a base for my device after porting the specific configurations of my official kernel source (defconfig, drivers, libraries)? That one is much more updated and probably optimized than mine, but i don't know if it's possible to adapt a kernel source from other device using your kernel source.
2. This may be a dumb question: my device has Kit Kat 4.4.2. Is there any link between the kernel source and the android version the device has? I mean, i don't know if i should do something to adapt my kernel source for newer android versions (Marshmallow, Nougat) of if it's ok to just build with it without any change.
If you read it all, congratulations, you're awesome
Still waiting for a reply

Willing to build Lineage OS... But will require community help

As there is no interest nor popularity on this device to stimulate a healthy developer community, I have decided to look into ROM building and what is required. I have followed this three part video in explaining how to build Lineage OS from source to a device. I have made it to part two where I download the Lineage OS source code to my Linux work-space. Where I get stuck is adding the source to the ROM. The question now is How do I attach the Lineage OS source code to the kernel source code for this device?
Information sources...
Part 1 https://www.youtube.com/watch?v=iZmjOlUq_3c&t=1s
Part 2 https://www.youtube.com/watch?v=MGI3NSJFtKA
Part 3 https://www.youtube.com/watch?v=AJCgOHtli64&t=153s
Current Kernel source code from Asus https://www.asus.com/ca-en/Phone/ZenFone-4-ZE554KL/HelpDesk_Download/
Just ordered one. I've never built Lineage OS either, but maybe we can work together to figure it out.
I have the lineage OS sorce code ready to compile on my system. I just need to know how to add the nesary kernel with it. Any ideas?
Any progress?
Sent from my [device_name] using XDA-Developers Legacy app
Nope! Unless you have anything to contribute.
someaguy said:
As there is no interest nor popularity on this device to stimulate a healthy developer community, I have decided to look into ROM building and what is required. I have followed this three part video in explaining how to build Lineage OS from source to a device. I have made it to part two where I download the Lineage OS source code to my Linux work-space. Where I get stuck is adding the source to the ROM. The question now is How do I attach the Lineage OS source code to the kernel source code for this device?
Click to expand...
Click to collapse
I also looked into building Lineage, seems like it's going to be more than I'm willing to commit to, so I'll share what I found in hopes that it will help you or anyone else move forward with this.
I found this restored CM wiki page on the subject: fat-tire.github.io/porting-intro.html (Sorry, can't make it clickable since I'm new)
The gist seems to be that you need to make three directories in the lineage source (note z01kd appears to be the codename for the Zenfone 4 based on the build.prop file I pulled from my phone)
device/asus/z01kd - Device file tree
kernel/asus/z01kd - Kernel
vendor/asus/z01kd - Proprietary blobs
In the above CM guide, it says to use ./build/tools/device/mkvendor.sh to generate the Device file tree from a boot.img file extracted from an update.zip (from Asus) or extracted from the phone, but that didn't work with the version I was trying to do (15.1), mkvendor.sh wasn't there at all. So I explored option #2 which was to fork an existing device file tree repo from a similar device and tweak it for the device you want to port and I found that the Zenfone Max Pro M1 (X00TD) (github.com/LineageOS/android_device_asus_X00TD) is the closest lineage supported device that we could copy from (at least that I could find). It looks like you might even be able to use the same kernel as that device (github.com/LineageOS/android_kernel_asus_sdm660) because the SOCs are pretty close (Snapdragon 630 vs Snapdragon 636), but you may need to use the stock kernel that you linked to in your original post, not sure.
There's a part in the lineage docs about building from source (only for supported devices) (wiki.lineageos.org/devices/X00TD/build#extract-proprietary-blobs) about extracting proprietary blobs (wiki.lineageos.org/extracting_blobs_from_zips.html) for the vendor/asus/z01kd folder. It said that you could use a lineage update.zip, but I was able to do it with the Asus update.zip. Don't know if that will work or not, but it seems like the only option since the Zenfone 4 doesn't have a lineage update.zip to pull proprietary blobs from.
And that's about as far as I got
Once you have those three folders set up and properly configured you should in theory be able to build it.
Update 9/3/2018
I just found the device file tree and kernel for Zenfone 4 that @shakalaca used to build TWRP. Looks like there are some different naming conventions from what lineage would expect (omni_Z01K.mk vs lineage.mk), but a lot of the stuff looks to be the same (eg BoardConfig.mk) and the files that do have a different name look like they're roughly equivalent.
github.com/TeamWin/android_device_asus_Z01K - Zenfone 4 TWRP device file tree
github.com/shakalaca/android_kernel_asus_ze554kl - Zenfone 4 TWRP kernel
Between these and the above X00TD device file tree and kernel links, we should be able to get pretty close to a working config.
What if you compile what you have and see if it boots on your device?
someaguy said:
What if you compile what you have and see if it boots on your device?
Click to expand...
Click to collapse
Sorry...I already deleted the environment I had set up, to reclaim the 50+ GB of disk space.
If it's any consolation, I never made it far enough for it to build successfully.
I am trying to build Lineage OS too
In this guide(https://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763)
It says we need three files(device tree,kernel,vendor) to build it.
We have kernel and device tree from github(https://github.com/TeamWin/android_device_asus_Z01K)
but we still need vendor from our device,and the commend under this guide(https://www.isthnew.com/archives/build-lineageos.html) says that we can get vendor files by running "extract-files.sh".
But where can we find that?
(Sorry for my bad English
rol.
try to look here.https://forum.xda-developers.com/pr.../tool-capire-le-treble-terble-vendor-t3774629
I have tried that CLT project,but it didn't work
Maybe use this?
https://forum.xda-developers.com/axon-7/development/tool-party-v0-1-vendor-partition-t3831517

COmpiling for custom ROM

Hello all,
I have a question regarding compiling the android source. This is mostly a general question that can be applied to any device ; however, the device I will be using is the Ascend Mate 7.
I recently got an old Ascend Mate 7 from a friend that I can do what ever with. So, I figured I would try to build Android from source and then flash it to the device.
I have already downloaded the source code. I am about to build the source for the Ascend Mate 7. Then, I found out that I might need to know the Device tree? There seems to be some conflicting information regarding this. Using google's guide, all I need to know is the code name for the device and there we go. We can compile the source! (Woot!)
On the other hand, other guides state that I need to download the device identity such as the tree, vendor, and kernel and include this in the source. (See this guide on xda website: https://forum.xda-developers.com/chef-central/android/guide-android-rom-development-t2814763) In another guide, I need to setup the jack server? (https://www.digitalocean.com/community/tutorials/how-to-build-android-roms-on-ubuntu-16-04)
So which is it? Should I just follow Google's guide or do I really need to know the device identity? If the latter, How do I search for the device tree, vendor, and kernel? More importantly, what are these and how do they work in relation to the Android source?
Also, I believe I will need manufacturer drivers for my phone to operate the peripherals. How do I download this? This might be a stretch but can't I get those files from the Mate 7?
Any thoughts?

Files/info needed to build LineageOS/Custom ROM for any unsupported device

Method to unlock bootloader
The device tree
The kernel (source code)
Proprietary blobs
Any other necessary repos
We recently completed a successful Kickstarter campaign for a minimalist smartphone running a modified version of LineageOS.
For that first version, we used the Xiaomi Mi A1 as the base phone. It’s a nice phone, official build and so straightforward to work with.
We would like to shift to a new phone, ideally something smaller, a bit cheaper (it doesn’t need to be super high spec). This new phone will need to be able to run Lineage (and so our modified version of Lineage).
I'm trying to figure out what we will need to ask for from suppliers so that we know that we can get a build working.
List above is what I have figured out so far. Would appreciate any comments.

Categories

Resources