[DEV TUT] Building Kernels and Android Sources - Sony Ericsson XPERIA X10 Mini

Dear Community,
Please read the following before starting on reading on.After lots of requests I decided its time to provide every oncoming developer with a short guide on how to start developing for our beloved Mimmi (most stuff applies also for Robyn or other Android devices).
I'd also like to get a few words passed on what actually in most cases developing is, so let's start with the basics:
There is different ways of developing there is people like Cyanogen Mod which provide you with a bunch of changes to the original Android source code which enables new features, adds hardware support or make things easier for specific device developers. However these people at Cyanogen are often not fully recognized so please make sure to thank these people as well. Besides that there are ports of similiar devices which will not be explained in this tutorial but also these developers usually put a lot of effort into their roms however since the source is already compiled changes are usually of a cosmetic nature. In this tutorial however you will find the basics on how to compile kernel or android from source in order to build your own changes into your own rom, which btw would have never been possible without the developers porting xrecovery or cwm to our devices so please give these people a big thumbs up as well after reading on.
What do I need/Environment set up
Most people have issues on setting up a the heart of your Developer Carreer, the Environment. What I strongly advise is to have at least a bit knowledge of the main usuage of Linux Distributions and also programming languages. Without these you will most likely fail at one stage or another to make a successful build.
So lets evaluate what you need :
Linux Distro (i.e. any Ubuntu should do well)
a VM or native Linux
quite a bit of Linux skills and programing skills
Time and a high tolerance of frustration
Sufficent RAM (at least 4 GB, more is advised otherwise use native Linux)
If you know how to install a native Linux Distribution you can probably skip this part, I will explain how to use a VM to fill the basic needs and keep your development area seperated from you most likely otherwise needed productive platform.
The following Steps are just keywords, if you want to develop you will need to inform yourself how to achieve all this yourself, there's lots of tutorials out there.
Step 1: Download a VM and a Linux Distro
Step 2: Install VM Software (i.e. VirtualBox or VMWare Server)
Step 3: Install the Linux Distro in VM (you'll need at least 6 GB Swap and 50 GB or More HD space to have enough room for experiments/seperate syncs/etc...)
Step 4: Figure out if you installed 32 Bit or 64 Bit (you'll need this later)
Step 5: Boot your new VM based Linux Distro
Step 6: Set up a Share Mount between your host and your VM
Step 7: download the Android Source/Cyanogen Source of your desire (i.e. : repo http://**** -b gingerbread) into a folder for you desire (the folder should represent your ROM's/Kernel name)
Building a Kernel
Building a Kernel is one of the easier parts considering the full source code is available for download. Sony Erricson Open Source Dev Website is providing fully funtional Kernel sources usually in the tar.gz format. Download the source code and extract it, or if you use a git based repository clone or checkout the project into a folder of your desire.
The next step, is not mandatory but advised to sync the entire Android repo/CyanogenRepo as the repo also provides the Cross Compiler toolchain which is needed to compile for your device.
Once everything is finished downloading you should check the following path in the Android repo : platform/linux-x86(orx64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/ this is the cross compiler we will use to build the kernel itself, its vital to have the compiler present, the version number maybe different though.
Lets start with the building process itself:
Code:
cd kernelfolder
cp arch/arm/configs/semc_mimmi_defconfig .config (the command maybe change to copy another default config file, it creates a file in the root of the kernel folder called ".config"
ARCH=arm make menuconfig (this will bring up the kernel configuration menu for arm devices)
In the Menu Config you can change/add features to the Kernel once you are done safe the kernel config. Now your Kernel is ready to be compiled:
Code:
ARCH=arm CROSS_COMPILE=/pathtoandroid_source/platform/linux-x86(x64)/prebuilt/toolchain/arm-eabi-4.4.3/bin/arm-eabi- make -j4
This will start a compile with 4 Jobs using the Architecture ARM and the Cross Compiler arm-eabi from the Android Source Repo. Once finished you'll find your Image in your kernel folder under arch/arm/boot/Image. Now you'll need to build your own ramdisk this is covered here at xda as well azuzu has also build a tool available to download.
Follow the instructions to create the kernel.sin which now can be flashed with Flashtool. Changes to Kernel source will now be available to your compiled Kernel. How to change the Kernel source is beyond this tutorial but programmers in C will have fun there.

Building Android from Source
Now lets get started with the more advanced part and the most frustrating part in the beginning. The easiest way to build for the mimmi would be to sync the Cyanogen Gingerbread source code. Which can be checked out using the repo binary (see tutorials on googles website also which packages for which architecture (x86 or x64) are addionally needed also the correct java version is important)
Now lets cut to the chase.
Code:
repo sync -u http://github.com/CyanogenMod/... -b gingerbread (or froyo or another branch you would like to check out)
once your repo is synced (you could also add "-j8" to enhance the speed of the repo command, it will take quite a while) you are almost ready to start. If you synced an AOSP source you will have the get your device and hardware libraries ready first. This means you will have to port i.e. the device project and hardware project (mimmi and msm7227-common folders from CM and also hardware folder from CM) to the AOSP source. It makes sense to port these to your AOSP source since they are the most complete so far. For Camera libraries you can sync from doixanhs repo the libcamera-5mp.
Now lets get a short overview over the Android source, it contains of various folders:
frameworks
device
vendor
hardware
platform
external
These are the most interesting, frameworks folder holds a bunch of android libraries and files which provide the functionality however often you will need to change a few things here and there since the mimmi is unique in its hardware. Everything you change will need to be approved with the following command:
Code:
make update-api
This will add all the functions, variables or anything else to the current-api.xml and ensure its available at build time.
The device folder holds device specific files, build-configs and so on. Lets look at some of the important files:
Code:
device/semc/mimmi/overlay/frameworks/base/res/res/values/config.xml/power.xml
The two xmls hold configurations of the build process which are device specific either LightSensorWarmupTime and so on the full list is in the root folder of frameworks/base/res/res/values/config.xml <-- any part you feel you need to change copy the lines from there and change in you device specific config.xml.
Now to another file:
Code:
device/semc/msm7227-common/BoardConfig.mk
This files olds the device sepecific configurations for the ARM, WLAN, etc.
Look at all the files in mimmi and msm7227-common and figure out what they do, google of course will guide you on that.
Also take a look in the:
Code:
vendor/cyanogen/products/
folder and find the mimmi config and get familiar with this as well. Nobody will be able to help unless you face specific issues. Developing is learning by doing and a lot of self teaching and the will to understand all of this yourself. We can't teach but you can learn. Specific questions however are usually proudly answered by most devs if they have already figured it out.
Lets start building now, first you'll need to get your lunch command to know which devices have makefiles (I always do it to be sure)
Code:
source build/envsetup.sh
This will now add all the known devices to your lunchcombo (the devices are usually definied in the vendorsetup.sh pointing to the makefiles)
Code:
lunch
Will get you the list of available devices and will wait for user input to select the device you want to build, choose the mimmi.
Code:
make -j4
This will start the building process with 4 jobs.
Now its time to get a coffee. Usually you will have a bunch of different issues on this part but the CM source is pretty good and you might be lucky there.
Now lets look at typicial errors:
Code:
symbol not found : means a variable in used in the code has not been defined, before its use this one is a tricky one
try to locate the source file and find the line the compiler is complaining about. Now check in the framework usually in
res/res/values or layout look for the type of the erros (String or array) and look in the corresponding xml if the variable
is present. Now look in vendor/cyanogen/overlay if your variable is also declared there and so on.
Code:
function not found/function of incompatible types : also a tricky one, you might sync a repo and made local changes to
a file and suddenly your functions another file calls are not present or have changed, find the differences between them and
think about how it has changed, maybe add the function again or maybe another function does the job now. you will need
to locate the changes compare them and you should be fine again
Code:
No Rule to make target: this one is usually due to a missing/incomplete Makefile you might need to add manually or
if you don't need it anyway the easiest would be to delete the not building folder
Once your source has finished compiling you will find you system image in:
Code:
out/products/mimmi/system/
As of now unfortunately its still missing a few files here and there. Compare ROMs and Compare what might needs to be added. However I advise not switch libraries around its best to use your own libraries. However sometimes you will face issues when doing this so start with the files created there and just add the recovery and ramdisk to your rom. Now observe via adb if everything is running. This will take time and add one missing lib after another one and reboot, after each (like grallocs or librils or fm libs and so). This is basically a debugging part of the job.
You will now add one by one more functionality, but keep in mind to use logcat to see what goes wrong, maybe some stuff can be changed in the source rather then randomly adding stuff.

also this one just in case.

Hey there c: As always, you come surprising everyone with your stuff haha Good job on this one, I think it is always good to have some tutorials from the people who build specifically for our Mimmi's
Before reading this, I wanted to get started on developing and I went to Android's official developers site, I did some steps, now I have the complete source of Android here (I use Ubuntu 10.04, the LTS version... Dunno if telling you that it is LTS ver. really matters, but just in case) andthe whole environment ready to build. Now, reading at this, I realize I don't have 4Gb of RAM on this "old" (2007..) notebook. Anyways, the thing is: I followed the steps listed here, but when I wrote this command-
Code:
$ make -j4
-the terminal started to execute files, or something... I'll add a screenshot at the end about this. It has been 3 days since that, and the terminal is still doing the same. I know developing requires a lot of patience, but... 3 days? Is this normal?? I have looked through the Internet for problems with this command, but no one seems to have talked about it.
Thanks for your time, work and effort for the community, we really appreciate it c: Bye!
Link to the Screenshot:
http://i259.photobucket.com/albums/hh313/link_4ever/Screenshot.png

The 'make -j4' uses 4 threads to compile everything, if your notebook does not have at least an hyperthreading-technology enabled CPU, well, that's to expect when building an entire OS, plus you don't have sufficient RAM, I do have 2GB and a DualCore CPU and it takes at least 1 hour to compile an average desktop kernel with that same command. I have not tried to compile android, but I think that it will take at least 4 hours to compile everything. Just my thought.

RozenTensai said:
The 'make -j4' uses 4 threads to compile everything, if your notebook does not have at least an hyperthreading-technology enabled CPU, well, that's to expect when building an entire OS, plus you don't have sufficient RAM, I do have 2GB and a DualCore CPU and it takes at least 1 hour to compile an average desktop kernel with that same command. I have not tried to compile android, but I think that it will take at least 4 hours to compile everything. Just my thought.
Click to expand...
Click to collapse
Thank you for your answer! Just ten minutes ago, the 'make' command finished ! And about my notebook, it is just like yours: 2Gb RAM and Dual-Core CPU, I'm not sure but I think it runs at 2,8 GHz. And also, like I said earlier, I know developing takes time. I know how slow processes can be, in fact, there were commands previously that took 1 hour or more to finish their tasks. 1 hour, 4 hours, it's ok but... 3 days? Isn't it a bit too much xd?? Now I'm afraid to turn off the computer because I don't want to compile that thing again hahaha

the "-j" option depends on the number of (virtual) cores you have.
get the number:
Code:
grep processor /proc/cpuinfo | wc -l
if you have native linux and like to work on the machine I recommend do lower the number at least -1 otherwise get a coffee and keep hands off the build process
b

make -j4, lol. Many people do not have. 4 cores on the processor

paul-xxx said:
make -j4, lol. Many people do not have. 4 cores on the processor
Click to expand...
Click to collapse
This parameter refers to threads instead of hardware cores

Sp4rrow said:
This parameter refers to threads instead of hardware cores
Click to expand...
Click to collapse
ok. probably a mistake. but still. I always use 2. it brought to me the best results

I use j6
And also j refers to jobs everybody may change to what they want. For kernel i build with j12.
If you know better like it seems you always do write it down.
Sent from my U20i using xda premium

I can't find any 2.1.1.A.0.6 Sources. Link to the sources you use slade?

http://developer.sonyericsson.com/cws/devworld/search-downloads/opensource?cc=gb&lc=en
should be:
x10_x10mini_X10minipro_x8_eclair_2.1.A.0.435.tar.gz

Stock Kernel with only CWM5 installed...
Slade i want some help from you. how can i embed CWM5 in the stock kernel without any other changes to it??
i want a stock kernel with nothing changed in it only CWM5 installed in it. how this can be done???
i forgot to say the most important thing!: Thank you very much for your work and effort Slade

I just came to the configuration menu of the kernel. i see there are options predefined for the mimmi, but how can i optimize it more, there are soooo many options, and to tell the truth i don't have a clue what they do

Related

[Q] Where to start?

Hello,
I want to compile Android from source. I want to just build a fully default Gingerbread that would run nice on my phone. I got the Android source, kernel source (kernel-2.6.32-U8800-Froyo) and now I don't know what to do next. I compiled the generic one already (lunch full-eng) and it ran fine on the emulator.
My most important question is, if I make it otapackage and flash it, would it start? If it doesn't, can I recover? What folders/files are essential if I make my own device for example in "device/huawei/u8800"
Also, where can I find a GOOD porting guide? I have found some that are old and not used anymore.
Some links
Start by going through source.android.com for the general basics if you havent already.
Also, even though Google removed the PDK (Platform Developer's Kit) from the site, it has been mirrored on kandroid here: http://www.kandroid.org/online-pdk/guide/index.html
The stuff in the the PDK, although inadequate, is still very important and explains how to create the necessary makefiles to add to the build, configuring for a new market, etc. etc.
Also,
watch these two videos over here. These were very helpful in my ROM development:
http://www.youtube.com/watch?v=1_H4AlQaNa0
http://www.youtube.com/watch?v=rFqELLB1Kk8
Learn to use github. It is helpful for you to keep track of your changes as well as incorporate others works into your own.
http://help.github.com/
Finally, Cyanogenmod repos are your BEST friend. Almost all major AOSP ROM devs owe some sort of thanks to those guys who have done so much. If you want to check out some of the code changes and patches that you want to incorporate look here on their gerrit:
review.cyanogenmod.com
If you want to look at the other changes that are actually in the cyanogenmod builds, best to look at their git repos here:
https://github.com/CyanogenMod
I am still learning right now while I create my ROM but your welcome to PM me if you have any questions
Glad someone helped. Now that ICS is available, I will build that instead. Now, I will follow the kandroid tutorial and add hardware_msm7x30 from cyanogenmod's repos. Then I'll make my own makefiles in the huawei/u8800 and I'll see if that works.
Also, some things I am not still clear. If I am not adding any recovery files, it shouldn't replace it, right? I want to make sure I can recover. However, my phone has a bootloader mode, which should still work, even if other's messed up. And the kernel, if I already have a compiled kernel for android 2.2, should it work for newer versions?
Thanks
Well AOSP as far as I know adds the stock recovery into the build so if you have a stock ROM, then you will lose your recovery (unless you change the source to skip the adding of recovery to otapackage).
Your bootloader should be fine. so you will theoretically be able to re-flash a custom recovery with fastboot as long as your bootloader is unlocked (assuming your phone is already rooted and has a custom rom, then it should be unlocked)
If you are using CM7 as base, then you dont have to worry about it as it is configured to NOT replace the recovery during the building and creating the otapackage.
The kernel should not be compatible as there were significant changes from Froyo and you should not use it. By the way, for now, work on the ROM first. Creating a custom kernel from scratch is hard work and should be left as the last task to do (assuming you know linux kernel development). Just use the stock pre-built kernel that comes with the source.
Also, according to Google:
Starting with IceCreamSandwich, the Android Open-Source Project can't be used from pure source code only, and requires additional hardware-related proprietary libraries to run, specifically for hardware graphics acceleration.
Click to expand...
Click to collapse
This means you need to find the correct hardware drivers first. Where to find that is beyond me. Check CM repos. It would be easy if everyone had a Nexus S/ Galaxy Nexus as the drivers are immediately available on source.android.com. Ah...well....
Personally, I am going to wait a few weeks before dabbling into ICS ROMs. Wait till CM7 comes out with a nightly for my nexus one and then rip the drivers from their ROM and use it for mine
I got ICS source and made the necessary Android.mk, AndroidProducts.mk, BoardConfig.mk and u8800(my device).mk, also vendorsetup.sh . Now, when I am trying to build it doesn't give me an error, more of a suggestion. It says to include "LOCAL_MODULE_TAGS := optional" in the hardware/msm7k/liblights/Android.mk. I added that, and tried again. Got that message again, but with other type /libril/Android.mk
About fastboot, I am not sure if my device has that. It can be turned on with volume up and down + power, but it boots to so called "pink screen". When I mount phone using usb to my pc, I can browse the recovery.img and other related stuff. If I have the otapackage, can I just take the recovery out from there or what should I modify in source? Add something to the makefiles?
Yeah I am pretty sure you should add the LOCAL_MODULE_TAGS to all of the relevant pre-built files. maybe they made the compiler less harsh in ICS when compared to the one for gingerbread. In gingerbread, it outright crashed the compile and asked you to add the tags.
According to Google engineers, here is the reason why they use these tags:
Short answer: lack of time.
The urgent concern was to prevent new modules from using a user tag
(implicitly or explicitly), and we took care of that. We haven't had
time to deal with the existing modules, there are over 1000 of those.
JBQ
Click to expand...
Click to collapse
By the way, I hope you have git setup and the changes you have made are being staged and commited to your repo in github. If you ever make a mistake that hardcore crashes your compile and you dont know what you did, git will be there for you to rollback the changes as well as keep track of everything you have done from commit to commit
As far as I know, CM repos dont have everything complete for a full build of ICS but I could be wrong.
So you are working with AOSP correct?
As for the fastboot every android phone should have a fastboot by default but I believe each phone has a slightly different version. I will post how my fastboot looks like in a bit.
As for the removal of recovery, there should be somewhere in either source, makefiles or argument for the otapackage command that should leave out the recovery when making update.zip. You could just remove the recovery from the update.zip, change the updater-script and repackage it but its not a clean solution and those changes should be done in a uniform manner so you dont repeat this step every time you do a new build.
Where exactly is it, I have yet to know. Still learning much of this myself.
I now completely understand what modes of turning on my phone has... First one is normal, second is recovery, third is update-bootloader(I can access all files with it too) and four being the fastboot. The custom recovery I have on has an issue that it wants to boot to charging mode when I type "adb reboot bootloader". I can get to fastboot with the custom ROM I have on right now though. I think I am safe if I have issues.
I edited msm7k Android.mk to remove libaudio and libgralloc (errors with those), and it compiles to the step where it says it has no rule to make kernel requied by boot.img. I have put into BoardConfig.mk the line TARGET_PREBUILT_KERNEL with my kernel. I don't understand, what's wrong now...
My goal is to simply get it booting up. I'll look into libraries and other later.
-e-
Got the kernel thing sorted out. Copied device.mk from tuna device and edited to fit my device. Also modified full_u8800.mk and made the call to inherit from device.mk. Compiling now and I think I got past that.
-e2-
Got it built successfully. Fastboot won't let it install, because it has no mount points. Added mount points and let's see...
Nice to see you are making progress.
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Blefish said:
Got it built, but the fastboot is kinda buggy in my device, maybe custom rom issue. I can't make otapackage, it says "no rule to make target otapackage". I have a possible fix, trying that later.
Otherwise, I read its possible to flash system.img from recovery via advanced restore, update.zip package or advanced flash_image, but I don't know. Will post results.
Sent from my u8800
-e-
Tried make otapackage again. It still says "make: *** No rule to make target `otapackage'. Stop.". Maybe some things are still missing, I don't know. adb flash_image command will always post -1 to me, update.zip didn't work, advanced restore is not for this. I have a compiled image and I can't wait to test it, but I can't flash it...
If nothing works I'll revert to stock ROM and try again.
Click to expand...
Click to collapse
If you successfully compiled, take the boot.img and system.img and package them into a zip and use dsixda's kitchen to make it flashable
Blefish, is it possible for you to share your device/vendor structures somewhere? I just finished setting up a build machine for ICS (using Cyanogenmod's repos in my case), and made a working full-eng image that seems to boot just fine in the emulator, so I'm seemingly all ready to hack around our device's specifics. But I would rather not do duplicate work, so I decided to ask
I'm also grabbing Huawei's new 2.6.35-based package to get the new kernel config, can't wait for them to release the actual sources for the update.
I'll share them on GitHib once I get a working build. I haven't got much time, and I changed to CM9 alpha now (repo branch ics). Since we got a 2.3 update, my first task is to port the latest clockworkmod recovery and then the ICS.
Compiling Android is long task and I'll do it in weekends, but the recovery should be available sometime, it shouldn't be hard to port that.
Oh yeah, look up stockwell's, dzo's and genokolar's github, they have done the device configuration. You can get much help from there. This weekend I'll propably test the build, I got otapackage command working now (it needed some things I can't write on mobile).
Sent from my U8800 using Tapatalk

[DEV][CM9][HOWTO] Build CM9 From Scratch!

It's time. As offered previously for the Nook Color and HP Touchpad...
A Build CM9-for-NookTablet Walkthrough
What is this?
This document provides instructions for developers to build a complete Cyanogenmod 9 update.zip for the Nook Tablet aka "acclaim" (and more theoretically the newer 512MB model, aka "elation") from source code. The instructions require a Linux computer and appropriate tools (discussed below).
It is important to emphasize that CM9 is a work in progress and if you try it you will be building/using something in mid-development. Things may break and/or not work at any time. Read below, the build instructions, and the relevant licenses for additional info and disclaimers.
Hopefully, for those developers who are interested and willing to take the risks, this can be a fun and educational experiment. And hopefully more developers will help chrmhoffman, kuzma30, mik_os, and others improve CM and the 3.0 kernel.
So does this build use the new, experimental 3.0 kernel then?
Update: At first, I mentioned that 2.6.35 was also supported, but apparently this will require additional files that aren't currently installed. So for now, yes, it uses the 3.0 kernel, which may not be compatible with the newer 512MB NTs. Although it is not confirmed one way or the other, as it has not been tested on these devices.
The configuration uses the experimental 3.0 kernel, which is built on-the-fly from the latest source code.
Unless you really want to take some risks, if you have a newer-model 8GB/512MB Nook Tablet (aka "elation"), the 3.0 kernel build is not for you...yet! It may boot, it may not. It has not been tested by any of the developers with that device, and as of this writing there are known kernel issues with the 512MB. (So actually, this is a good opportunity for developers to try it and contribute.) The 3.0 kernel development thread has more on this.
Any further discussion below assumes the 3.0 configuration, as the 2.6.35 branch isn't as up-to-date and isn't really being maintained. 3.0 is the future!
These instructions are for Linux. How do I build on Windows/Mac/etc?
If you have Mac or Windows or something else, you may consider installing a virtual machine such VirtualBox (which is free). Then run Linux, say a Ubuntu distribution, as a guest from your host computer. This allows you to "sandbox" your development environment, and gives an opportunity to learn about Linux with actual hands-on experience, all without reformatting your computer...
CM9 can also be built on Mac natively, either in Snow Leopard or Lion. Instructions for building (CM7) on a Mac can be found on the CyanogenMod wiki.
A few modifications need to be made to those instructions for CM9 & Lion, but such instructions aren't hard to find.
Will my build actually be usable?
CM9 (and the acclaim port) is in active development, and when you do a build from the latest source, you are using a bleeding-edge build of whatever happens to be in the repositories at the time. There is no guarantee it will work in any capacity. It may actually cause terrible damage. So only try at your own risk, and assume responsibility for your actions. If you find a bug, help fix it.
It is critical that you understand the risks before trying this and fully back up your system before trying any build. It is equally important to have a bootable SD standing by so that you can restore your device to a known good version if something goes terribly wrong, which may actually happen. Hopelessly staring at a non-booting device is never fun. There are other threads about recovering hosed acclaim systems, so I will leave you to finding and understanding them and preparing yourself for solving such problems. You should always assume the worst will happen, so be prepared.
Speaking personally, I don't have either model of NT and have never run CM9 on one, so can not attest to its usability per se. You should consider this a work in progress full-of-bugs until told otherwise.
Which bootloader is this using?
Cyanoboot, based on u-boot. The full github repo w/history (rather than raw files) is now available as well. Special credit to bauwks for fixing the locked bootloader design flaw.
Will this build result in a working update.zip suitable for use with ClockWorkMod recovery?
The build process has been modified to generate a fully flashable update.zip, but, as, with everything else, nothing is guaranteed.
Does this create a build for SD Card or for EMMC (internal storage)?
EMMC.
I'm stuck! I've been at it for hours. Something isn't working. Where can I get help?
If you have never built an operating system before-- this may be a good way to learn, provided you accept the risks and consequences of trying. This and other forum threads may be a good place to look for help. Also try IRC.
You are also able to leave comments in the walkthrough document itself. If you have a tip that might help others, post it there. If I get a chance, I'll take the best of them and incorporate it into the doc.
Does this build ClockworkMod recovery too?
It should. Check the $OUT directory for two files-- recovery.img and recovery.img.sdcard. The recovery.img file is (hopefully) flashable via fastboot:
fastboot flash recovery recovery.img
The recovery.img.sdcard can be renamed to recovery.img and put on your sdcard.
Can I build twrp2 instead of ClockWorkMod?
TWRP2, in case you're not familiar with it, is an alternative recovery image created by Team Win, particularly user dees_troy. It can be used for flashing update.zip files and making/restoring backups, among other things.st
The 3.0 build configuration currently contains the needed settings for a twrp build. You will just need to replace the ~/android/system/bootable/recovery repo with twrp's source code. You can do this by adding the following lines to your local_manifest.xml file:
<remove-project name="CyanogenMod/android_bootable_recovery"/>
<project name="TeamWin/Team-Win-Recovery-Project" path="bootable/recovery" remote="gh" revision="master" />
You can then repo sync (per the instructions) and then do this command to rebuild the recovery using twrp2.
mka recoveryimage
The recovery.img and recovery.img.sdcard files in $OUT should now contain the latest twrp2. (If it doesn't, try clearing out the recovery-related files in $OUT, including $OUT/obj/RECOVERY_EXECUTABLES)
Please direct twrp2-related questions and solutions to the twrp2 thread, not here.
Who do I thank?
Thanks to chrmhoffmann, mik_os, kuzma30, cyanogen, arcee, nemith, Texas Instruments, Barnes & Noble, and all the other devs, testers, and contributors, of which there are many. And special thank to bauwks, who made this all possible.
For this walkthrough in particular, big thanks to chrmhoffmann as well as eyeballer for testing. Everyone-- go find a thread by these people and thank them.
Who do I blame?
Yourself. Only yourself.
To whom do I donate?
Not to me. You can donate to any of the above if you feel like it. I do suggest considering a donation to the Electronic Frontier Foundation, who among other noble activities are fighting to keep "jailbreaking" and its Android phone and tablet equivalents legal. Your Android devices are full-fledged computers. Don't let corporate or government special interests take away the right to mess with your own possessions as you wish.
Finally, good luck. We're all counting on you. If and when you have problems, post them, and hopefully others will help find a solution.
Developers are needed. Enquire within.
-ft
(twitter)
-----
How To Build CM9 for Nook Tablet From Source
(Google Doc... or is it Google Drive now?)
And one more thing...
If I think of something to add, I'll put it here.
Good stuffs. I'll give it a try later in the week. I have everything set up. Going to be fun testing.
Im planning on doing this too. Thanks for making a guide, although I'll probably be in the IRC within 5 minutes of starting with questions
Sent from my Team A CM9 Alpha 0.03 Nook Tablet
Thank you very much for putting this together!
I am testing on an 8GB nook.
I can verify that the cwm and twrp2 recovery images boot with the 3.0 kernel, however CM9 fails to boot, it hangs on a blank screen with the backlight on and eventually just reboots. I am not able to get it to connect via usb to print logcat so I don't think it is getting very far.
Do you happen to have any instructions for tapping into the serial on these devices to see what is going on?
Also, with the new cwm it will not mount the sdcard through the menu. If I open a shell within cwm recovery I can mount it fine, except it is read-only.
In case it is useful, here is a dmesg from cwm:
http://pastebin.com/0fkyuSwe
arcon2600 said:
Also, with the new cwm it will not mount the sdcard through the menu. If I open a shell within cwm recovery I can mount it fine, except it is read-only.
In case it is useful, here is a dmesg from cwm:
http://pastebin.com/0fkyuSwe
Click to expand...
Click to collapse
Ah, this is very interesting! It's similar behavior to twrp.. a mounting issue with sdcard... wonder if this means the kernel is somehow not letting it mount, or if the problem is with recovery.fstab...
New patch, there shouldn't be a gpio_wp pin assigned to begin with...
Also, this is tested on my 8GB, I don't have a 16GB to test with.
diff --git a/arch/arm/mach-omap2/board-nooktablet.c b/arch/arm/mach-omap2/board-nooktablet.c
index de38b5c..a10dd93 100644
--- a/arch/arm/mach-omap2/board-nooktablet.c
+++ b/arch/arm/mach-omap2/board-nooktablet.c
@@ -684,7 +684,7 @@ static struct omap2_hsmmc_info mmc[] = {
.mmc = 1,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA | MMC_CAP_1_8V_DDR,
// .gpio_cd = -EINVAL,
- .gpio_wp = 4,
+ .gpio_wp = -EINVAL,
.nonremovable = false,
// .no_off_init = true,
#ifdef CONFIG_PM_RUNTIME
Build environment ready but cannot use repo command
HI! i would love to build a zip with the new kernel but i cannot use the repo command in the terminal in Linux Mint latest build. I have downloaded Android SDK and all the required build libraries and set up all the directories. i have the NTsparkkernel folder in the android directory. Could anyone offer some advice on how to apt-get (the REPO module) so I can build the zip. Thank you for your time. Bruce
about repo
C64assembly said:
HI! i would love to build a zip with the new kernel but i cannot use the repo command in the terminal in Linux Mint latest build. I have downloaded Android SDK and all the required build libraries and set up all the directories. i have the NTsparkkernel folder in the android directory. Could anyone offer some advice on how to apt-get (the REPO module) so I can build the zip. Thank you for your time. Bruce
Click to expand...
Click to collapse
The repo command is actually something you get from Google. It's not in the apt-get repositories.
To install the repo script:
mkdir -p ~/bin
curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
chmod a+x ~/bin/repo
The repo binary will be in ~/bin and you can add this to your path if you like.
Confirmed by chrmhoffmann and committed. Thank you!
Thank you for this guide. I've compiled stuff before, but built my first Android from source last night. Although the build from that time has random reboots (the nature of the beast).
I'll be building quite a bit I think
Damn see I'm just porting right now I wanna build from source but my PC isn't Linux friendly yet I'm waiting on a tb internal so I can set up and learn this but it just looks so complicated and idk why. I feel once I learn it probably be easy as hell. Thanks Fattire
__________________________________________________
Sent from my SPH-L700-GNEX-using Tapatalk 2
Danrarbc said:
Thank you for this guide. I've compiled stuff before, but built my first Android from source last night. Although the build from that time has random reboots (the nature of the beast).
I'll be building quite a bit I think
Click to expand...
Click to collapse
Hey congrats and welcome to the club!
Cannot Make the bacon...
Hey Fattire! Thank you for your guide. I was able to finally download the source for cm9 and add the 3.0 kernel repository. I have everything in one folder. I am new to Linux and had to add a Path command to get Repo Sync to work correctly. Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
I have to issue PATH=~/bin:$PATH every time I repo sync.
C64assembly said:
Hey Fattire! Thank you for your guide. I was able to finally download the source for cm9 and add the 3.0 kernel repository. I have everything in one folder. I am new to Linux and had to add a Path command to get Repo Sync to work correctly. Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
Click to expand...
Click to collapse
I use Ubuntu here I started with 10.04 LTS since it was the the build used and supported by Googles build instructions. Yous should still be able to do it though.
Did you initialize the build environment using ". build/envsetup.sh" at android/system (it looks like is the base of your source from your post)
Yes. Thank you for your advice KeithN. I am going to start from scratch. I might just put Ubuntu 10.04 on my comp tonight if I cannot get it to build properly.
I'm going for Ubuntu 12.04 command-line. If that doesn't go well, I'll go for 10.04 as well.
I built mine on 12.04 (Xubuntu, but that doesn't matter so much).
I added a debian sqeeze apt repository to get sun-java6-jdk, then used -f install when it complained because one of it's dependencies exists in Ubuntu but not that same version #. Commented out the repository after it installed so I don't get more debian packages on accident. For everything else I think it was just following the guide as-is.
C64assembly said:
I am new to Linux and had to add a Path command to get Repo Sync to work correctly.
Click to expand...
Click to collapse
Yes, I had recommended doing that. The PATH=$PATH:~/bin command will ensure that no matter what directory you type "repo", it'll know where to find the file.
C64assembly said:
Once I got the Repos I ran into another problem trying to issue command cd ~/android/system/vendor/cm , then enter “./get-prebuilts”. The Make Bacon and or Croot <enter> brunch acclaim does nothing either. It seems I am missing somthing here. Maybe a different distro of Linux besides Mint would work better for me... getting close to building (i hope). Thanks!
I have to issue PATH=~/bin:$PATH every time I repo sync.
Click to expand...
Click to collapse
Instead of entering it every time, you can add that PATH statement so that it's automatically invoked when you open a new Terminal window.
Just add the line to an "invisible" file (it's invisible because it starts with a period (.) and won't show up in a normal listing) called .bashrc in ~/.bashrc (the ~ is a shortcut for your home directory, or /home/youraccountname/). The hidden .bashrc file will probably exist already. Just add the statement to the end.
Keithn said:
Did you initialize the build environment using ". build/envsetup.sh" at android/system (it looks like is the base of your source from your post)
Click to expand...
Click to collapse
This is right. Try this:
$ cd ~/android/system
$ . build/envsetup.sh
(the $ represents the prompt and should not be typed. For the second command, it's literally a period followed by a space followed by build/envsetup.sh)
I am using the latest 12.04 ubuntu, fwiw.
I know this is for CM9, but any help would be appreciated (trying aokp). I had issues with the packaging of the .zip it looks like. I was able to build for my fascinate so I know the source will build. Any suggestions?
Output

[Q] Making android kernel compatible with ubuntu?

Hello.
I noticed that kernels for ubuntu seem a bit old. I was thinking that maybe someone could modify cm10(or 3.0.21) kernel to support ubuntu/teach me how to add ubuntu support to android kernel. I did a bit googling, but results were filled with those loop ubuntus, not native.
I am also thankful if someone can point me to right direction.
(Trevd, i am counting on you )
Sent from my GT-I9100 using xda app-developers app
julle131 said:
Hello.
I noticed that kernels for ubuntu seem a bit old. I was thinking that maybe someone could modify cm10(or 3.0.21) kernel to support ubuntu/teach me how to add ubuntu support to android kernel. I did a bit googling, but results were filled with those loop ubuntus, not native.
I am also thankful if someone can point me to right direction.
(Trevd, i am counting on you )
Sent from my GT-I9100 using xda app-developers app
Click to expand...
Click to collapse
Well as seeing as you ask so nicely, I'm far from an expert however especially in the ways of ubuntu kernels, A1Pha got the original ubuntu image going but ubuntu have done an official arm release now so that changes things ( probably ) I can only point you in the direction of more, hopefully better resources.
The Blaze Tablet seems to have have been the Development Platform for the G9 so you'll probably get some purchase from following that route.
Here's some links for you.
http://omappedia.org/wiki/Source_Trees
http://omappedia.org/wiki/OMAP_Ubuntu_Main
My days on the G9 could well be numbered, I foolishly overwrote the bootlloader in one of my more Laissez-faire moments. meh! That's what I get for having a caliver approach to consumer electronics.
trevd said:
Well as seeing as you ask so nicely, I'm far from an expert however especially in the ways of ubuntu kernels, A1Pha got the original ubuntu image going but ubuntu have done an official arm release now so that changes things ( probably ) I can only point you in the direction of more, hopefully better resources.
The Blaze Tablet seems to have have been the Development Platform for the G9 so you'll probably get some purchase from following that route.
Here's some links for you.
http://omappedia.org/wiki/Source_Trees
http://omappedia.org/wiki/OMAP_Ubuntu_Main
My days on the G9 could well be numbered, I foolishly overwrote the bootlloader in one of my more Laissez-faire moments. meh! That's what I get for having a caliver approach to consumer electronics.
Click to expand...
Click to collapse
Thanks for answering. I'm out of thanks for today, so i press that button when i have more.
Now to business.
After doing some research, and asking few questions on #ubuntu-arm, this seems a bit hard project because there are no sources. There is no source for CM10 kernel(Or i can't read the github) nor Ubuntu kernel, so i can't just apply tweaks of them both to archos 3.0.8+ kernel. A way to unpack the zimage from ubuntu kernel and cm10 kernel would help, but atleast the script i tried couldn't unpack the zimage of ubuntu. Lets see what i figure out next.
julle131 said:
After doing some research, and asking few questions on #ubuntu-arm, this seems a bit hard project because there are no sources. There is no source for CM10 kernel(Or i can't read the github) nor Ubuntu kernel, so i can't just apply tweaks of them both to archos 3.0.8+ kernel. A way to unpack the zimage from ubuntu kernel and cm10 kernel would help, but atleast the script i tried couldn't unpack the zimage of ubuntu. Lets see what i figure out next.
Click to expand...
Click to collapse
Not sure what you mean by the CM10 Kernel, I don't think CM have any different settings from what is required by JellyBean itself. Plus the Kernel we originally used for the Archos CM10 is an ICS kernel with IPV6 Mangling adding, we got away with that because the Init.rc used to boot the Rom is a mashed up ICS Version. After thinking about it let me add the bit of knowledge I think I do know.
The kernels on arm platforms, to paraphrase Linus Tovalds was a complete mess, something which Linaro are working hard to fix, and are unique to the SOC vendor.
You need to get the Archos specific sources which are located on GItorious @ git://gitorious.org/archos/archos-gpl-gen9-kernel-ics.git, clone the 3.0.21 branch, in the directory there's a file called linux.config.g9 ( or something similar ). that's the config file. I just copy that to .config, change the settings I need to (if any) compile. That should setup an archos kernel which should run android
Code:
git clone git://gitorious.org/archos/archos-gpl-gen9-kernel-ics.git -b linux-icc-3.0.21
cp linux.config.g9 .config
make menuconfig
make -j8
Like I say I was thinking about it and the main difference between a standard kernel and android kernels is the binder, the switch class support and the log driver ( this is things I've noticed when building an android x86 Kernel )
When doing menuconfig the Android Driver settings are found in devices/staging/android, I suppose a place to start is to turn them off then switch on SYSV IPC ( i think that's in genral kernel settings ), from what I understand this is the sysv binder and should create a node at /dev/binder, standard kernel switch class support is set in Device Drivers ( Switch Class Support ).
I'm not sure about logging , It basically breaks down like this. The Android Kernel has a specific logging driver this creates device node at /dev/log/main /dev/log/system etc , Ubunutu ( on x86 at least ) has a single log device node which is created at /dev/log, I don't know weather this is something created by the kernel or something created in userspace by syslogd or something similar. I also don't know whether the Android Logs are compatible with ubuntu, or the android binder for that matter. I'll try and boot my x86 ubuntu with my Android Kernel later on , I suspect It won't work but speculation is one thing, knowing for sure is better
With regards to unpacking the zImage, I'll say this , Not all zImages are created equal , I notice you are using a samsung mobile ( galaxy s, if I'm not mistaken ) , so you're probably using the samsung zImage as a frame of reference... How I understand it Samsung pack the initramfs into the zImage, similar, but not same to the way android AOSP pack a boot.img. Samsung however do this in kernel itself, this is why Samsung zImage a) can be unpacked and b) require different tools than the standard tools used for unpacking boot images which work on just about every other device ( expect Archos of course ) . So you generally don't unpack zImage because It's just a binary blob that contains all the kernel functions, this is in the assembly language of whatever architecture you built your kernel for.
Given all that info you should now be able to build a working archos android kernel ( I assume you using linux etc and your not stupid ) , You now need the Ubuntu side of things..... Have you asked in the Archos G9 Ubuntu Development thread, they may be able to shed light on the changes to the config you need to make or alternativaly you could download the Ubuntu for Arm OMAP Image from https://wiki.ubuntu.com/ARM/OMAP , unpack/mount it and see if there is the kernel .config file, It is normally packaged somehow with the distro for example x86 lubuntu has .configs in /lib/modules/3.5.0-19-generic/build/.config, the arm distro may have something similar. Then it's a case of see what configuration options are different, You can't just copy the config whole sale however because there are Archos Specific board settings in the Archos Kernel. Failing that the kernel sources will be somewhere as it is a legal requirement under the GPL and Cannonical are compliant, at least I've not read anywhere to the contrary.
This is just really how I understand it at the minute, Some of it could be inaccurate or just plain BS but hopefully should give you something to run with, there is a bit of a barrier to entry on the whole subject kernels/android kernels as the information is in little pieces all over the internet, when I was first getting to grips with it, it did feel like a bit a of treasure hunt for knowledge. Also knowing the Keywords to search for in the first place can be difficult It sounds quite an interesting challenge, shame about my brick!!
If you want to understand more about the kernel generally ( and lets face it, who doesn't ) then Linux Kernel in a nutshell ( http://www.kroah.com/lkn/ ) is a free e-book written by one of the kernel maintainers a should be a useful reference.
JUST IN CASE: Don't forget prefixing a filename with a fullstop (.) makes that file hidden and won't display in normal file listings, using ls -a to display all file in a directory
The CM10 kernel i was refering to is the CM10 in dev section. I thought there were other "hacks" than just a IPv6 addon, and that's why i counsidered it as a totally diferent kernel.
I think i need to download the kernel source as soons as i get to my laptop then. I have some experience on it, because i have made a few builds of B2G, but that was mainly just: download source, choose the device and build.
For the differences, that is what i consider as the hardest part. Merging them and then getting the kernel to build might take some time. Luckily I have plenty of time.
For the zImage, I was trying to unpack the ubuntu zImage one, because I'm working on archos device . Unpacking Galaxy S2 kernel wouldn't make any sense. atleast to me . I was trying to use a general unpacker, but it didn't work, just as you wrote.
For the OS & Knowledge, i am using linux indeed. Backbox, which is based on ubuntu 11.04 to be precise. I didn't even think about unpacking the IMG file... Maybe i am stupid . I think i am able to mount it to folder, so it is easy to explore.
I think I know the basics, and folders starting with . is part of them
Lets see what happens the next time i pick my laptop, boot it and start fooling around :good:.
Edit: Well, after the menuconfig, i can't fand anything related to ipv6 mangling. There was a file on the root of cloned folder called linux.config, but it was the default config for kernel, not archos specific.
julle131 said:
The CM10 kernel i was refering to is the CM10 in dev section. I thought there were other "hacks" than just a IPv6 addon, and that's why i counsidered it as a totally diferent kernel.
I think i need to download the kernel source as soons as i get to my laptop then. I have some experience on it, because i have made a few builds of B2G, but that was mainly just: download source, choose the device and build.
For the differences, that is what i consider as the hardest part. Merging them and then getting the kernel to build might take some time. Luckily I have plenty of time.
For the zImage, I was trying to unpack the ubuntu zImage one, because I'm working on archos device . Unpacking Galaxy S2 kernel wouldn't make any sense. atleast to me . I was trying to use a general unpacker, but it didn't work, just as you wrote.
For the OS & Knowledge, i am using linux indeed. Backbox, which is based on ubuntu 11.04 to be precise. I didn't even think about unpacking the IMG file... Maybe i am stupid . I think i am able to mount it to folder, so it is easy to explore.
I think I know the basics, and folders starting with . is part of them
Lets see what happens the next time i pick my laptop, boot it and start fooling around :good:.
Click to expand...
Click to collapse
The 3.0.31 Kernel started by Quallenauge in the dev section is an Highly Expirimental effort. this was started before Archos released the 3.0.21 Kernel with their 4.0.2x roms which covered what was trying to be achieved by this development, It's best left alone unless you really want to get you're hands dirty with device bring up code, There's a version on my github which I think boots the G9A101's as well as the 80's......... anyway
You shouldn't have to do any merging of code, more a case of selecting the right options in the config, Thinking back, I've have booted Ubuntu using mainline kernel sources from kernel.org that I built myself so that kinda of suggests there's nothing special about ubuntu's kernels per se' .
Your main problem won't be with building , more booting, It should compile fine but I wouldn't be surprised to be looking at a blank screen then your problem is monitoring the output....There's an option in the archos config to get early debug output over USB, I think there's some modification you need to make to the USB Cable, Quallenauge knows about that, he did it , I was ghetto and used adb for my debugging. which can be probably made to work when booting ubuntu but I'd go the correct route , I just have my wierd ways of doing things.
Another thing that spring to mind with android "specialisms". Android runs /init in the root directory ubuntu normally likes /sbin/init. This is something that is specified again in the kernel config using the kernel cmdline option , just something to be aware of... If anything else springs to mind I'll let you know.
So I suppose as you say, Just fool around and see what happens. :good:
I think I know the basics, and folders starting with . is part of them
Click to expand...
Click to collapse
Just Checking LOL.
trevd said:
The 3.0.31 Kernel started by Quallenauge in the dev section is an Highly Expirimental effort. this was started before Archos released the 3.0.21 Kernel with their 4.0.2x roms which covered what was trying to be achieved by this development, It's best left alone unless you really want to get you're hands dirty with device bring up code, There's a version on my github which I think boots the G9A101's as well as the 80's......... anyway
You shouldn't have to do any merging of code, more a case of selecting the right options in the config, Thinking back, I've have booted Ubuntu using mainline kernel sources from kernel.org that I built myself so that kinda of suggests there's nothing special about ubuntu's kernels per se' .
Your main problem won't be with building , more booting, It should compile fine but I wouldn't be surprised to be looking at a blank screen then your problem is monitoring the output....There's an option in the archos config to get early debug output over USB, I think there's some modification you need to make to the USB Cable, Quallenauge knows about that, he did it , I was ghetto and used adb for my debugging. which can be probably made to work when booting ubuntu but I'd go the correct route , I just have my wierd ways of doing things.
Another thing that spring to mind with android "specialisms". Android runs /init in the root directory ubuntu normally likes /sbin/init. This is something that is specified again in the kernel config using the kernel cmdline option , just something to be aware of... If anything else springs to mind I'll let you know.
So I suppose as you say, Just fool around and see what happens. :good:
Just Checking LOL.
Click to expand...
Click to collapse
At the moment i'm trying to find the archos config file. there is a defcon file, which looks like a config file in arch/arm/configs called android_archos_defcon. It sounds correct. Next thing for me to do is to find the right place to put it. I guess the root of the project is correct, and rename it to .config and linux.config. After building I need to test it. [email protected] or 4.0.26 root will suffice, right? I also need to figure out if there is a way to force adb on through kernel. And the IPv6 Mangling is nowhere to be found
julle131 said:
At the moment i'm trying to find the archos config file. there is a defcon file, which looks like a config file in arch/arm/configs called android_archos_defcon. It sounds correct. Next thing for me to do is to find the right place to put it. I guess the root of the project is correct, and rename it to .config and linux.config. After building I need to test it. [email protected] or 4.0.26 root will suffice, right? I also need to figure out if there is a way to force adb on through kernel. And the IPv6 Mangling is nowhere to be found
Click to expand...
Click to collapse
The config file " linux.config.g9" should be in the root kernel directory, if it's not there then your on the wrong branch and you need to checkout the 3.0.21 branch explicitly using
Code:
git checkout linux-ics-3.0.21
If your using ICS builds to check with, which I probably recommend then don't worry about IPV6 managling , I don't think It's named that exactly but something like that!, For reference , I've just had a check the option is "Networking support/Networking options/Network packet filtering framework (Netfilter)/IPv6: Netfilter Configuration /Packet Managling"
You have to look pretty deep on some of these settings
As a test. Boot with a normal kernel configure your android debug options , then swap the kernels out , that should give you adb while booting, when I've tried to force adb on an uncofigured rom it got a bit confused with itself
If your struggling a bit with git, http://gitimmersion.com/ has a great tutorial you can step through in about 10 minutes to get the basics and get it configured a bit better
---------- Post added at 09:31 PM ---------- Previous post was at 09:20 PM ----------
EDIT: Make sure you building for arm as well
Code:
$ export ARCH=arm
$ export SUBARCH=arm
$ export CROSS_COMPILE=arm-eabi-
Reference: http://source.android.com/source/building-kernels.html
Huuuh i'm late... most had been pointed out already.
Just to add this...
As you might know Android is put on top of a Linux base system more or less.
In most cases a kernel built for Android will suit most linux distributions as well.
Trevd already highlighted the main aspects.
The other way round is more evil... unmodified linux kernel (or a kernel set up to run well with Ubuntu) will refuse to boot up an Android system.
Some addon's on the default config may be nice though, depends on how the whole rootfs stuff is arranged in the end and if your system heavily depends on udev and stuff.
Keep track of the startup scripts at /etc/init.d.
It's good to have an extensive look at the /etc directory of your distribution image... to much to point at here.
The kernel may handle to boot into a lot of different scenarios.
On the Archos tablets initramfs plays an important role.
You may even tweak this jumpboard and locate your final rootfs on an USB stick if you like.
It's all about handling mounts, chroot and similar during start up.
There are limits on the Archos with stock loader though, because you might need to influence the kernel command line at a certain point.
I'm aware that this is not very specific but there are so many ways to set things up.
Just follow the useful links trevd gave already... these are good starting points :fingers-crossed:
...and just to add this:
I don't speak of fine tune the system in the end. This is another story and sometimes very hard stuff, where you may need to reverse engineer some proprietary libs or executables.
Best regards,
scholbert
Well, I have now built my first kernel... And it was 3.0.8+... I think I downloaded wrong source . I have ipv6 mangling enabled on it, so I should try it with CM10 now. I think I should search the 3.0.21 source, and download it.
Edit: Well, my 3.0.8+ Kernel image can boot CM10, AOKP and 4.0.7 roms... Now i have to figure out why i downloaded 3.0.8+ kernel and not 3.0.21 kernel. Maybe i had wrong branch.
Edit:Yep, wrong branch. I did realize when i downloaded the srce that it informed that the branch does not exists. i had icc instead of ics
Do you have any tips where i can find info about kernel modifications, like adding governors? I tried adding few, but all i got was bunch of errors. I propably forgot something.
Sent from my GT-I9100 using xda app-developers app
mer
Still working on this? I have been using Mer kernels with Ubuntu and they seem to be working fine.
Archos Gen9 Mer Adaptation Kernel --> http://gitorious.org/archos-gen9-mer-adaptation-kernel/
Archos Gen9 Mer Adaptation Kernel ICS --> https://gitorious.org/archos-gen9-mer-adaptation-kernel/archos-gen9-mer-adaptation-kernel-ics
I am using the 3.08 kernel from a Plasma Active distribution. --> http://share.basyskom.com/plasma-active/archos_gen9.html
Just mount the data partion in linux and convert it to ext4, write the linux image to it. Then cp the files from mer /boot /lib/modules to new rom, modules file in etc to load your modules, modify fstab, cp mtev.so to /usr/lib/xorg/modules/input, change or add a few other files.
/etc
modules
Code:
cypress_tma340
tr16c0_i2c
hso
compat
cfg80211
mac80211
wl12xx
wl12xx_sdio
cpt_i2c_tsp
pixcir_i2c_tsp
hci_uart
fstab
Code:
/swap none swap sw 0 0
/dev/mmcblk0p2 /media/system ext4 ro,noauto,users,uid=1000,gid=0,noatime 0 0
/dev/mmcblk0p4 /media/data ext4 ro,noauto,users,uid=1000,gid=0,noatime 0 0
none /proc proc rw,relatime,noexec,nosuid,nodev 0 0
none /sys sysfs rw,relatime,noexec,nosuid,nodev 0 0
none /dev devtmpfs rw,mode=0755 0 0
none /dev/pts devpts rw,relatime,gid=5,mode=0620,ptmxmode=0666 0 0
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
binfmt_misc /proc/sys/fs/binfmt_misc rw,noexec,nosuid,nodev 0 0
none /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
none /dev/shm tmpfs nodev,nosuid,noexec 0 0
none /dev/bus/usb usbdevfs defaults 0 0
none /sys/kernel/security securityfs (rw) 0 0
/etc/udev/rules.d
70-persistent-net.rules
Code:
# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:28:90:64:31", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
# USB device 0x9710:0x7830 (usb)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:13:3b:04:02:6c", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
70-touchscreen.rules
Code:
KERNEL=="event*", SUBSYSTEM=="input", SUBSYSTEMS=="input", ATTRS{name}=="cypress-tma340", SYMLINK="input/touchscreen"
/usr/share/X11/xorg.conf.d
Add to the end of 10-evdev.conf, cypress-tma340 is the touchscreen on my G9.
Code:
Section "InputClass"
Identifier "Archos Touchscreen"
MatchProduct "cypress-tma340"
Option "Ignore" "off"
Option "CorePointer" "on"
Driver "mtev""
EndSection
openSUSE --> http://en.opensuse.org/openSUSE:eek:penSUSE_on_your_ARM_board
Ubuntu --> https://wiki.ubuntu.com/ARM/OMAP
Kubuntu 12.10 --> http://cdimage.ubuntu.com/kubuntu/releases/12.10/release/kubuntu-12.10-desktop-armhf+omap4.img
Please i am using Backbox Linux Distribution (Dual booted ) wit my windows 7....... now i wish to use a dail up connection on my modem !! PLEASE HOW DO I GO ABOUT IT ...
Sent from my L3 using XDA Free mobile app

[Q] How would I compile a custom kernel with custom ROM

I just went through the process of compiling a custom ROM and they used a stock kernel. I would like to incorporate a different kernel when I compile and instead of the stock. I know I could compile them separately and have them flash together but I want one zip to flash. Just would like to go through the process to learn.
Any help on how to do this or what I have to do when compiling?'
Thanks.
MAXGEN said:
I just went through the process of compiling a custom ROM and they used a stock kernel. I would like to incorporate a different kernel when I compile and instead of the stock. I know I could compile them separately and have them flash together but I want one zip to flash. Just would like to go through the process to learn.
Any help on how to do this or what I have to do when compiling?'
Thanks.
Click to expand...
Click to collapse
One of the easiest ways of doing this would be to take the boot.img thats contains the custom kernel you want and deleting the stock boot.img containing the stock kernel in your .zip file and replacing that with the boot.img of the custom kernel. Essentially you are just swapping the boot.img file in the .zip files with the one containing the custom kernel rather then the stock kernel. Let me know if you need me to explain things further or have any other questions I'll be happy to help you out.
shimp208 said:
One of the easiest ways of doing this would be to take the boot.img thats contains the custom kernel you want and deleting the stock boot.img containing the stock kernel in your .zip file and replacing that with the boot.img of the custom kernel. Essentially you are just swapping the boot.img file in the .zip files with the one containing the custom kernel rather then the stock kernel. Let me know if you need me to explain things further or have any other questions I'll be happy to help you out.
Click to expand...
Click to collapse
Thanks for the response.
I have to first compile the custom kernel then it seems like an easy process after that. I'm going to try to compile Franco kernel for nexus 5 if u heard of it. Its been pretty good for me.
Any tips for compiling another project or Franco kernel would be great!? I will make a separate folder for that kernel git project and compile it there.
I also want to use tool chain like Linaro and maybe Sabermod but those are for nexus 4, maybe I can port it over.
MAXGEN said:
Thanks for the response.
I have to first compile the custom kernel then it seems like an easy process after that. I'm going to try to compile Franco kernel for nexus 5 if u heard of it. Its been pretty good for me.
Any tips for compiling another project or Franco kernel would be great!? I will make a separate folder for that kernel git project and compile it there.
I also want to use tool chain like Linaro and maybe Sabermod but those are for nexus 4, maybe I can port it over.
Click to expand...
Click to collapse
Franco kernel is an excellent kernel can't really go wrong with it. On your other note, Linaro is not Android device specific it can be used to compile kernels for a plethora of devices, I would recommend taking a look at this great guide on how to use Linaro to compile your kernel and how to customize the Linaro toolchain to suit your needs.
shimp208 said:
Franco kernel is an excellent kernel can't really go wrong with it. On your other note, Linaro is not Android device specific it can be used to compile kernels for a plethora of devices, I would recommend taking a look at this great guide on how to use Linaro to compile your kernel and how to customize the Linaro toolchain to suit your needs.
Click to expand...
Click to collapse
So I tried following the post. Just not sure about a lot of things and got confused and couldn't compile.
So what I'm trying first before I use the LInaro tool chain is to try to compile the Franco kernel without it. I clone Franco hammerhead git and link the arm-eabi-4.6 toolkit
make hammerhead_defconf
make -j7
Seem to compile with no errors, took a minute though which seems quick but not sure where it exported to.
Tried looking in the arch/arm/boot/ but no look.
I want compile a boot.img as well.
MAXGEN said:
So I tried following the post. Just not sure about a lot of things and got confused and couldn't compile.
So what I'm trying first before I use the LInaro tool chain is to try to compile the Franco kernel without it. I clone Franco hammerhead git and link the arm-eabi-4.6 toolkit
make hammerhead_defconf
make -j7
Seem to compile with no errors, took a minute though which seems quick but not sure where it exported to.
Tried looking in the arch/arm/boot/ but no look.
I want compile a boot.img as well.
Click to expand...
Click to collapse
I would recommend trying the following procedure:
Code:
mkdir franco
cd franco
git clone https://github.com/franciscofranco/hammerhead.git
After the clone operation completes rename the cloned folder to hammerhead or make sure it named hammerhead.
Now make sure your are in the franco folder you created and run the following commands:
Code:
git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-eabi-4.6
export PATH=$(pwd)/arm-eabi-4.6/bin:$PATH
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE=arm-eabi-
cd hammerhead
make hammerhead_defconfig
make -j4
Once it finishes this you should now have a zimage outputted in the path arch/arm/boot/zImage. To make the process of putting your zimage and module together run the following commands:
Code:
mkdir ~/franco/kernel_output
cp ~/franco/hammerhead/arch/arm/boot/zImage ~/franco/kernel_output/zImage
find ~/franco/hammerhead -name "*.ko" -exec cp {} ~/franco/kernel_output \; (You may have to run the command without the ";")
You should now have everything you need to make a boot.img. Let me know how it goes and if you still have questions.
Thanks for your help, W-XC (curious what that means and you have flying shoe is it because you run? You running in the next Boston Marathon?)
The kernel is actually using 4.7 so I just used the right git. I also found out it wasn't compiling because there was any error in that specific driver for CPU governor. The dev actually was about to push a fix and supposedly it will be push tomorrow but shared the commit so I was able to make the fix manually. Either case it compiles now. Working on step 2 which is to compile into the ROM.
I was curious you seem to know your stuff. Are you kernel dev? How did you gain your knowledge? I wanna learn more about Android OS and linux kernel? I taken basic OS classes in college so a lot of introduction to concepts but nothing on coding it though. Any books or anything you can recommend on any of these areas or anything closely related worth knowing? Thanks again.
For making a boot.img I tried the following. What would you suggest for mkbootimg?
I used this script to get my ramdisk.
http://www.enck.org/tools.html
But I'm little confused on where do you get the script for mkbootimg?
Is it from the android source or is it generated when you build the kernel or is it some script that someone made?
I found this posting for building a kernel with mkbootimg but the dilemmaI"m no having is what is correct commands for building.
http://www.droidforums.net/forum/rescue-squad-guides/31452-how-compile-your-own-kernel.html
The dev mention some commands in a posting several months ago.
http://forum.xda-developers.com/showpost.php?p=47167725&postcount=291
That might be a way to go but the argument doesn't take with the mkbootimg from the droid forums. Syntax is not right so it makes me think that mkbootimg is unique.
MAXGEN said:
Thanks for your help, W-XC (curious what that means and you have flying shoe is it because you run? You running in the next Boston Marathon?)
The kernel is actually using 4.7 so I just used the right git. I also found out it wasn't compiling because there was any error in that specific driver for CPU governor. The dev actually was about to push a fix and supposedly it will be push tomorrow but shared the commit so I was able to make the fix manually. Either case it compiles now. Working on step 2 which is to compile into the ROM.
I was curious you seem to know your stuff. Are you kernel dev? How did you gain your knowledge? I wanna learn more about Android OS and linux kernel? I taken basic OS classes in college so a lot of introduction to concepts but nothing on coding it though. Any books or anything you can recommend on any of these areas or anything closely related worth knowing? Thanks again.
Click to expand...
Click to collapse
MAXGEN said:
For making a boot.img I tried the following. What would you suggest for mkbootimg?
I used this script to get my ramdisk.
http://www.enck.org/tools.html
But I'm little confused on where do you get the script for mkbootimg?
Is it from the android source or is it generated when you build the kernel or is it some script that someone made?
I found this posting for building a kernel with mkbootimg but the dilemmaI"m no having is what is correct commands for building.
http://www.droidforums.net/forum/rescue-squad-guides/31452-how-compile-your-own-kernel.html
The dev mention some commands in a posting several months ago.
http://forum.xda-developers.com/showpost.php?p=47167725&postcount=291
That might be a way to go but the argument doesn't take with the mkbootimg from the droid forums. Syntax is not right so it makes me think that mkbootimg is unique.
Click to expand...
Click to collapse
The W-XC in my avatar stands for Watertown Cross-Country which is the team I used to run on and the flying shoe with the track wings represents our track team, as I love to run I thought it was a fitting avatar. As far as running the Boston marathon I am not running this year but I would love to someday, I am unfortunately not in good enough form to run a marathon right now due to a prolonged battle with an injury I sustained last spring, but I'll keep training and keeping running!
I'm glad you were able to make the fix on the kernel, often times errors that seem to pop out of nowhere are related to fixes not being pushed to the repository you were syncing and using to build at the time. Thank you for the nice compliment it is greatly appreciated, I am not a kernel developer just an overall aspiring developer who loves everything Android related and trying to contribute and help others however I can. I would say 99% of my knowledge of everything Android related has come from XDA and hours upon hours of Googling things related to kernel development, reading about something not understanding something then Googling the parts I didn't understand, piecing together things then Googling more things to help me understand, after a while you slowly start putting the pieces of knowledge together as you learn more and then you still keep learning. For resources on learning kernel development I would recommend learning the C programming language as it is the building block of kernel development. A great resource for learning C is the free online e-book Learn C The Hard Way. Another critical element of understanding Android kernel development is the Linux Kernel and it's drivers which is why I would recommend taking a look at Linux Device Driver's Third Edition, while parts of it are outdated the fundamental concepts are still very much applicable. As far as pure Android Kernel aspects and Linux Kernel aspects go the free-electrons group has some invaluable presentations that cover these subjects as well as other critical areas of embedded development that relate to kernels.
For the mkbootimg binary I would recommend downloading these unpack, repack, ramdisk tools. They have proven invaluable for me when working with img files and kernels. Download the scripts and binaries and put them in your ~/bin folder and make sure to give them the proper permissions that way they will be in your path and you can use them properly. Once you have them installed I would recommend obtaining a copy of the Nexus 5's latest boot.img (The factory images Google Provides should have it in the images .zip file included in the factory image). After doing that decompile the stock boot.img file using the umkbootimg binary, this should present you with an output of a ramdisk and a zimage. Next, take the zimage you compiled with the franco kernel source and replace the stock boot.img zimage with the zimage you compiled from franco kernel. Then run the mkbootimg binary with command (In terminal it should give you the command to easily re-pack the boot.img) to re-pack your new boot.img. The output of the new boot.img will have the default name new_boot.img or similar name. Re-name this file to boot.img and delete the old boot.img from your .zip file of your ROM and swap in the boot.img file you just created. You have now included the custom kernel you wanted in your ROM.
As always let me know if you still have questions I'll be happy to answer them :good:.
Thank you so much!!! Probably going to have to take some time to digest everything but definitely will have more questions when I'm done.
Quick question, do you have see "C" being replace? I have read some C code but haven't not yet coded anything in C. I been told that low level access you get with C is not comparable with other languages. I guess you would have to go to ASM to get even more access. ASM personally I run from it, probably should do more of it for practice. We do a lot of high level language C++, java, python and some others in school but no C. I probably can't avoid not being comfortable in it? C is not going to be replace by anything in future??
MAXGEN said:
Thank you so much!!! Probably going to have to take some time to digest everything but definitely will have more questions when I'm done.
Quick question, do you have see "C" being replace? I have read some C code but haven't not yet coded anything in C. I been told that low level access you get with C is not comparable with other languages. I guess you would have to go to ASM to get even more access. ASM personally I run from it, probably should do more of it for practice. We do a lot of high level language C++, java, python and some others in school but no C. I probably can't avoid not being comfortable in it? C is not going to be replace by anything in future??
Click to expand...
Click to collapse
You are correct in that to get even more low level access you start getting into assembly territory. What makes assembly difficult and what makes people from run form it is unlike very high level languages such as Python, Java, etc. it is much less human readable and a lot closer to machine language (Binary code), however like anything practice makes perfect the more you practice with a language the easier things get and the more confidence you have in programming things with it. If you really want to customize and develop kernels C is a must there is no getting around that unfortunately. As far as C being replaced with anything in the future, will it ever be replaced, probably as is the case with technology, but as far as it being replaced with anything equivalent or better in the next 10-20 years I doubt it, as it would take years to develop a new standard and even longer to be adopted and standardized to the point C is used and accepted today.

[Q] Cooking ROMs... I still don't get it

Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
oxiroxt said:
Hello,
I'm willing to try and build a custom rom, but I've been diving through the site for a few days and I still don't get it. I believe I do have the required background to do this: programming, linux, etc. and I have wide experience as a phone user, etc. It's just that either I'm not reading what I need or the way I want it. The problem, I believe, is that all I find are guides telling me to install this and those tools and then open this and that and voila! you got your rom. But they're not explaining WHAT exactly goes into those roms, or what is expected to go there, what's the purpose of those contents, etc., and I can't really catch with that. I feel at a loss and hate wasting my time turning around for nothing.
1. I don't understand the difference between a flashable rom and one that is meant to be installed through recovery, although I can see they're different. Do they both models contain the same kind of data? Is there any restriction to what one model can contain over the other one? If so, how would I convert from one to the other? But please, don't tell me to use this or that tool. I just need the theory behind it. Something of sorts like: "You need to extract this or that from this tarball, then mount this image, then the directory tree there goes in that directory over the other model of rom"
2. update-binary: Okay I guess this is run when installing from recovery, and this takes care of installing the rom, right?wrong?. Is this a per-rom thing, per-device thing? generic? If it's per-rom, how to generate it? do I need to compile something? Is there any generic source code that can be used as a start?
3. Although I have a basic understanding of how the Linux directory tree works, I know Android works on top of a heavily modified Linux. So can you explain briefly how the directory tree works? For instance, I believe /data/data is where Android apps install to, in /system/bin or xbin I can find busybox binaries/symlinks if present. /dev and /proc look the same as in Linux. I don't know about /sys. Also how are both rom models deployed to this tree? What is basically being copied?
4. If I were to compile a kernel, where do I find the Android kernel sources? or is it just a generic Linux kernel? where can i get a basic config for the device? Last time I checked my device hadn't /proc/config.gz but maybe I could get it from another rom with it enabled or something. What toolchain and where to get it? Oh and if you know of a native arm version of gcc or whatsnot, I'd prefer that. Setting up IDEs or toolchains is a nightmare. I don't like crosscompiling. But crosscompiling or not, a directory with all needed binaries without needing to set up system variables nor other stuff, would be amazing.
I surely have a lot more questions that I can't get from the back of my mind now, and I'll have yet more as you explain. But the point of my questions was mainly trying to explain the degree of the loss I'm at, so you can assist me better.
If it looks like a foolish petition, well, that's because I'm quite stubborn and can't catch things that don't go my way. I really need to understand the basics before I can move into actually doing something. I want to build a rom for the right reasons(to me). It's not just about packing a set of apps or themes with it, but about learning and doing other stuff like trying to fix things that are not supposed to work for the device in that Android version, etc.
If you can't help, congrats for reading through here anyways But any help is greatly appreciated :good:
Click to expand...
Click to collapse
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
synesthete said:
I am not terribly knowledgeable about all of this, but I will take a crack at it. Others can feel free to correct me.
1. "Flashing" is usually done through the recovery from a zip with an update script inside. That script is in a language called "edify". Read more about Edify Here and Here.
The only other common way that I know of installing a ROM is through fastboot in the bootloader, but that is normally only used with official factory images. Also, I think Samsung ROMs are often flashed with a proprietary program called Odin.
2. I think that the update-binary is standard across all recent devices. I think it is just an interpreter for the Edify scripting language. Old versions of android used a somewhat different scripting language and required a different file. You can probably pull the binary out of another recent zip and use that. The main thing you have to worry about is the update script (instructions for what the zip does) and the folder structure of the zip.
3. I am not confident to explain much here, but the apps and their data are stored in different places. User apps are stored in /data/app with app data stored in /data/data, I think. System apps are installed in /system/app. There is more files stored on the "sdcard" partition which can be internal or external, depending on the device.
4. Kernel sources are usually provided in the source code from whatever repo you are using. Different ROMs use different bases. Here is some info about grabbing the AOSP kernel sources with git: http://source.android.com/source/building-kernels.html
Many of the more popular ROMS have specific build instructions on their individual github pages (Cyanogen, Paranoid Android, etc), so you might what to look at those, too. Also, depending on the individual devices, there might be proprietary binaries sourced from the device or hardware manufacturers for things like camera drivers, graphics chips, etc.
If you want a walk through of the basic build process google has a tutorial. The last time I checked there seemed to be some outdated info, but it might give you a general idea of the build process. http://source.android.com/source/initializing.html
Hopefully someone more knowledgeable can give you more info, but that is all I got
Click to expand...
Click to collapse
OMG Finally some light! THANK YOU, THANK YOU, THANK YOU for all the info. I didn't get much right now, I'll need to read through your post a few times before I get it all, haha. I'll be sure to check the links too. Thank you!

Categories

Resources