[Q] Regarding the Android kernel - Android Q&A, Help & Troubleshooting

Hello,
I've had some form of Android device for atleast a year. I've also moved on from Windows, now using Linux as my day-to-day operating system for 6+ months, having used it almost a year. I have a small bit of knowledge in both Java and C++.
That being said, I'm looking to start messing with the Linux (specifically Android) kernel. I'm hoping that, eventually, I'll be able to make my own kernel for my Thunderbolt. So, yeah, if anyone could post how they learned or recommend a book (or books),a website, etc. I'd very much appreciate it! I've been looking to get Developing the Linux kernel 3rd edition by Robert Love (I think that's the title/author, not 100% sure, though) but would like to see what anyone recommends. Also, I've seen a little bit of part 1 of OhHeyitslou's video regarding the Linux kernel, but would appreciate other resources.
Thanks,
Labsownyou
Sent from my Thunderbolt using Tapatalk.

hello labswanyou,
I'm also looking for learning how to develop android kernels. After flashing my phone with custom rom and kernel, it seems very interesting for me to develop android kernels.
It would be helpful for us if any of you describe how to create android kernels in simple steps or if you refer some websites where we can get simple tutorials for it.
I think the following link will help to understand the basics of android
developer.android.com/guide/basics/what-is-android.html

pratish7 said:
hello labswanyou,
I'm also looking for learning how to develop android kernels. After flashing my phone with custom rom and kernel, it seems very interesting for me to develop android kernels.
It would be helpful for us if any of you describe how to create android kernels in simple steps or if you refer some websites where we can get simple tutorials for it.
I think the following link will help to understand the basics of android
developer.android.com/guide/basics/what-is-android.html
Click to expand...
Click to collapse
Thanks for the link, though I kind of new most of it. It'll be interesting to see if people reply, and if/when they do, what they post!
I think it'd be great if one (or more...) of the kernel developers could point us in the right direction.

Hey guys, I'm not a kernel developer exactly(more of a tinkerer at this point--I'm learning), but I have a basic guide that I sent another XDA user that covers a very basic step by step guide that should work for most kernels. If you're interested I'd be glad to post it.
Sent from my ADR6300 using xda premium

swm5126 said:
Hey guys, I'm not a kernel developer exactly(more of a tinkerer at this point--I'm learning), but I have a basic guide that I sent another XDA user that covers a very basic step by step guide that should work for most kernels. If you're interested I'd be glad to post it.
Sent from my ADR6300 using xda premium
Click to expand...
Click to collapse
If you could, that be greatly appreciated!
Sent from my ADR6400L using Tapatalk

Since I don't know what kind of experience you have exactly (other than using Linux, which is good ) I'll just go all out. Don't be offended if it seems like I'm being too explicit, I'm just copying and pasting a couple things from guides I used when I was trying to figure this **** out a couple weeks ago. Most of this is assuming you have no build environment set up at all, and should work with any Linux builds of the Debian variant (Ubuntu...and thats all I can think of ).
Make sure you have the Android SDK tools installed so you have ADB and stuff. If you don't, Google it. The install steps from Google work fine.
Fire up a terminal. Add this first so you don't error out trying to install the jdk.
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ maverick partner"
Assuming you're on an x86/32 bit version of linux, run:
Code:
sudo apt-get install git-core gnupg flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev squashfs-tools build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk pngcrush schedtool
If using x64, run the above command as well as this one:
Code:
sudo apt-get install g++-multilib lib32z1-dev lib32ncurses5-dev lib32readline5-dev gcc-4.3-multilib g++-4.3-multilib
NOTE: gcc-4.3-multilib g++-4.3-multilib is no longer available for Ubuntu 11.04 64-bit, but should still build without issue.
Now you'll need to grab the ARM toolchain to be able to cross compile code for ARM devices.
Make a directory in your home folder (I just used android, so ~/android) and go into it on your terminal after all that **** up there is done.
Now do:
Code:
git clone git://github.com/CyanogenMod/android_prebuilt.git
or if you have a github account and to avoid a couple prompts:
Code:
git clone [email protected]:CyanogenMod/android_prebuilt.git
Assuming you did the first command, it'll ask for your name and email. You can give them, or just hit enter and ignore it. It'll take a while to download the whole package, and then a good amount of time to unpackage and check out the files. In reality, there's more there than you need for compiling a kernel, but as you do more you may find it helpful to already have some of the things in there.
Now you have the toolchain. The next thing to do is to add the ARM toolchain path to your .bashrc file so make can easily call it when you compile the kernel. Back on your terminal:
Code:
nano ~/.bashrc
Scroll alll the way down. On the end of the file, add:
Code:
export CCOMPILER=~/android/android_ prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
Where ~/android/ is the name of the folder you used git to clone the android_prebuilt repo from CM.
Then, to reload your .bashrc you just edited:
Code:
source ~/.bashrc
The last thing you need is the kernel source. I suggest using the kernel source that's used for CM7 for your device. If you don't which repo to use, you can go to [LINK]http://wiki.cyanogenmod.com/index.php[/LINK], find your device, and on the right hand side look who the maintainers are. Usually a quick google of their name + github on Google will land you in the right place.
Back on the terminal, go into your android folder you created, and run:
Code:
git clone git://[MAINTAINER USERNAME]/[whatever their kernel is called].git
Wait for it to finish. You should have a a kernel source folder with about a bazillion files in it now taking up way more space than it needs to to create a 2MB kernel
On your trusty terminal again (make sure you're in the kernel source folder you just cloned):
Code:
cp arch/arm/configs/[device name]_defconfig .
Don't forget the period at the end to copy it to the root of the source folder. I'm not sure what the device name will be, if its coming from a CM kernel, sometimes the maintainers put cyanogenmod_ in front. For example, for me its cyanogenmod_incrediblec_defconfig.
Finally.
The last part is easy(make sure you're still in the root of your source dir):
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER
To run it with multiple threads (much faster on multicore setups) run this instead (the number after j is the number of threads that will run):
Code:
make -j4 ARCH=arm CROSS_COMPILE=$CCOMPILER
Then wait till it's done. If you did a multithread build and the compiler didn't like something, the error probably went by a while ago and you didn't catch it. The other threads run even after the error, until they can't run anymore without the missing peiece that errored out. If this happens, just hit the up key on your keyboard ans run the same make command again. The compiler will print the error right away since none of tgr threads can continue until the error is fixed. The last few lines of Make's output should tell you where its stashed the zImage file (your finished product!).
And there you have it. I think! Let me know how it goes.
Sent from my ADR6300 using xda premium

I say to use the CM7 kernel source since we were talking about it in a PM, but you can certainly grab a manufacturer's source tarball and use that instead. Just be careful, sometimes their defconfigs aren't always perfect. If this is the case,Make may ask you if it should enable certain features or drivers that it thinks are "new" and doesn't know what to do with.
Sent from my ADR6300 using xda premium

I surely suggest you to start compiling the linux kernel of your installed distribution. Just a simple copy of it, then, after playing on it tweaking around, move to android kernel. What posted by Swm5126 is actually the "state of the art how to do it".
P.S. googling AOSP (android open source project) you'll find lots of related resources.
GT-S5570 on Train

Please use the Q&A Forum for questions Thanks
Moving to Q&A

lufc said:
Please use the Q&A Forum for questions Thanks
Moving to Q&A
Click to expand...
Click to collapse
Thanks, and sorry about that. I'm newish to posting here...
Sent from my ADR6400L using Tapatalk

Related

[KITCHEN] COFFEE SHOP v2.1 w/ HTC-SENSE support

Welcome to COFFEE SHOP v2.x; Your favorite KITCHEN for HD2 Android
COFFEE SHOP - creating your own HD2|ANDROID roms (2.1 only)
HTC SENSE supported
Desire base
Froyo base
ECLAIR base
Evo base ( but is very unstable )
If your base is not listed above, that does not mean that it is not compatible with your ROM. While I have not tested other roms, I suspect that most roms are similar enough that they should all be compatible (to some degree).[ Some features MIGHT be restricted such as Camera. Test it out, and report back for the convenience.
How do I use it?
Read the second post
Your Android system image (system.img) should go to '/root/of/coffee/shop/bin/environment/image/system.img' < You should create the folder if it doesn't already exist
COFFEE SHOP 2.1 is here!
If you have no clue what I said above, there really is no point of attempting, unless of course you want to learn
Download: v2.1
COFFEE SHOP -Tips:
Before starting, you will need any supported Android Image. Download it, and save it to the root of your COFFEE SHOP directory. Extract the "system.img" to 'bin/environment/image', which is located inside of the rom ZIP. (Only zip is explained in this guide. However, if you know how to extract from .EXE, by all means, go ahead).
Coffee Shop will do the following
EXTRACT SYSTEM IMG CONTENTS
INSTALL MODULES/APPS/ETC
REPACK SYSTEM+HOUSEKEEPING
You will need one separate dependency
Code:
genext2fs
#in terminal, use the following to install
apt-get install genext2fs
My rom won't work?
Make sure that you have adequate permissions on all coffee shop files!
Use the following command before your first time running COFFEE SHOP!
Code:
chmod 777 -R /path/of/coffee/shop/*
HOW-TO-USE?(2.1 only)
Using COFFEE SHOP 2.1 is simple as ever!
1. Move your 'system.img' to 'bin/environment/image'
2. Click "Build Android" button
--Your image contents will be extracted
3. Click "Export Android"
--Your system.ext2 will be built and ported to 'bin/environment/port/'
You have the option to install Modules, Apps, HTC-SENSE support ( does not install HTC-SENSE ), or root your rom! Check the boxes according to your preference. More options coming soon!
Where do I get my roms from?
http://shipped-roms.com/index.php?category=android
ROMS SUCCESSFULLY BUILT VIA COFFEE SHOP
XTarantula v1.x
DEVELOPERS LOG:
v1.0: Build System Images + Root
v1.1: Adding Media to System Image now suppported
v1.2: Custom shell commands now supported.
v1.3 Fixes "(" unexpected, unyaffs, genext2fs not found issues. Media is now accessible
v1.4 Adds dhdutil, e2fsck, scp, sqlite3 support (= Also, the COFFEE SHOP is more stable, and less bloating
v1.5 Fixes compatibility issues on x86-32bit systems Now everyone should be able to run COFFEE SHOP . Also, libs+modules are now installable!
v1.6 Fixes genext2fs issue. Make sure to apt-get install genext2fs
v1.7 Fixes a few glitches. You now also have the option to download a rom from a select list. Check ROM features for more information....
v2.0 has been rebuilt from scratch, and implements a bunch of new rom building functionality! Refer to documentation.
v2.1 Adds support for most Android images! Also, a GUI is included for the most simple ROM porting! *Supports HTC-SENSE
SUPPORTED ENVIRONMENT(S):
LINUX: Such as Ubuntu, OpenSUSE, Debian and most other Linux distributions
Great initiative. Looking forward to trying it once I get my HDD figured out.
montraydavis said:
Welcome to COFFEE SHOP v1; Your favorite KITCHEN for HD2 Android
COFFEE SHOP
Allows you to build roms based off most STOCK ECLAIR/FROYO builds
Allows you to build roms based off SOME STOCK HERO builds
How do I use it?
First, make sure you are on Linux (cygwin MIGHT be supported, but is untested. Anyone who wants to test, and report back, feel free to do so).
All you do is simply put your "system.img" file into the COFFEE SHOP root directory, and run the following via terminal
Code:
cd /root/directory/of/coffee/shop
./start.sh
==SETTINGS==
FILE : settings/settings
Code:
#allow root access on rom
root=1
settings are read per line
[variable]=[value], otherwise, it will NOT work. Currently, the only option though is allowing root access. More customization will come later
THIS IS A BETA RELEASE; NO DOCUMENTATION, OR FURTHER HELP UNTIL OFFICIAL COFFEE SHOP HAS BEEN RELEASED.
-THIS BUILDS ONLY THE "system" image
If you have no clue what I said above, there really is no point of attempting, unless of course you want to learn
Download: http://www.megaupload.com/?d=O23ENSB9
Click to expand...
Click to collapse
Awesome, soon some cooks will put all ingredients in the pot and get a nice flashing ROM out of their stove for many people to enjoy some tasty Froyo on their beloved HD2...
Soooo looking forward !
Therefore NAND have to work.. I think people shouldn't call it ROM, until it is something you can flash to NAND..
COFFEE SHOP v1.1 released;
Great work
montraydavis said:
COFFEE SHOP v1.1 released;
Click to expand...
Click to collapse
Im not a chef, but i can make something ^^
Big Thanks
yimb0 said:
Im not a chef, but i can make something ^^
Big Thanks
Click to expand...
Click to collapse
You can become one [=
Good luck ; Make sure you add some creame to the frappacino
This is very interesting and cool. I think I might have to play around with this and learn once there is a little more documentation.
so can i take for instance the .img from a Cyanogen build and cook a build based on that?
looks fun going to play now
palosjr said:
so can i take for instance the .img from a Cyanogen build and cook a build based on that?
Click to expand...
Click to collapse
Cyanogen has NOT been tested, but, why not give it a shot, and let me know ?
Demon_man said:
looks fun going to play now
Click to expand...
Click to collapse
Have fun, good luck, and let me know how it goes.
so, you are running this from terminal via the phone, or via terminal from a linux machine?
palosjr said:
so, you are running this from terminal via the phone, or via terminal from a linux machine?
Click to expand...
Click to collapse
Linux machine.
montraydavis said:
Linux machine.
Click to expand...
Click to collapse
gotcha. alright, getting my dual boot going again and then its off to the races!! so glad im off tomorrow!!!
palosjr said:
gotcha. alright, getting my dual boot going again and then its off to the races!! so glad im off tomorrow!!!
Click to expand...
Click to collapse
Someone is pretty excited [=
Good luck; Remember, this is a BETA release, so, it's not the BEST rom porting method, but, it's hell of a lot easier than any other one at this moment in time
Let me know how it goes;
--On the contrary, folks, feel free to report issues and or make suggestions
Im reinstalling ubuntu now so ill try this right after
montraydavis said:
Someone is pretty excited [=
Good luck; Remember, this is a BETA release, so, it's not the BEST rom porting method, but, it's hell of a lot easier than any other one at this moment in time
Let me know how it goes;
--On the contrary, folks, feel free to report issues and or make suggestions
Click to expand...
Click to collapse
definitely excited, this sounds like a great idea/tool and I am anxious to try it.
BETA or not, its better than what we have now (next to nothing!!!)
JJbdoggg said:
Im reinstalling ubuntu now so ill try this right after
Click to expand...
Click to collapse
likewise... man oh man, i wish i hadnt deleted my ubuntu.iso file a few weeks ago *_*

Compile X10/x10 mini kernel

Hello,
I believe a lot of us would like to do it, so let's please describe here how-to:
1. Linux
2. Mac os Leo
3. Windows
Gurus, please contribute!
Excellent initiative, I could write a short howto for Arch Linux later.
But one thing though, it might be a good idea to mention in the first post that you can't actually boot a custom kernel yet.
ddewbofh said:
Excellent initiative, I could write a short howto for Arch Linux later.
But one thing though, it might be a good idea to mention in the first post that you can't actually boot a custom kernel yet.
Click to expand...
Click to collapse
Indeed agree, but to try we need to have it!
My topic about compiling kernel sources has already many infos so do you think another similar topic is really necessary ?
alx5962 said:
My topic about compiling kernel sources has already many infos so do you think another similar topic is really necessary ?
Click to expand...
Click to collapse
Your thread is excellent but I'd guess that this thread would be more oriented towards "hand-holding", really basic guides. Your topic was very broad requiring going to the android developers site and reading their docs on cross-compilation. Gathering that info into easier guides could be beneficial, if not to demystify the process.
As it stands right now just compiling modules seems almost insurmountable. But if the information needed could be condensed into simple guides it could show that while it takes considerable time and effort it's not an impossible task even for developers not familiar with cross-compiling kernels.
And information information on setting up cross-compilers for Win, Mac and popular Linux distros is nice to have available in an easy to find topic anyway.
IMHO, the easiest way to make modules would be a virtualbox image already set up with arm gcc, kernel sources and X10 kernel config. It's a long process to set everything up; virtualbox makes this easier and cross platform.
maxrfon said:
Hello,
I believe a lot of us would like to do it, so let's please describe here how-to:
1. Linux
2. Mac os Leo
3. Windows
Gurus, please contribute!
Click to expand...
Click to collapse
Sources are here :
http://developer.sonyericsson.com/cws/download/1/823/877/1278570405/X10_mini_Donut_100630.tar.gz
Rest can be done in same way as for "big" X10.
alx5962 said:
IMHO, the easiest way to make modules would be a virtualbox image already set up with arm gcc, kernel sources and X10 kernel config. It's a long process to set everything up; virtualbox makes this easier and cross platform.
Click to expand...
Click to collapse
Do you have such virtual box image or whatever it is?
maxrfon said:
Do you have such virtual box image or whatever it is?
Click to expand...
Click to collapse
yep but can't share it as everything is set up in french and I'm sure you'll not like this
anyway, i'm sure the owner of this thread will enjoy to create one.
alx5962 said:
yep but can't share it as everything is set up in french and I'm sure you'll not like this
anyway, i'm sure the owner of this thread will enjoy to create one.
Click to expand...
Click to collapse
Yes, french for me is a bit difficult
Ok i managed to make Ubuntu on my Parallels, just finished with the gcc. Let's see how it works.
Maybe i will share it.
kernel config is included in the /etc folder if I remember well, hope it's the same for the mini X10
It's actually in /proc
zdzihu said:
It's actually in /proc
Click to expand...
Click to collapse
Hi zdzihu,
I managed somehow install arm gcc on my Ubuntu. Now it's time for the tools.
So i would like to ask what config should i use arm v4? V5?
I am so tired with this linux things, but finally at least the demo busybox compiled well
So i tried to compile with arm-v5te config but for flash read (which is normaly working) it says
Code:
# ./dump_image system /sdcard/tt.bin
error reading system: Inappropriate ioctl for device
My task it not to run flash tools available, but my own, to compile all myself, to try to do the trick with the CPU to accept kernel, that i compiled.
Thanks.
The Snapdragon is armv7 compliant, so that should be your target.
ddewbofh said:
The Snapdragon is armv7 compliant, so that should be your target.
Click to expand...
Click to collapse
http://jackytw.blogspot.com/2009/11/howto-run-native-linux-application-on.html
This tut i was using.
I can't find v7 .. Should i consider the V as the CPU ver?
Then its 1136 if i am not wrong?
maxrfon said:
http://jackytw.blogspot.com/2009/11/howto-run-native-linux-application-on.html
This tut i was using.
I can't find v7 .. Should i consider the V as the CPU ver?
Then its 1136 if i am not wrong?
Click to expand...
Click to collapse
Are you using that tool to build the toolchain? In that case it might not have the option to build for that arch. The best way to make sure you get the correct one is to build it manually from scratch.
ddewbofh said:
Are you using that tool to build the toolchain? In that case it might not have the option to build for that arch. The best way to make sure you get the correct one is to build it manually from scratch.
Click to expand...
Click to collapse
Looks like there is no other tut to build the toolchain. I searched days and nights to find something working.
I even compiled bysybox with it and it works on my x10!
But i found some sources of flash backup, called nandtools, compiled them well, no errors but the exec files are 4x bigger than the precompiled ones... And it makes the IOControl error..
the NDK won't compile, it requires Makefile or Android.mk and those are real headache to learn.
The Makefile from the archive is not compatible with NDK's make system and so on...
And so 2 weeks..
Pufff.. I am so tired if just linux things
Any hand?
Hi there, ARM is backward compatibile so compiled for v5 should run just fine. Problem must be somewhere else... I'm at work at the moment so I can't help much
By the way, there was some kind of dedicated flash tool posted already HERE, maybe you could check with jerpelea for re-upload?
zdzihu said:
Hi there, ARM is backward compatibile so compiled for v5 should run just fine. Problem must be somewhere else... I'm at work at the moment so I can't help much
By the way, there was some kind of dedicated flash tool posted already HERE, maybe you could check with jerpelea for re-upload?
Click to expand...
Click to collapse
You see, i need to compile mine, i have enough tools here already working, but my task is to compile my own and that's why i need a toolchain.
NDK is ok for the kernel, i compiled it already. But the native applications are not supported fully. Like write is deprecated and you can't use this function, and lot other limitations. So independent toolchain would help.
That's the point.
maxrfon said:
So independent toolchain would help.
Click to expand...
Click to collapse
PM sent =)

[Q] Looking for a dev to teach me

hey everyone, I've been with android since release on the g1 and have followed it since. but now I'm tired of being just a user and want to learn how to develope roms. I would rather have some one teach me first hand, but links to some places that helped you would be great too. So again, Im looking for a dev who would want to teach me, if some money is wanted, that's fine. thanks for reading. reply here and/or PM me. I am very serious about learning, I dont just want little tips/tricks or pointers.
Edit: I have a bit of skill in C++ and Java, but nothing too significant. I lost interest in writing programs, same with apps, no interest, everything has been done over and over again.
I have created a site specifically just for this. I have a link in the signature but feel free to just click here @green rom project
stoute said:
I have created a site specifically just for this. I have a link in the signature but feel free to just click here @green rom project
Click to expand...
Click to collapse
Thanks alot.
thank you too
I didn't find anything there that isn't here on xda.
JDV28 said:
I didn't find anything there that isn't here on xda.
Click to expand...
Click to collapse
Maybe, but for new users in building roms, it's easy if it is gathered in one place, instead of searching all over xda that sometimes you can get yourself lost
What ARE you looking for?
Sent from my DROID2 using Tapatalk
jbirdvegas said:
What ARE you looking for?
Sent from my DROID2 using Tapatalk
Click to expand...
Click to collapse
Some sort of a guide to developing roms. even porting. not an "all in one" guide. thats unrealistic and would most likely suck, seeing as its such a broad subject.
that site, is... i dont even know. not to insult you, but i found it to be useless. the single guide you have on there is for setting up the htc kitchen, which i figured out in 5 minutes on my own. I would suggest making a "Guides" section of that site, so it isnt JUST forums, and adding, well, GUIDES. you pointed me there to help me, but there was nothing on the forums even close to helping me.
What os are you running? Have you succesfully compiled the source yet either aosp or cm?
CyanogenMod's github is a great place to learn repo the source. Read the commits @ github.com/cyanogenmod all commits are commented to make reading changes easier.
Aosp is also on [email protected] github.com/android building aosp can be more tricky.
Cm is aosp with many custom packages included to see what is and isn't aosp [email protected] github.com/CyanogenMod/android
default.xml contains references to what packages are cyanogen and what is aosp
Either way you need to start by getting very familiar with
github.com/CyanogenMod/android_vendor_cyanogenmod
Look in the products folder at the .mk files
and how they are invoked by core/Makefile in
github.com/CyanogenMod/android_build
Also pay attention to build/envsetup.sh
Sent from my DROID2 using Tapatalk
How noob at developing are you?
Sent from my DROID2 using Tapatalk
jbirdvegas said:
How noob at developing are you?
Sent from my DROID2 using Tapatalk
Click to expand...
Click to collapse
your last post was quite helpful. Barely anything at all.
best bet start by getting the source to compile... sounds simple but can be tricky
most importantly get to know ~/android/system/build
you can't produce a custom rom without understanding when and how everything is compiled
JDV28 said:
hey everyone, I've been with android since release on the g1 and have followed it since. but now I'm tired of being just a user and want to learn how to develope roms. I would rather have some one teach me first hand, but links to some places that helped you would be great too. So again, Im looking for a dev who would want to teach me, if some money is wanted, that's fine. thanks for reading. reply here and/or PM me. I am very serious about learning, I dont just want little tips/tricks or pointers.
Edit: I have a bit of skill in C++ and Java, but nothing too significant. I lost interest in writing programs, same with apps, no interest, everything has been done over and over again.
Click to expand...
Click to collapse
Android Kitchen will be your best bet. Very easy to follow. Read the whole post at least twice and you will be good to go. Follow all the links.
This is what i used from the ground up and i have my own rom on my HTC EVO 4G.
http://forum.xda-developers.com/showthread.php?t=633246
http://theunlockr.com/2010/03/26/ho...om-for-android-part-1-setting-up-the-kitchen/
http://theunlockr.com/2010/04/15/ho...m-for-android-part-2-creating-your-first-rom/
Credit goes to dsixda. he created android kitchen. If you like this, please donate to him.
"Dont forget to hit the thanks button if i helped you"
I'm new to the Dev world myself... I've done a lot of reading and research and I've gotten to the point of building and modding Roms to contribute to the community here. I've only done rom's for the Eris, which isn't as complex as some of the other devices, but I'm willing to share my knowledge if you need it.
The basics you will need:
1. Linux (I've tried doing this in windows, not worth the hassle!), either ubuntu or linux mint work well (Mint is a windows "like" os, so it might be easier to start with that).
2. Android SDK Kit (You can google it)
3. APK Manager (If you need to decompile APK's to make changes, this tool makes things a lot easier!)
4. Android Kitchen (A must if you are porting and to keep your Rom's cleaned up!)
5. A working understanding of XML and some java code is extremely helpful!
6. Time and Commitment! Devving, by any standard, is a time consuming process! You can easily make a Rom, but keeping the masses happy requires updates to nightly sources and time to rebuild what you've started!
I've spent so much time updating, compiling, modding and theming that my family voices plenty of complaints! But, the reward of building something that works and seeing others benefit from your creation is well worth the effort! Balancing your time, if you have a family to consider, is key to succeeding with this!
If you'd like more help, send me a PM! I'll work with you as much as I can!
I setup the kitchen, as i previously said, but didnt find any use for it except maybe adding minor features to a completely stock rom. i have linux set up with the SDK. i just dont know where to go from there...even compiling from source
Read everything here
http://wiki.cyanogenmod.com/index.php?title=Building_from_source
Sent from my DROID2 using Tapatalk
JDV28 said:
I setup the kitchen, as i previously said, but didnt find any use for it except maybe adding minor features to a completely stock rom. i have linux set up with the SDK. i just dont know where to go from there...even compiling from source
Click to expand...
Click to collapse
Sent you a PM back, bro.
Having Linux, SDK and the Kitchen setup gets you about 75% of the way there!
The basic steps to compiling from source run through the Terminal in Linux. You will need to pull in the CM repository (the link jbirdvegas posted will give the instructions to do that). Once the repository is setup, you will need to load the proprietary files for the device you're building for in order to sync the correct source. (repo sync -j16 will sync the source and build your folders for compiling). You will need to plug in your phone through USB and extract the proprietaries through ADB. Example, my build location in Linux is "android/system" in that folder there will be a device folder with folders for each device brand and build. My eris is listed in CM as desirec, so my drive folder location is "android/system/devices/htc/desirec". In order to pull my proprietary files, I would have to do the following:
1. In terminal; "cd android/system/devices/htc/desirec" (This puts me in the correct build folder)
2. su (puts terminal in root) - type in password
3. "./adb kill-server" (shuts down adb)
4. "./adb start-server" (starts adb)
5. "exit" (puts you back in standard terminal)
6. "./adb devices" (verify your device shows - if you get ????????, adb did not start right)
7. "./extract-files.sh" (this will extract the proprietary files from your device and place them in the device folder for building)
8. "cd"
9. "cd android/system" (puts you back in the CM build folder)
Once that's done, all you basically need to do after that is:
"source build/envsetup.sh" (Setup source build)
"lunch" (this will give you a list of builds - pick your device)
"make -j# bacon" (# is the number of processors your phone has +1)
The Repo Sync and Make commands will take time, but once you've finished the Make cycle, your Rom (if there were no errors) will be compiled, signed and ready to flash on your device. From there, you can use the kitchen to add "tweaks" to your rom (CM sources are usually pre-setup, but you can still add things like "data/app" access to your Rom).
Hopefully this takes you to the next step. PM me if you run into problems, I'll help you through it.
If you get abd shows your device as ??????????
Google 51-android.rules on how to setup udev
Sent from my DROID2 using Tapatalk
jbirdvegas said:
Read everything here
http://wiki.cyanogenmod.com/index.php?title=Building_from_source
Sent from my DROID2 using Tapatalk
Click to expand...
Click to collapse
about 50% of those pages are empty, does it matter what phone i click on for now? nothing shows up for Glacier
JDV28 said:
about 50% of those pages are empty, does it matter what phone i click on for now? nothing shows up for Glacier
Click to expand...
Click to collapse
jbirdvegas has it right on the adb correction if your device isn't found. I'll look for setting up the rules and post the link a little later.
Glacier doesn't have instructions yet, but there are CM builds for it. If you follow the evo instructions that will get you setup. Just replace supersonic with glacier to get your device established. There wasn't one for the Eris, either, and the EVO instructions are what I used.
Also, if you're building for GB and you're on a 32-bit system, it will tell you you cannot build it. There is a bypass; I'm using a 32-bit system and just removed the "end" statement in the make file. My builds work just fine, so bypassing the environment won't mess up your builds...

[Q] Help building the kernel.

Hi, I managed to build a kernel from Samsung's sources, but it doesn't work (boot loop). It also seems to be much smaller than the official builds (4.6 MB vs 8 MB). Here's exactly what I did, I wonder if someone could tell me where I'm going wrong:
1. Download & extract the kernel sources from here : https://opensource.samsung.com/reception/reception_main.do?method=reception_search&searchValue=I9100
2. Download and install the old code sourcery GCC as recommended in Samsung's readme from here: http://www.codesourcery.com/sgpp/lite/arm/portal/release298
3. Move the code sourcery install to /opt/toolchains/arm-2009q3
4. Edit kernel/Makefile and change CROSS_COMPILE to
CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-eabi-
(it was arm-linux-gnueabi- I think).
5. In kernel, make c1_rev02_defconfig && make
6. It worked, and I got a zImage. I flashed it using heimdall like this:
heimdall flash --kernel zImage
(That worked when I went back to stock so it is obviously correct, but using my kernel I get a reboot loop.)
Anyone have any idea what's so different with my build compared to Samsung's that results in it not working, and being so much smaller?
Timmmmmm said:
Hi, I managed to build a kernel from Samsung's sources, but it doesn't work (boot loop). It also seems to be much smaller than the official builds (4.6 MB vs 8 MB). Here's exactly what I did, I wonder if someone could tell me where I'm going wrong:
1. Download & extract the kernel sources from here : https://opensource.samsung.com/reception/reception_main.do?method=reception_search&searchValue=I9100
2. Download and install the old code sourcery GCC as recommended in Samsung's readme from here: http://www.codesourcery.com/sgpp/lite/arm/portal/release298
3. Move the code sourcery install to /opt/toolchains/arm-2009q3
4. Edit kernel/Makefile and change CROSS_COMPILE to
CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-eabi-
(it was arm-linux-gnueabi- I think).
5. In kernel, make c1_rev02_defconfig && make
6. It worked, and I got a zImage. I flashed it using heimdall like this:
heimdall flash --kernel zImage
(That worked when I went back to stock so it is obviously correct, but using my kernel I get a reboot loop.)
Anyone have any idea what's so different with my build compared to Samsung's that results in it not working, and being so much smaller?
Click to expand...
Click to collapse
you will be missing the initramfs. See supercurio's threads for compile scripts and info
You are using the wrong toolchain too!
http://www.codesourcery.com/sgpp/lite/arm/portal/release1039
also, check out this thread
http://forum.xda-developers.com/showthread.php?t=1123643
Hmm but the readme says "Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI." not ARM GNU/linux.... Is that just wrong? And what exactly is the difference?
(I actually did get the 2009 version, not the 2006 one I linked to.)
Thanks for the supercurio hint; very useful. I wish this stuff was in the wiki rather than in random forum threads though. Forums don't make for a good reference or learning format.
Timmmmmm said:
Hmm but the readme says "Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI." not ARM GNU/linux.... Is that just wrong? And what exactly is the difference?
(I actually did get the 2009 version, not the 2006 one I linked to.)
Thanks for the supercurio hint; very useful. I wish this stuff was in the wiki rather than in random forum threads though. Forums don't make for a good reference or learning format.
Click to expand...
Click to collapse
Well, based on what is in the make file you should use the one I linked
CROSS_COMPILE ?= /opt/toolchains/arm-2009q3/bin/arm-none-linux-gnueabi-
I just compiled modules not whole kernel but the linux-gnu toolchain was the one which compiled a usable result and not the one that is in readme. That is sure.
richyy74 said:
I just compiled modules not whole kernel but the linux-gnu toolchain was the one which compiled a usable result and not the one that is in readme. That is sure.
Click to expand...
Click to collapse
Figured that would happen, I am trying the recommended one right now to see if it works, guessing I will have the same outcome.
edit: boots up just fine actually...
so, what is the right one ?!
Maybe both work? I dunno, anyway the linux one worked for me, and the kernel is over a MB smaller than the samsung one... weird.
Timmmmmm said:
Maybe both work? I dunno, anyway the linux one worked for me, and the kernel is over a MB smaller than the samsung one... weird.
Click to expand...
Click to collapse
Samsung only uses gzip, guessing you enabled LZMA.
I wouldn't use samsung recommended on, I am getting sleep death with it.
No I'm using gzip (or possibly even no compression, I can't remember). It booted fine but wifi and the vibrator didn't work. Weird 'cause the modules are definitely in there. Maybe it has something to do with the CONFIG_DEBUG... options that shouldn't be set.
Timmmmmm said:
No I'm using gzip (or possibly even no compression, I can't remember). It booted fine but wifi and the vibrator didn't work. Weird 'cause the modules are definitely in there. Maybe it has something to do with the CONFIG_DEBUG... options that shouldn't be set.
Click to expand...
Click to collapse
Read that thread I link above, that is the fix...
Code:
HOW TO BUILD KERNEL 2.6.35 FOR GT-I9100
1. How to Build
- get Toolchain
Visit http://www.codesourcery.com/, download and install Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI.
Extract kernel source and move into the top directory.
$ toolchain\arm-eabi-4.4.0
$ cd kernel/
$ make c1_rev02_defconfig
$ make
After looking at this a bit closer. Sourcery G++ Lite 2009q3-68 toolchain for ARM EABI is 4.4.1, not 4.4.0.. I think we should send an email and ask them what is correct.
hello guys!i'm asking for your help if it is possible!i am from the galaxy Y forum.i saw that you are good developers and i was wondering if anyone of you can make a custom kernel for our device with just a few mods.someone tried but with not succes and we dont have devs to do that.please help!!!!thanks

[Help] Dev help/tutorial needed for a kernel

I am currently trying to learn how to modify a kernel. Unfortunately, I cannot find ANYTHING that explains any of the files in the kernel source. I would greatly appreciate if someone would fill me in or show me where I can find any information on the subject.
Thank you in advance!
Sent from my PG86100 using XDA App
lyon21 said:
I am currently trying to learn how to modify a kernel. Unfortunately, I cannot find ANYTHING that explains any of the files in the kernel source. I would greatly appreciate if someone would fill me in or show me where I can find any information on the subject.
Thank you in advance!
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
Google search is your best friend.
Compiling kernels from source isn't the hardest thing to do but cooking your own is a whole diff story. Heres a few suggestions!
You need to run a linux distro or run in a virtual box (if in windows or mac); I run ubuntu and Fedora.
Get familiar with github dude.
Learn linux basic commands.
Gbhil wrote this guide a while back so it will show outdated software but its pretty damn accurate. (just to give some insight)
http://forums.androidcentral.com/ht...how-build-your-own-kernel-package-source.html
I suggest following this guide:
Its for the EVO 4G so dont download the tar its telling you to DL, you need to get the EVO 3D kernel source.
http://htcevohacks.com/htc-evo-hacks/how-to-build-your-own-htc-evo-4g-android-kernel/
With a few variations
First clone the repository you want to build off of (Also, all of this needs to be done on a linux box or in a virtual machine running linux) You need to fork a repo from github of your fav kernel.
For example, to clone:
git clone git://github.com/insertkernelhere.git
cd insertkernelhere
Then you need a cross compiler for ARM, which is explained in the guide.
And the guide also explains menuconfig and building the kernel.
Kernels explained.
http://androidforums.com/evo-4g-all-things-root/278898-android-partitions-kernels-explained.html
You need to visit square one.
http://developer.android.com/guide/basics/what-is-android.html
For learning purposes: The anatomy of the linux kernel.
http://www.ibm.com/developerworks/linux/library/l-linux-kernel/
And last, Kernel Newbies!!! Great place for aspiring linux kernel devs
http://kernelnewbies.org/
Thats about all I got man, its alot but every question you have should be hanging around one of these links. You will have to dig around, read around, and browse around. Good luck
dirkyd3rk said:
Google search is your best friend.
Compiling kernels from source isn't the hardest thing to do but cooking your own is a whole diff story. Heres a few suggestions!
You need to run a linux distro or run in a virtual box (if in windows or mac); I run ubuntu and Fedora.
Get familiar with github dude.
Learn linux basic commands.
Gbhil wrote this guide a while back so it will show outdated software but its pretty damn accurate. (just to give some insight)
http://forums.androidcentral.com/ht...how-build-your-own-kernel-package-source.html
I suggest following this guide:
Its for the EVO 4G so dont download the tar its telling you to DL, you need to get the EVO 3D kernel source.
http://htcevohacks.com/htc-evo-hacks/how-to-build-your-own-htc-evo-4g-android-kernel/
With a few variations
First clone the repository you want to build off of (Also, all of this needs to be done on a linux box or in a virtual machine running linux) You need to fork a repo from github of your fav kernel.
For example, to clone:
git clone git://github.com/insertkernelhere.git
cd insertkernelhere
Then you need a cross compiler for ARM, which is explained in the guide.
And the guide also explains menuconfig and building the kernel.
Kernels explained.
http://androidforums.com/evo-4g-all-things-root/278898-android-partitions-kernels-explained.html
You need to visit square one.
http://developer.android.com/guide/basics/what-is-android.html
For learning purposes: The anatomy of the linux kernel.
http://www.ibm.com/developerworks/linux/library/l-linux-kernel/
And last, Kernel Newbies!!! Great place for aspiring linux kernel devs
http://kernelnewbies.org/
Thats about all I got man, its alot but every question you have should be hanging around one of these links. You will have to dig around, read around, and browse around. Good luck
Click to expand...
Click to collapse
Thank you very much! I would push the thanks button but I'm on my phone. Will do it when I get on the computer next time.
Sent from my PG86100 using XDA App

Categories

Resources