- Nov 1, 2010
- 246
- 24
- 0
Ok ,so i got a few requests on how to compile a kernel. Its fairly easy, but you MUST know what you are doing, or else you can make a bad kernel, that wont boot or will run like bad.
The first thing we want is to make sure java is installed. Just enter this into your terminal:
FOr 64 bit sustems, you also have to enter this in your terminal after the previous command finished running:
Ok, now we want to set up the proper build environment for our kernel. For the sake of time, we will use the easy method for now. Download the toochain here: github.com/jdkoreclipse/toolcain and renaame the first folder (the one that says jdkoreclipse_toolchain with all the numbers) to system and extract it into a directory on your home folder called android. You have now completed step one of the build environment setup.
Now to grab the source. Grab whosever source you want. CM kernel source, HTC kernel source, or even someone else's source. Once you grab your desired source, unpack it at a directory called kernel (name it whatever you want, but for the sake of this tutorial, we will keeep the default directory kernel).
Ok, now that we have our source set up, now to do the compiling. First, we need to complete our build environment. Just run this command to do that:
Now that we setup the toolchain, now to do the real stuff. First, we want to modify any code within the source. Next, we want to
make the kernel configuration. To do that just run
(on my kernel its jdkoreclipse_defconfig and on cyanogen's its cyanogen_incrediblec_defconfig). Now to set out preferences for some kernel specific features. RUn:
and once your done editing that, save your configuration and run:
to make your kernel. Your zimage will be at arch/arm/boot. And your modules will be in a few directories (there will be a list in the top of your kernel tree). If i was you, i would zip up the kernel and the modules into an anykernel, but thats my preference.
The first thing we want is to make sure java is installed. Just enter this into your terminal:
Code:
sudo apt-get install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
FOr 64 bit sustems, you also have to enter this in your terminal after the previous command finished running:
Code:
sudo apt-get install ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
Ok, now we want to set up the proper build environment for our kernel. For the sake of time, we will use the easy method for now. Download the toochain here: github.com/jdkoreclipse/toolcain and renaame the first folder (the one that says jdkoreclipse_toolchain with all the numbers) to system and extract it into a directory on your home folder called android. You have now completed step one of the build environment setup.
Now to grab the source. Grab whosever source you want. CM kernel source, HTC kernel source, or even someone else's source. Once you grab your desired source, unpack it at a directory called kernel (name it whatever you want, but for the sake of this tutorial, we will keeep the default directory kernel).
Ok, now that we have our source set up, now to do the compiling. First, we need to complete our build environment. Just run this command to do that:
Code:
export CCOMPILER=${HOME}/android/system/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Now that we setup the toolchain, now to do the real stuff. First, we want to modify any code within the source. Next, we want to
make the kernel configuration. To do that just run
Code:
make incrediblec_defconfig
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER menuconfig
Code:
make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
Last edited: