Android compiling - General Questions and Answers

So ive been unfortunate so i cannot get A12 on my Xperia 1(J9110). But on dev.sony there is a compile guide for 12. I tought i will compile it from there.
But it cant be "that easy", i suppose it will have bugs that i need to fix but the last language i used was html in high school(yea yea get on with it).
My question is: if i compile it for myself can i use it as out-of-the-box or do i have to fix stuff or its an useless idea?

You would need to check if your device is listed in the devices.xml. If it is listed, there is a possibility that Sony has been updating the device tree, kernel and vendor blobs for android 12 and you could try compiling.
If it's not there, you won't be able to compile at all for your device without making a device tree, extracting vendor blobs and finding the right kernel for android 12, which would take a lot of work.

Griffin is there which means there is a chance. Still, can i use it out-of-the-box?

Related

Relationship between Android and kernel

Hi all,
Looking to build my first custom Rom and had some queries terminology-wise.
What is the relationship between the kernel and Google's android platform? For instance, is froyo tied to a specific kernel and is this in the source tree?
Second q: HTC release their kernel sources. Say I wanted to get a froyo build up for a device that currently only has eclair, would the procedure be to diff the HTC modifications against the vanilla version and then make the appropriate changes to froyo?
Third q: what makes a Rom specific to a device? Probably linked to first question...
Many thanks,
Martin
Sent from my HTC Wildfire using XDA App
The kernel is basically just a linux kernel with device specific drivers and such added. I've done a 'diff' between the Eris 2.6.29 kernel from HTC and the 'generic' 2.6.29 kernel from kernel.org. It's kind of neat to see the difference. I highly recommend you do that.
There are also device specific drivers in the file structure that the ROM needs in order to function.
What I've done is compile AOSP from source, compile the kernel from source, zip up the needed files/folders, signed the ROM, and then flashed it to test. If you look at Android Builder in my sig, you can figure out the difference between the Eris and your device. You'll have to change the kernel that gets downloaded, of course. And it really just gives you a basic ROM without the device specific drivers, so things will not work without figuring the rest out. Grab a stock ROM to get drivers, libs, etc. out of.
/system/usr/keychars & /system/usr/keylayout usually have the keyboard drivers, which are somewhat important.
Also in my sig is the SgtShultz ROM where I tried to make a usable ROM from as close to source as possible. You might get some ideas from there. I still haven't figured out how to get the audio to work. If I get that worked out, I'll actually start using the ROM daily and work out the rest!
Froyo seems to work with kernel versions 2.6.29+, btw.
Many thanks for this; it's given me a good set of places to start reading.
Just pulling down all the AOSP source as we speak, with the hopes of getting a basic build up in the near future
gnarlyc said:
What I've done is compile AOSP from source, compile the kernel from source, zip up the needed files/folders, signed the ROM, and then flashed it to test. If you look at Android Builder in my sig, you can figure out the difference between the Eris and your device. You'll have to change the kernel that gets downloaded, of course. And it really just gives you a basic ROM without the device specific drivers, so things will not work without figuring the rest out. Grab a stock ROM to get drivers, libs, etc. out of.
[...]
/system/usr/keychars & /system/usr/keylayout usually have the keyboard drivers, which are somewhat important.
[...]
Froyo seems to work with kernel versions 2.6.29+, btw.
Click to expand...
Click to collapse
A couple of questions on this front...
I can see, obviously, where to get the kernel source and needed drivers; I am, however, unclear as to where I should obtain AOSP drivers from (to go, for instance, in /devices/htc/buzz and/devices/htc/buzz-common). Can I extract these from my device? (or do I need to wait until they release Froyo and then extract them from a device running the newer build?) Where on the device should I be looking for this driver set?
Thanks again,
Martin
MartinEve said:
A couple of questions on this front...
I can see, obviously, where to get the kernel source and needed drivers; I am, however, unclear as to where I should obtain AOSP drivers from (to go, for instance, in /devices/htc/buzz and/devices/htc/buzz-common). Can I extract these from my device? (or do I need to wait until they release Froyo and then extract them from a device running the newer build?) Where on the device should I be looking for this driver set?
Thanks again,
Martin
Click to expand...
Click to collapse
For the most part, any Eclair drivers seem to work. At least that's what I have used for the Eris. 2.1 -> 2.2 isn't too big of a jump. I used drivers from a stock 2.1 ROM.
Look up vendor tree, vendor config, and 'extract-files.sh'. You'll see what people with other devices have done. I have yet to quite get the whole vendor tree thing worked out, but others have. You can just come up with a list of needed drivers to add to the 'extract-files.sh' script and just copy those files in manually. (That's what I have done.) This will get pretty close to making an AOSP build complete. However, it appears that actually using the vendor tree setup while compiling will get things 'right'. There appear to be some libs that will compile differently for different devices.
So, basically, if you compile AOSP without a vendor tree for your device, the build will be located in out/target/product/generic. (And, you can copy drivers in later while using the kitchen, but you might miss out on some AOSP stuff with device-specific changes.) If you use the vendor tree, it will be in /out/target/product/buzz and will contain the drivers that the 'extract-files.sh' script grabbed from your device along with custom compiled libs.
If you are able to get a working vendor tree for your device, it will be helpful to the entire community. They'll all be able to use it for their builds. I highly recommend doing that. Most groups use github or something similar to post the code.
I still have much to learn myself, and you are starting to reach my limit! Good stuff.
Hi,
Many thanks for your reply; to a degree, it's about knowing the terms to search for -- the extract-files.sh is a godsend for information that I would have otherwise missed.
Anyway, onwards to build a usable vendor tree
Best,
Martin

[ASK][MSM8625] Compiled kernel from CAF doesn't boot

Ok, I'm trying to do something fun with my phone... (Hisense EG909 MSM8625)
Since hisense is keeping the source code, so I'm trying to build the source from codeaurora.org ics branch M8625SSNSKMLYA1015 (to keep the same version with my current stock ROM)
I've successfully compiled the kernel with the ndk but I'm stuck on getting it to boot.
It just show the carrier logo (bootloader). I can't get the bootanimation to load.
I'm not expecting things like wifi / bluetooth or even the radio works... but I'm just trying to at least get it to boot the launcher
I have experience in c/c++ but I know nothing about android and just started to learn it...
Can anyone point me on how to debug or see what's wrong with the kernel?
Is there any way to show something on the screen? I mean turning on the frame buffer
I've search and tried many method like altering the command line "console=tty0", adding "CONFIG_MSM_FRAMEBUFFER", etc..
but seems like nothing works, it just stuck there...
the way I build is:
1. downloading code from caf
2. pulled config.gz from my working phone... but it require some hisense stuff. so I'm using the configs that come with the code
3. tried both msm7627a_defconfig and msm7627a-perf_defconfig,
4. extract current working boot.img
5. substitute the kernel with my compiled zImage, and repack the boot.img
Am I missing something here?
million thanks for your help...
Looks like you are missing some hardware drivers. Why not find the lines in defconfig mentioning "hisense stuff" and search at Google or "searchcode.org" to see if drivers are available. And then patch your source as necessary.
sharonsym said:
Ok, I'm trying to do something fun with my phone... (Hisense EG909 MSM8625)
Since hisense is keeping the source code, so I'm trying to build the source from codeaurora.org ics branch M8625SSNSKMLYA1015 (to keep the same version with my current stock ROM)
I've successfully compiled the kernel with the ndk but I'm stuck on getting it to boot.
It just show the carrier logo (bootloader). I can't get the bootanimation to load.
I'm not expecting things like wifi / bluetooth or even the radio works... but I'm just trying to at least get it to boot the launcher
I have experience in c/c++ but I know nothing about android and just started to learn it...
Can anyone point me on how to debug or see what's wrong with the kernel?
Is there any way to show something on the screen? I mean turning on the frame buffer
I've search and tried many method like altering the command line "console=tty0", adding "CONFIG_MSM_FRAMEBUFFER", etc..
but seems like nothing works, it just stuck there...
the way I build is:
1. downloading code from caf
2. pulled config.gz from my working phone... but it require some hisense stuff. so I'm using the configs that come with the code
3. tried both msm7627a_defconfig and msm7627a-perf_defconfig,
4. extract current working boot.img
5. substitute the kernel with my compiled zImage, and repack the boot.img
Am I missing something here?
million thanks for your help...
Click to expand...
Click to collapse
if you can't extract original defconfig (config.gz) from device, it would be hard to have bootable kernel.
Sent from my Oppo N1 using Tapatalk

[Q] Informations for building a new Device tree for a unsupported Device

Hi Everybody,
I want to ask for some informations what is need to do to build SlimRom for a new device. I found a lot of informations about CM, but nothing is really in a way that I really know what I have to do at the end. So is there a Howto, which describes it a little bit more in detail? A lot of howtos was found which describe to get a build-system, and to generate something for a know device. But everybody then describes only: you have to get the vendor files, made your Board-config but only on a very high level.
What I did:
- set up a building-server on ubuntu.
- get Slim-Sources branch JB4.3, and build the version for galaxysmtd to be sure that the buildprocess is ok.
- get "Nonreallyfree"-Opensources from Samsung for my I8200, and try to put them in the right places, and try to implement all needed files in the device/samsung/i8200 folder.
Up to now I think I have everything in place more or less, but the system told me that there is no rule for make 'bacon', but lunch seems to work right with setting the variables...
Up to now I did not used the blobs of the devices. The question is, if that is needed if I have the sources from open Samsung?
I know, jb43 is not the newest, but I start here, because up to now the sources are based on that level, and the kernel have no selinux implemented... If this start point will work, then I will try to go ahead with higher versions... end goal will be Slimkat...
Any help is very much appreciated!!
BR
SP

[Q] Need Help with Compiling AOSP Nougat - Proprietary Binaries

So I've decided to give building Android a go, considering we've recently obtained the source code for the device in question (R1 HD) and no one else has done this yet for this device. I've been following this guide, since all the other guides I've found assume there is already a GitHub repo for your device. There's literally NOTHING out there regarding this device, aside from the kernel source we've obtained in the form of a .zip archive.
I've done everything up to and including pulling the 7.0.0 r1 source with the reop sync command, and I am now stuck on the Preparing to Build section. The first thing it talks about at this point is implementing proprietary binaries into my source. I have no idea where to find proprietary binaries for my R1 HD, let alone if they even exist out there to be implemented. Literally all I have regarding this device is the kernel source in a zip file. I can't find anything else out there nor do I really know what to look for.
Can anyone tell me what to do here? I've never compiled Android or even a kernel before, and I'd really like to get something out there for this device that others can base their work off of.

Question attempt at learning how to compile TWRP for our device.

I am not an experienced dev, and only know enough to be dangerous. that said, i used twrpdtgen from https://github.com/twrpdtgen/twrpdtgen to generate what ought to be the berlna device tree with the necessary board files etc.
what do i have to do, specifically, to clone the twrp source via git/repo? can anybody here explain it like you realize i don't know what i am doing i'll figure git and repo out eventually, but this will go quicker if someone would enlighten me
which android version do i want to build twrp with? apparently 12.1 support isn't finished yet, so i should use 11 with aosp source?
note, for our deivce you need to use the script on upon boot.img as we've a/b format, grab from latest stock rom to gen yourself, or see attached. also, necessary to use WSL on windows with a linux distro, or a linux vm, python on windows will not work.
please feel free to use these if it furthers the cause of compiling twrp before i learn how to use git and repo and compile it.. hehe
I wanted to try my hand at this and start digging into git and repo. I got as far as getting all the files ready, setting up the tree where it needed to be, used ". build/envsetup.sh", then lunched with option 5, which is omni-berlna_eng, which is closest to the twrp minimal manifest build option.
After I lunch, the issue arrives with the fact that omni-berlna_eng uses a depreciated PRODUCT_STATIC_BOOT_CONTROL_HAL, whatever that means. So I tried using lunch option 2, which would be an aosp-arm64_eng, but that just gives me the error "#### failed to build some targets (1 seconds) ####".
As of now, I'm at a loss. I don't have the extra time to spend working on this to make it function, and I only get a few hours at a time to get a crack at it, but nothing seems to work.
Edit:
I should mention, this is my first attempt at anything android development. I got this phone as a secondary carry on and I've dirtyflashed Pixel Experience onto it using a method found for Moto G Power TONGA. Wanted to see if I could get TWRP running since dirty flashing killed my mms and calling services.

Categories

Resources