[Help] Dev help/tutorial needed for a kernel - HTC EVO 3D

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

Related

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...

Linux 4 Tegra released!

It has been released on June the 26th!
It can be found at this url.
That information seems to be quite good.
From what I understand, binaries from NVidia contain 2.6.38 kernel with Tegra 2 drivers.
Does anyone here knows if this has any chance of working on Folio 100 ?
Could this kernel be usefull for HC releases ?
Thanks !
It cannot be used as is. Btw I'll give it a try just to experiment.
I downloaded also all the source code from nvidia and'ill try to compile it adding some drivers to handle the touchscreen.
Hey thanks roglio, that's a good source of information. I will give it a try as well, but probably not in these few weeks
Im very interested in using this. I dont have any experiance with making my own rom tho, so i have to go and try to find some recources on that first. If you guy's has a link for me ill be very gratefull
Sent from my Folio 100 using XDA Premium App
Moved to proper forum.
shidima_101 said:
If you guy's has a link for me ill be very gratefull
Click to expand...
Click to collapse
Nvm, after some proper reading on my part, it seems that there is a document there that will help you get it up and running...
After a quick read of the supplied doc's, it seems to me that this is more or less the same way to get linux working as was posted previously. They make an ubuntu disk image and flash a kernel and boot files to load the image from a sdcard. The only diffrence here is that you have "official" drivers for the board.
Yes, you're right and consider that is nvidia in person to release this material.
Maybe we will get ubuntu before honeycomb in the meantime that google release ice cream (with source code).
shidima_101 said:
After a quick read of the supplied doc's, it seems to me that this is more or less the same way to get linux working as was posted previously. They make an ubuntu disk image and flash a kernel and boot files to load the image from a sdcard. The only diffrence here is that you have "official" drivers for the board.
Click to expand...
Click to collapse
Atm I'm very busy at the damn work and I can't get the time to try. But be sure I'll spend each minute of the upcoming weekend to work on it!!!!
roglio said:
Yes, you're right and consider that is nvidia in person to release this material.
Maybe we will get ubuntu before honeycomb in the meantime that google release ice cream (with source code).
Click to expand...
Click to collapse
I'm more interested in getting arch up and running than ubuntu
xitrumch said:
I'm more interested in getting arch up and running than ubuntu
Click to expand...
Click to collapse
To get arch running you need to get a file system image similar to the Ubuntu one that nVidia is suggesting. You also need a Arch arm kernel. If I don't forget ill try to look into it
[edit]
Ok, after a quick search I found an Arch arm site and on the forum they have a guide on installing on an ac100, that as far as i know is the folio 100 with a keyboard. (Right?)
http://archlinuxarm.org/forum/viewtopic.php?f=27&t=1626&sid=72ac121c87b9c825454207acde727e67
[/edit]

[Q] Regarding the Android kernel

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

There is no real guide for porting roms!

I've tried porting several roms to my devices and every time I try to flash I always get status 0 or some type of error! I can't logcat from recovery because some things do not work completely with clockworkmod I have. I even manually tried porting the same method that android kitchen does and still run into the same problem. I have no idea what I should try next? This is really making me made. I get no help at all after searching and searching every where!
android kitchen
http://forum.xda-developers.com/showthread.php?t=633246
all in one guide
http://forum.xda-developers.com/showthread.php?t=1273718
And some other methods and still no luck!!
You are right. There is no guide. It's trial and error. Logcat helps and if you know what certain files do that helps too.
It's simple:
grab the sources from github, add your device and vendor folder, add the device to the list in the mk files, lunch, and build.
openetna is a repository with many bugfixes, as you will have them.
Easy ****!
mDroidd said:
It's simple:
grab the sources from github, add your device and vendor folder, add the device to the list in the mk files, lunch, and build.
openetna is a repository with many bugfixes, as you will have them.
Easy ****!
Click to expand...
Click to collapse
Thats great if building from source
but i think he is talking about porting roms that are not AOSP.
The problem with a porting tutorial is that all devices and roms are a bit different so there will never will be a tutorial to get this done 100%. They are great guides to give you a start but it can take a lot more to get things ported.
if the device architecture is similar
Ex... Evo 4g to Incredible
than porting is fairly easy
being able to logcat is very necessary when porting roms
getting that working is your first step.
I always gave up on porting just because i dont have the patients to do it.
Exactly. I've ported several roms from the E3D and Sensation to the Rezound, and they are easy because the processor is the same. All you really need to get it booting is the kernel in most cases.
mDroidd said:
It's simple:
grab the sources from github, add your device and vendor folder, add the device to the list in the mk files, lunch, and build.
openetna is a repository with many bugfixes, as you will have them.
Easy ****!
Click to expand...
Click to collapse
Not that simple if you have to make a device tree from scratch like I'm doing
I've a question!!
I have an HTC Explorer (based on Qualcomm MSM7227) and I'd like to build a rom (AOSP or Cyano)...
I've downloaded Kernel Source Code but after hours of researches I haven't found a guide for merge a rom with a kernel..
can you help me?
thank you!
Can we port a rom from HTC desire to Motorola defy....is it easy??
HIT THANKS IF IVE HELPED
extremists said:
Can we port a rom from HTC desire to Motorola defy....is it easy??
HIT THANKS IF IVE HELPED
Click to expand...
Click to collapse
That's about as hard as it gets.
Unless building from source its not as difficult.
Sent from my PG86100 using Tapatalk
wes342 said:
That's about as hard as it gets.
Unless building from source its not as difficult.
Sent from my PG86100 using Tapatalk
Click to expand...
Click to collapse
Do u know how to port??
HIT THANKS IF IVE HELPED
The thing is there's also no real guide on how to make your own public repo for devices who don't have one .
E.g. Galaxy R
Herpderp Defy.
So I found out how to build from cm7 sources and it is a no go... I do not know how in the world you guys can port any roms. How do you get your files up on git hub any way? There is more to it then just compiling from cm sources..
Here's a slightly outdated one
EmoBoiix3 said:
The thing is there's also no real guide on how to make your own public repo for devices who don't have one .
E.g. Galaxy R
Herpderp Defy.
Click to expand...
Click to collapse
Just so its clear... this (slightly outdated) guide would be (the best I've found) for building a device tree (that you may elect to throw up on github) that can be used to build AOSP.. the same device tree probably could build CyanogenMod or MIUI fairly easily (minimal editing) but you are correct... no exact guide bc its not an exact science (lots of different devices out there with lots of different device configurations; even kernels different some are ti omap, some are qualcomm msm, etc.). Basically you build a tree to define your hardware.. AOSP, CM or MIUI will build themselves based on this definition (device) tree.
http://www.kandroid.org/online-pdk/guide/build_new_device.html
Now after you follow this guide, google the various build errors you get (one at a time) and perfect your tree until you get basic bring up... then perfect it some more until you get all your modules working (will take some aosp kernel cooking as well)... then perfect it some more... in a few months you should have something pretty decent (and learn tree building a bit more; we all learn by doing ) Best advice I have for you; going through the same thing myself.
Also wouldn't be a bad idea to download Hardware Info apk (Sleek Apps) and email yourself the info it spits out. That way you at least have a list of some of the hardware you are trying to define.
Rob
mDroidd said:
It's simple:
grab the sources from github, add your device and vendor folder, add the device to the list in the mk files, lunch, and build.
openetna is a repository with many bugfixes, as you will have them.
Easy ****!
Click to expand...
Click to collapse
How exactly do you do this? How do you build it completely specifically for your device?
Sorry, I'm a complete noob on building from scratch and Linux. Could anyone shed some some light?
Thanks you guys

Categories

Resources