what software/packages do you need to get a specific device working from AOSP stock - Android Q&A, Help & Troubleshooting

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.

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?

[Q] What are the steps to port a ROM to an unsupported device?

First a short question. What is the device configuration.(For example:https://github.com/TeamICS/android_device_htc_heroc) Which information does it contain? I don't think it's the whole Rom, but they update it, change stuff and so on?
Now my actual question:
I want to port a Kernel+System on an unsupported device.
Where do I have to start. Is there a difference between building it from source or port one from a similar device? Is one solution slower, more complicated or anything? There are many tutorials for porting, just bundle a system with a working kernel, but what to do if I want to have the Kernel also?
How do I extract the Device Proprietary Files without an github of the device?
Links, short explanation of the steps or anything else would be helpful.
I am sorry if this post seems to be ill informed, but I am searching and searching and can't find really helpful information..
chaoskoch said:
First a short question. What is the device configuration.(For example:https://github.com/TeamICS/android_device_htc_heroc) Which information does it contain? I don't think it's the whole Rom, but they update it, change stuff and so on?
Now my actual question:
I want to port a Kernel+System on an unsupported device.
Where do I have to start. Is there a difference between building it from source or port one from a similar device? Is one solution slower, more complicated or anything? There are many tutorials for porting, just bundle a system with a working kernel, but what to do if I want to have the Kernel also?
How do I extract the Device Proprietary Files without an github of the device?
Links, short explanation of the steps or anything else would be helpful.
I am sorry if this post seems to be ill informed, but I am searching and searching and can't find really helpful information..
Click to expand...
Click to collapse
First off what device do you have?
This link might be helpful
How to Port Android to Another Device
Now in regard to your questions i'll do my best to answer them best I can. The device configuration think of it as a fingerprint every fingerprint is unique (Although some a very similar), basically when building from source is tells the build what device you want the version of android your compiling to run on. They update and change the device configuration to reflect changes in the different versions of Android (Going from Gingerbread to ICS for example). Porting Kernels is not easy if you don't know C, things about embedded systems, basic Linux knowledge, among other skills but take a look at Guidance regarding Kernel porting, and what do you mean by port system? Here is a basic place to start for kernels AOSP Building Kernels and Building Your First Kernel. Yes their is a difference between porting a kernel and building from source, porting implies taking a kernel from device A and porting it to device B, while building from source means your building directly for device A. Porting in your case is probably going to be harder then building from source. If you want to have the kernel also again you have to modify it to run on the device you are porting it too. To extract proprietary files you have to hook your device up to your computer, turn on usb debugging, and using ADB run these commands:
Code:
cd ~/android/system/device/motorola/sholes/ # Replace Motorola and Sholes with your vendor such as HTC, Samsung, etc. and your device codename
Then run:
Code:
./extract-files.sh
Look at this guide for more info Compiling ICS from Source. Hope this helps you in some way :good:.

How to make source code of a new device?

Anyone here can u tell me how to create source code of a new device as my device is INFOCUS M680, kernel source.
I have used another device as same board to create source of my device but the kernel source is different. So anyone can tell me how to create kernel source and device tree.
My kernel version is 3.18.19+
Find the open sources for your device and download them. You need to match the build number from that release to the build number for the AOSP sources and download those as well. I have only done Samsung so far but the instructions are fairly clear for merging the sources. Next you need hardware drivers, in my case I have tons of free drive space so I just copied the entire /etc and /vendor from my device firmware.
A lot of time can be saved by downloading a matching sources from a custom rom. You can take configuration files and etc.
No open sources and no custom roms? You should start on something easier my friend. But if you want to continue forward with that I am guessing here. Unpack the boot.img and recovery.img files with the available unpackers. (save the info for the images and follow how to repack carefully) Match your build number to the AOSP sources and get the kernel. Modify, hack, gather and assemble what you need to make a new boot.img and recovery.img. Then with great courage comes lots of bricked devices..
Late reply so I didn't try to hard there. I will always help people send me a PM if your stuck
droidvoider said:
Find the open sources for your device and download them. You need to match the build number from that release to the build number for the AOSP sources and download those as well. I have only done Samsung so far but the instructions are fairly clear for merging the sources. Next you need hardware drivers, in my case I have tons of free drive space so I just copied the entire /etc and /vendor from my device firmware.
A lot of time can be saved by downloading a matching sources from a custom rom. You can take configuration files and etc.
No open sources and no custom roms? You should start on something easier my friend. But if you want to continue forward with that I am guessing here. Unpack the boot.img and recovery.img files with the available unpackers. (save the info for the images and follow how to repack carefully) Match your build number to the AOSP sources and get the kernel. Modify, hack, gather and assemble what you need to make a new boot.img and recovery.img. Then with great courage comes lots of bricked devices..
Late reply so I didn't try to hard there. I will always help people send me a PM if your stuck
Click to expand...
Click to collapse
Thanks for your reply.
I am planning to create a custom rom for my samsung tab A Sm-P555
Where do I start ? Is there AOSP for it ? How do I unpack everything ? Could you help me as I was very new to this ?
Many thanks in advance.
all you need is here
droidvoider said:
Find the open sources for your device and download them. You need to match the build number from that release to the build number for the AOSP sources and download those as well. I have only done Samsung so far but the instructions are fairly clear for merging the sources. Next you need hardware drivers, in my case I have tons of free drive space so I just copied the entire /etc and /vendor from my device firmware.
A lot of time can be saved by downloading a matching sources from a custom rom. You can take configuration files and etc.
No open sources and no custom roms? You should start on something easier my friend. But if you want to continue forward with that I am guessing here. Unpack the boot.img and recovery.img files with the available unpackers. (save the info for the images and follow how to repack carefully) Match your build number to the AOSP sources and get the kernel. Modify, hack, gather and assemble what you need to make a new boot.img and recovery.img. Then with great courage comes lots of bricked devices..
Late reply so I didn't try to hard there. I will always help people send me a PM if your stuck
Click to expand...
Click to collapse
Hola
Perdón pero estoy sufriendo errores con la app XDA labs
Thank you

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

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!

Categories

Resources