Willing to build Lineage OS... But will require community help - Asus Zenfone 4 (2017) Questions & Answers

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

Related

[Q] How to add new device tree,new kernel source code to CM source & compile?

Hello everybody.
I have a noob question about compile cyanogenmod for my new device.
Now, i have: CMW recovery, Kernel source code on local computer, full repo cm source + toolchains.
How to add my device tree, kernel source code to CM source and compile CM7 ROm?
Thanks you, cheer
Anyone here?
Did you figure it out yet? I asked the same question and am waiting for an answer, tho I'm on CM 10, HTC Vivid. If I figure it out I'll post back and try and help.
nguyenhonganh said:
Hello everybody.
I have a noob question about compile cyanogenmod for my new device.
Now, i have: CMW recovery, Kernel source code on local computer, full repo cm source + toolchains.
How to add my device tree, kernel source code to CM source and compile CM7 ROm?
Thanks you, cheer
Click to expand...
Click to collapse
I met the same problem, does anyone can help?
Do you have a device tree? Or do you have an unsupported device? If you have an existing device tree from some other ROM, etc, then you just need to edit your .repo/local_manifest/roomservice.xml to pull in the trees that you need.
If you need to create a device tree, then it gets not complicated, as each device is different. The basic process is to create the necessary directories (device/manufacturer/model, kernel/manufacturer/model (may need to be kernel/manufacturer/device_family/model, for reference to that, see CM's repo for the LG G3) and finally vendor/manufacturer/device.
After you have the directories setup, you will need to actually start building the tree. The easiest way is to copy another devices files into your devices tree, and then edit the files. The closer the device you copy in is, the less work you will need to do to the files. Refer to sites like gsmarena.com, PhoneArena.com, etc for phone specs.
That's about as far as I can take you without dealing with a specific device. If you need more info, post back here with your questions, and post your device specs, or at least the model number,and I'll see if I can help.
rassawyer said:
Do you have a device tree? Or do you have an unsupported device? If you have an existing device tree from some other ROM, etc, then you just need to edit your .repo/local_manifest/roomservice.xml to pull in the trees that you need.
If you need to create a device tree, then it gets not complicated, as each device is different. The basic process is to create the necessary directories (device/manufacturer/model, kernel/manufacturer/model (may need to be kernel/manufacturer/device_family/model, for reference to that, see CM's repo for the LG G3) and finally vendor/manufacturer/device.
After you have the directories setup, you will need to actually start building the tree. The easiest way is to copy another devices files into your devices tree, and then edit the files. The closer the device you copy in is, the less work you will need to do to the files. Refer to sites like gsmarena.com, PhoneArena.com, etc for phone specs.
That's about as far as I can take you without dealing with a specific device. If you need more info, post back here with your questions, and post your device specs, or at least the model number,and I'll see if I can help.
Click to expand...
Click to collapse
I have a mt6750 devices... And there is a device from my company manufacturer.. Its a mt6750 device, it have cm device tree.. Both device working on same rom.. I can port that device rom but it always give me bugs.. So my question is how to use it?

Making own rom for Mediatek device

Hello!
I'd like to build my own rom from AOSP 8.0 official branch. I'm looking for some kind of guide but couldn't find any So, let's say I've got android source code and files from other custom rom that makes camera work. What have I to do to make my rom now? How can I build it and be sure that everything will work. Generally my target is to install android 8 on my Leeco le 2 x620 device with Mediatek chip
Any help is appreciated ^v^
LEGOL2 said:
Hello!
I'd like to build my own rom from AOSP 8.0 official branch. I'm looking for some kind of guide but couldn't find any So, let's say I've got android source code and files from other custom rom that makes camera work. What have I to do to make my rom now? How can I build it and be sure that everything will work. Generally my target is to install android 8 on my Leeco le 2 x620 device with Mediatek chip
Any help is appreciated ^v^
Click to expand...
Click to collapse
"I'd like to build my own rom from AOSP"
So you mean an aftermarket os like lineageos or carbonrom or do you mean that you take the aosp repo and compile aosp for your device? You can look in source.android.com
"source code and files from other custom rom that makes camera work"
Is that an already compiled rom? Because you won't get source code out of that
"How can I build it and be sure that everything will work"
Ya don't. Nothing can ever be 100% bugfree, it can either be from your device tree's source code, or the aosp code itself.
Generally, if there is a caf tree for your device, it's going to be 3x as hard to create an aosp tree.
It is going to be 100000x as hard to create an aosp tree that is for a newly released, new hardware requirement operating system.
Wanna know the topping of the cake? Mediatek is notorious when it comes to releasing the source (in fact, it has become a meme in the Mediatek users world) but don't let that stop you son.
You can try, but don't give up just because it won't compile the first couple of hundred times. The errors when compiling should give you a great start
Good luck.
ramiabouzahra said:
"I'd like to build my own rom from AOSP"
So you mean an aftermarket os like lineageos or carbonrom or do you mean that you take the aosp repo and compile aosp for your device? You can look in source.android.com
"source code and files from other custom rom that makes camera work"
Is that an already compiled rom? Because you won't get source code out of that
"How can I build it and be sure that everything will work"
Ya don't. Nothing can ever be 100% bugfree, it can either be from your device tree's source code, or the aosp code itself.
Generally, if there is a caf tree for your device, it's going to be 3x as hard to create an aosp tree.
It is going to be 100000x as hard to create an aosp tree that is for a newly released, new hardware requirement operating system.
Wanna know the topping of the cake? Mediatek is notorious when it comes to releasing the source (in fact, it has become a meme in the Mediatek users world) but don't let that stop you son.
You can try, but don't give up just because it won't compile the first couple of hundred times. The errors when compiling should give you a great start
Good luck.
Click to expand...
Click to collapse
Oh God, how am I meant to do this ;0 There is Lineage 14.1 project on my device. I really want to have android 8 on my phone. Thank you for all the advice.
Yes im trying the same andere without any succes so far.
Im also trying to port from a different device ROM to the stock ROM what im running now.
The chip sets are the same but the Android versions not.
It would be really Nice if some mtk ROM developer find some time in his busy life to create a ROM for our phone.
Or a guide to compile/port Android o tot oud phone.

Build ROM from scratch

I would like to develop a custom ROM for my device. I read some guides and obtained some basic knowledge, but still don't know how to start. So I would like to ask some questions to test my knowledge and expand them.
My device: Wiko View
My Android version (actually installed): 7.1.2 almost pure Android (just some third-party apps)
Desired Android version: AOSP 9.0 (maybe?)
So as far as I know I need these things:
AOSP Source Code (9.0)
Kernel
Vendor (tree or blobs?)
Device tree
So for the AOSP: I can get it from the repo hosted by Google. How should it look once downloaded?
For the kernel: should I use that from my actual ROM, or the most recent one? And how to include it in my ROM before compiling?
For the Vendor: As far as I read, with project treble I shouldn't edit this. But since I'm not developing a treble ROM, I'm in troubles, right? In older ROMs (before Oreo and Treble), they're stored in /system/vendor. Is just that folder or are there more? Do I need to update something? Where do I need to put this folder?
For the device tree: I read some guides that explains how to extract it from ROM (only from 5.0 and up, since mine is 7.1 no problems, I hope). Is this right or are there other ways? Or do I need to write it myself?
I'm going to thanks anyone in advance. I know there are plenty of questions, but I hope this thread will be a place for begginer (like me) to know more about compiling from source a ROM. Have a great day!

what software/packages do you need to get a specific device working from AOSP stock

hello again peeps,
ive been gently banging my head around these past few days because i keep walking into knowledge pockets and nothing i can find, in the form of help or internet information, is filling in these holes. i originally planned to take my oneplus device and obtain the source code for oxygenos so i could build and customise it. this seems to have become a dead end so now i just want to build stock android via AOSP, but i dont understand what software i need to get the AOSP working on any device, so far i understand that you need 3 components; 1) Kernel 2) Vendor files (if any) 3) "Proprietary binaries".
The problems are, i have no idea how to obtain these "proprietary binaries", i have no idea where to put any 3 of them in the downloaded android source tree (after repo sync), and i dont know if thats all the information i need to atleast build and flash a stock image onto any phone. i think i have the kernel files i need on OnePlusOSS github and there is a vendor.img in the OTA update files, and a directory in my phone. if anybody could please guide me in the right direction, it'd be very cool. i just want to get started and have some fun.
0
Seppppx said:
You can't customize Oxygen Os as the source code doesn't exist for that. (It's not required for companies to publish that.)
What phone do you have? You already might have the required trees to build AOSP (or at least LineageOS)
You need
1. A Device Tree
2. The kernel (you can use the prebuilt kernel if you really want)
3. The proprietary vendor blobs located in the vendor partition.
You will probably have to download the aosp-caf source code instead of aosp for it to be more easy.
https://www.youtube.com/channel/UCnGqG_jyyXmTzdamBpKfeHA
This is a great channel about Android building and has about everything you need to know.
Click to expand...
Click to collapse
thank you for every inch of text in your reply. I have a oneplus 8. Ah right, so the vendor folder CONTAINS the proprietary binaries/blobs.
it seems safest for me to use the kernel in the manufacturers github for the first flash as i want to be careful with making changes. may i ask what "aosp-caf" is? or can i find out using the resource you provided? thank you again.
my new understanding is, you need; 1) android source (e.g android-10-r5) 2) kernel 3) proprietary blobs. this helps a lot and is a lot clearer. the last issue i have is with knowing where to put the kernel and the blobs. i think if i am not mistaken you put the blobs in a vendor folder after the build? i am unsure with the kernel. i am going to definitely check this guy out. your time means a lot to me.

Porting PixelExperience to my Mi 10S with known device tree?

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

Categories

Resources