Jump to content


how to make a custom kernel from debian based distribution

  • Please log in to reply
No replies to this topic

#1 jim


    Advanced Member

  • Administrators
  • 3,385 posts

Posted 14 February 2015 - 10:53 PM

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


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users