Android kernel from scratch using latest stable from kernel.org? - android

Specific infos:
Devices: Nexus 7 (2013) & Nexus 4
Both using google_msm as a base (3.4.0)
As the time of writing the latest stable kernel from kernel.org is 3.19.1
It is possible to do minor updates (like 3.4.0 -> 3.4.106)
Is it possible taking the latest stable release from kernel.org as a base instead of directly pulling from google_msm for my devices and build upon it?
Are there some tools like diff/patch to detect the Android/device specific files and stuff them in in the correct folders without looking through each folder seperately? (Or at least prints it out, so i can do it manually)
I'm a kernel modder at best , so my experience is very low with the kernel itself, tough i'm willing to learn to archive this.

So after further digging around i found this:
http://www.linaro.org/blog/android-blog/androidization-of-linux-kernel/
I tried doing this with the repo below as a base, but failed miserably at git --rebase.
I've cloned https://android.googlesource.com/kernel/common.git/+/android-3.18 and will try building on that, as it is already an "Androidized" kernel. I think i'll just have to put in the chipset specific stuff, defconfigs and so on.
My only concern is that the chipset specific stuff will refuse to work with this, but i can't know for sure until i've actually tried and failed, so i'll do that.
If anyone can share some knowledge i'll be grateful.

Related

How to compiling a kernel module for Android ARM?

I ask a question because I have been trying to solve problems with the keyboard for quite a long time without success. I want to understand how Android kernel modules are compiled. The task is to connect the USB WiFi adapter from Android via OTG and manage the terminal interface. But as an example for teaching fits perfectly. After reading many articles on the subject, I never came close to a solution.
But from what I read, I learned that:
There are two options: build the module into the kernel when compiling, or compile and load it separately (if it is possible that
the kernel will support this property).
The software required for compilation is: Android NDK, SDK.
You need the source kernels for which the modules are compiled (You can use a clean kernel similar in version and architecture, the
version must match up to the second digit after the dot).
Get the kernel assembly file with the device. (/proc/config.gz)
But that's all, I don't know what to do next. The device I use for testing Xiaomi Mi A1 (Android One) i.e. there are no problems with the kernel sources, plus active support for LineageOS, which is currently the main OS. Module sources that I want to build on GitHub marked "Android Support".
I don’t understand the procedure, is there a way to assemble like assembling a PC, i.e. for desktop it's just make, make install?! But I have no idea what to do in my situation.
If anyone has comments on the above, inaccuracies, errors, or any additional information, please let us know. It is also a very important question how to check whether the kernel supports loading modules on the fly or what needs to be corrected for such features, although without a ready-made module this is not so important, but still ?!
I would be glad for any information, I can’t figure it out myself anymore. information in various sources varies and there is no universal assembly method.

Building android go from AOSP Q Beta 1 code

I am newbie to ROM development. I have a Moto e 1st gen device sitting around. I wanted to give it another life. So I was trying to build Android Go from AOSP Q Beta 1 source code. I don't know how to add a product and how to configure it to build Android Go. Please help me to configure and build it.
To build a rom from scratch, you need the device trees, kernel source code(or pre-built image), vendor blobs and the required HALs. From your question I understand you don't have any device tree lying around for your device. First try to build roms like LineageOS using the existing trees for your device. Also the Q source code is not the real deal. It is only the master branch and the full source code will only be released once Q is announced.So as I said, try building roms like LineageOS first.

Android build environment

I have been working with standard android for some time. Recently I have been building android sdk for windows and find some interesting things in Android build env. There is a command called lunch which can be used to list all available targets to build. However, it does not list sdk and its variants,even though they are valid options.
Does anyone know why is that the case?
Also can I build any specific module in Android sdk without building the whole sdk. (It could be a great help as I dont wanna build the whole sdk, if I gonna do a small change in one component.)
Thanks
Under the hood, lunch uses make, so if some pieces of SDK do not change, they won't be rebuilt.
My speculation about your first question: rebuilding SDK was never considered a major task of lunch. It is most often used to port or mod the system and produce an installable system image, and receive the ADK as by-product. Later, people realized that often (with root access to the device) you can iterate over one component without need to reinstall the whole system image.

Embedded linux/android kernel development workflow

I was inspired by this previous question, but I didn't get the whole picture.
I'm developing a kernel and Android system for a new device which is based on a commercial chipset platform.
The chipset vendor provides me with a 'fixed kernel code zipped','android proprietary sources','modem sources'.
All these parts are paired, E.G., I can't change(to some extent) one of the platform elements(kernel,modem,system) without effecting other parts.
It's also quite limiting, what will happen if there is a need for a newer version? I can't be sure i'll get vendor's sources for it.
So here are some flows I made:
=============================================================
Workflow1: - I don't need newer version, i need release device now!
1.Download the latest public kernel the chipset provider and his system
2.Add my own drivers into the kernel
3.Add proprietary source into the build
4.compile -> everything is already configured
5.debug -> little
6.patch -> little
7.release -> fast
8.give an update? -> fail!? - i need new kernel/system from chipset vendor.
==================================================================
Workflow2: I dont need the vendor
1.Download a clean android system from google/cyanogem etc..
2.Add my drivers to the kernel
3.Get kernel patches from the chipset vendor's sources
3.Build device directory for proprietary files
4.configure/patch the proprietary to compile with the system -> hell
5.face alot of low level bugs -> hell
6.debug/patch
7.miss deadline and get fired
Any idea how this actually works in major mobile device manufacturers?
Thanks!
I'm working for one of chipset vendors. We provide reference kernel and reference android sources for our costumers. But we provide them not as "zipped source", but as git repository, so costumers can see all patches we put in kernel/AFS/etc and merge them into theirs repositories.
So, in your case I recommend you to ask your vendor for access to a git repository. If it is impossible, I reccomend you to use workflow 1. If you need a major update (like switch from GB to ICS), you'll need new vendor's sources anyway. Minor updates can be done on top of existing sources.

Android on Desktop tutorials/resources

I'm aware of the android-x86 project and as far as the end result (bootable live/install iso), I am looking to do the same thing. The difference is, I'm looking to do this with the ice cream sandwich branch from android master repo. Ice cream sandwich adds full support for x86 hardware and even sports a build target specifically for running the OS in virtualbox. So my question is, is anyone aware of any documentation for building and deploying to that target?
Just in case it's not clear, I'm not just using the android-x86 project because they haven't yet put up a build for anything later than android 3.
Okay so I was going to just delete my question because a few minutes after posting it, I found a tutorial! So, I figured I'd share this info here rather than just deleting, since that's a bit of a waste. Here is a link, plus an excerpt from the tutorial in case the link is ever lost:
http://ricston.com/blog/?p=1705
The second approach gives you direct access to the latest Android
code. However, it’s barely documented due to the fact that previously
you couldn’t build ‘out of the box’ an Android VDI (Virtual Disk
Image) with the AOSP. To build the Android VDI and install it in your
VM, follow these steps:
Get the Android source code from the AOSP site and follow the online
instructions to setup the environment.
When you are ready to build the project, execute the following command to set the environment variables for Make: “lunch vbox_x86-eng”.
Run “make installer_vdi” to
build the project. Make will build the project and produce a VDI named
“installer.vdi” located in “out/target/product/vbox_x86″. This VDI
contains Android plus its installer.
Create a Linux VM and add the
“installer.vdi” as an extra HD to the VM.
Start the VM and press “F12”
during bootup.
Select the HD which represents the “installer.vdi”.
Choose the first option, that is, “Android Install to /dev/sda from
/dev/sdb”.
When installation is complete, enter the command “reboot”.
After that, you should be able to launch Android from your VM.
I want to expand on this approach and end up producing a live CD rather than a VDI so I'm going to post this answer as a community wiki so it can be expanded by myself and others in the future.
Edit Nov 26/11
The above method of building right from the source alone is lacking features like proper keyboard and mouse support. Here is a link to an article (in Japanese but you can use google translate) of an individual who has compile the ICS sources with added in keyboard, mouse and network support. http://d.hatena.ne.jp/td2sk/20111125/1322192772
The precompiled VDI disk can be downloaded from here:
http://kie.nu/26G

Categories

Resources