I wanted to learn about some best practices about working on more than one Custom ROM (for the same device), I already have a working LineageOS build environment for my device (kebab).
I want to get to see how building an other ROM differs from the LineageOS building process, if a ROM has any sketchy Google requirements I don't like, and how functional a ROM is when building it with the device trees and kernel sources provided by LineageOS. Don't worry, I don't want to create buggy binaries of 10 different ROMS, post them on XDA and abandon them after two days. I just want to get more experience and try to build other ROM's myself, and to see what modification are required for a ROM port.
Is it possible copying some source code from my working LineageOS building environment so that repo doesn't have to re-download everything?
Is it okay to use the same ccache for both ROM's, so that I don't to re-compile binaries these both ROM's share? (As of my understanding, ccache keeps my build times lower when re-building a ROM, is that right?)
Any other tips about managing multiple building environments are appreciated! Thanks!
Related
Ok so I have built cm11 for my device (galaxys s 4g), and ported cm11 from another device to (aries -> galaxy s 4g). CM11 has too much going on IMO and I just want pure aosp on my device, the problem is that there are no (recent) aosp roms for my device, or any similar devices.
So how do I port my device to a different flavor of android when there are no roms of that flavor?
What have I tried?
So far I have setup the aosp 4.4 repo to a different folder than my cm11 repo (the build environment files should be the same right?)
I tried using the manifest from the cm11 rom and buidling with aosp,that didnt work it didnt even finish compiling =(.
I browsed the aosp source for other devices by the same manufacturer, but everything looked completely different from what I am used to.
The most helpful guide in this direction sofar has been cyanogenmods guide but it has left me with more questions than answers.
What [I think] I need to know
Custom recovery - aosp doent seem to include a recovery, the cm guide says to start with the recovery. So i need to know if I need to add a custom recovery to aosp, or if i can install aosp roms from twrp without breaking it.
Binaries - It is safe to use the binaries used in CM11 for aosp/any other flavor, or are the binaries flavor specific? (im thinking they are safe to use, but not entirely sure).
Device files - what files should be safe to use for any flavor?
Kernel - Cm builds the kernel when you compile the rom (or so it says), does aosp build the kernel when you build the rom, or do I have to build the kernel separately? Is it safe to say use a CM11 kernel with an aosp rom?
Pardon my ignorance. Just for fun and learning, I am willing to build a custom ROM from scratch for Sony Xperia-L from Android AOSP. But, even after going through a number of tutorials, following are the issues which are yet unclear to me:
How to obtain Xperia-L specific drivers to intergrate it into my build. Please note that unlike a few tutorials has suggested, I don't want to start from CM ROMS. I want to do it from 'scratch'
I have downloaded Open source archive for build 15.3.A.1.12, 15.3.A.1.14 and 15.3.A.1.16. It contains two top level directories: kernel and platform. What are these two for? Given the size of AOSP so large, I presume this archive does NOT contain full source for Xperia-L stock ROM. Am I correct to reason that?
Without using kiddie-approach, e.g. different ROM kitchen, what is the recommended approach to for a beginner to master the art?
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.
My question is really simple: How can I make an unofficial port of LineageOS? I've read this, which is based on an article from the (now death) CM Wiki, but some files (e.g. the mkvendor.sh script) are in older CM repos/branches. According to what I've read, there's not a full guide explaining the porting process since every device has its own tweaks (I imagine that it's due to ARM's nature)
What I want to do: Port LineageOS (the latest version) to the Samsung Galaxy Ace 4 Neo SM-G136ML (codenamed vivalto3mve3gltn). However there's not a LOS port at the latest version for a similar device which I could fork, so this would be "from scratch" in some way. I've seen Lineage's android repository at github but idk what are those xml files (they are definitively not the source code of a whole OS) EDIT: I realized that I had to clone it with `repo init`
What I've done so far: Documented myself as much as I could, read about how to get the vendor files, firmwares, kernel sources (in fact I requested the kernel source code for the device to the vendor), build.prop, recovery.fstab, and recovery/boot images.
My skills: I have a lot of experience with the GNU/Linux OS and I know some Linux kernel hacking, in fact I'm used to compile kernels for the x86_64, i686 and armv7h arch'es (not the vanilla kernel itself, but the Linux-libre kernel, which is basically vanilla but without binary blobs) and also patch them, and test them, etc. Besides kernel-stuff, I know shell scripting, advanced use of git (git clone, commit, add, push, remote, fetch, diff, apply, and more), use Heimdall, install custom recoveries and ROMs, and some advanced (non-noob ) Android hacking (Idk Java, C nor C++, however)
I know that here at XDA we've very talented developers who have experience with this, and much more. The only thing I need is some guidance to help me in my way to contribute the FLOSS community, I say this because when I asked in the LineageOS IRC channel if there was an official or well documented and updated guide, step-by-step, tutorial to port LOS that I could follow, someone answered me "it's impossible to have something like this", but I believe that there's ppl here who can demonstrate me the opposite
Thanks in advance
(...) I requested the kernel source code for the device to the vendor
Click to expand...
Click to collapse
Here it is https://gitlab.com/Megver83/android_kernel_samsung_vivalto3mve3gltn
We need build instructions in order for people to more easily make custom roms. Currently most roms here only provide a repo or two, hardly describing the build process if anything. Not sure if those repos contain all the sources/blobs you need either.
It's not that hard to build and you can always go on th cheap and hire a cloud vps for a few hours, so don't bother with local building unless you have the powerful hardware.
Anyhow, so far what I know is that some people just replace the kernel and firmware, it seems this is called repacking.
Others are building Lineage from source as per their instructions, which are not descriptive when you're porting to a new device.
We need concrete and concise information about how it's done.
Lineage wiki is pretty accurate and if someone ask here I can try to solve his doubt.
I am not the best developer but I know the basics xD
Can you describe the basic workflow?
Which repos to check out, what build scripts are there, how to combine them. Basically a short tutorial on stuff. Also how come you're using 821 kernel from zl1, i know 820 and 821 are alike, but when do you patch the kernel to work for 820, i read that you need some config changes and a different gpu blob.
I am a developer myself, but not an android rom one. Things look really fragmented and chaotic. Besides Lineage wiki, I haven't found anything that resembles docs. I really want to contribute on this and have the hardware to build, just need some info on where to begin.
Thanks for taking your time to reply.
randxor said:
Can you describe the basic workflow?
Which repos to check out, what build scripts are there, how to combine them. Basically a short tutorial on stuff. Also how come you're using 821 kernel from zl1, i know 820 and 821 are alike, but when do you patch the kernel to work for 820, i read that you need some config changes and a different gpu blob.
I am a developer myself, but not an android rom one. Things look really fragmented and chaotic. Besides Lineage wiki, I haven't found anything that resembles docs. I really want to contribute on this and have the hardware to build, just need some info on where to begin.
Thanks for taking your time to reply.
Click to expand...
Click to collapse
Thats thanks to codeworkx code. Basically you compile a rom for zl1 and works for zl0.
My workflow is
repo init/sync the rom
Fix libhidl and libbfquio if needed (Dont know why they fix an error creating a bigger one tho)
Take the device tree, vendor and kernel
Adapt the device tree for the rom (Like in cosmic where config is in root not in config folder, boardconfig...)
And just brunch or make or lunch depends on rom xD
Edit: Forgot u need like 200 frameworks/av commits to make zoom work https://github.com/mosimchah/frameworks_av/commits/o8.1 all the january 15th and this one http://gerrit.aicp-rom.com/#/c/54436/
You init the Lineage repos?
What are those libhidl and libfquio about, and how do you fix them?
Vendor is the firmware blobs?
Kernel is obvious
What is a device tree? And how it relates to the kernel?
How did you adapt it to the device?
Different devices have different partion layouts I assume. How do you make the zl1 rom work for both zl0 and zl1? Earlier people were reporting bricks because of flashing roms for zl1 on zl0
randxor said:
You init the Lineage repos?
What are those libhidl and libfquio about, and how do you fix them?
Vendor is the firmware blobs?
Kernel is obvious
What is a device tree? And how it relates to the kernel?
How did you adapt it to the device?
Different devices have different partion layouts I assume. How do you make the zl1 rom work for both zl0 and zl1? Earlier people were reporting bricks because of flashing roms for zl1 on zl0
Click to expand...
Click to collapse
Yout init the rom source you want to compile
You dont need to adapt anything codeworkx already did it for us we just compile zl1 roms with his device tree (Los one) or any of the forked ones (Like Aicp which I recommend).
Libhidl and libbfquio depends on the rom you are building. Libhidl is solved by reverting this changes https://github.com/PixelExperience/system_libhidl/commit/607e961b85eea8969503d8ff8437c014f04f0ca2 and libbfquio by taking this http://gerrit.aicp-rom.com/#/c/56488/
You dont adapt device tree to device you adapt it to the rom you are compiling see how other devs do it in their github (Every rom is different for example in cosmic you rename lineage/aicp.mk to cos.mk and change where to import things)
---------- Post added at 01:53 PM ---------- Previous post was at 01:49 PM ----------
Start by picking up a rom you want to compile that has 8.1 source working and better if a msm8996 device is there (zuk z2, oneplus 3...)
Thanks for the info. Will experiment a bit when I have free time. Planning on making an in-depth guide if I succeed and clarify the concepts.
Btw I see that everyone is using kernel 3.18.20, why can't we get a newer kernel? If we have the sources for it and the blobs? Is the reason being that the drivers are not in the mainline kernel so they need to be ported to a newer kernel?
randxor said:
Thanks for the info. Will experiment a bit when I have free time. Planning on making an in-depth guide if I succeed and clarify the concepts.
Btw I see that everyone is using kernel 3.18.20, why can't we get a newer kernel? If we have the sources for it and the blobs? Is the reason being that the drivers are not in the mainline kernel so they need to be ported to a newer kernel?
Click to expand...
Click to collapse
Np
Not sure dont know much about android kernels