Jump to content

how to make a custom kernel from debian based distribution

Recommended Posts

rebuilding the kernel is easier as you may think...first you need a cross compile environment if you want to do compile it from your x86 machine.

I recommend you to use any debian distribution as ubuntu,linux mint oder debian itself.

under a working debian dist installation you can install the hardfloat cross compiler with the command

Code: [select]

apt-get install gcc-arm-linux-gnueabihf fakeroot autoconf binutils automake
or wth sudo 

Code: [select]

sudo apt-get install gcc-arm-linux-gnueabihf fakeroot autoconf binutils automake
have a look what apt does recommend to install with it and install what you want but you should have all essential.

next step is to download the kernel sources 

you can do this by git but for a simple kernel rebuild i recommend you to download the actual zipfile of kernel 3.4 sources


or the stage kernel sources


next step is you do unzip it to any desired directory

after that it becomes very simple

first step is to generate a default config file:

Code: [select]

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sun4i_defconfig
you can then start menuconfig with

Code: [select]

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
after you have done your config, you can start the bulding process and making the uImage with:

Code: [select]

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-  uImage modules
if you have a multi core cpu you can speed up things with

Code: [select]

-jas example

Code: [select]

-j 5if you have a dual core, 
here more about makeopt( -j option):

so as example for most i5 cpu, like i use on my build notebook

Code: [select]

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j5 uImage modules
because running the make modules_install command would install the files to your local /lib/modules folder you need to install it to another folder, and copy it to your sdcard partition where the linux rootfilesystem is stored.

Code: [select]

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=output modules_install

uImage needs to be copied to your sdcards fat partition. you find it on your build directory

Code: [select]

thats the way how to do it!

you can find my customized kernel (iptables support was the priory goal) here:


here you find my distribution images for different use, with updated kernel that supports iptables.
root password is empy for all except arch linux where root passwort is root itself


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now