Compiling kernel 3.4 on debian
The steps are the usual ones. At this point compiling your kernel is perhaps more of a hobby than a necessity to most people, unless you happen to have some fancy piece of hardware that’s about to become supported.

It’s not difficult, so there’s no reason not to give it a spin.

– Start Here –
sudo apt-get install kernel-package fakeroot build-essential

mkdir ~/tmp
cd ~/tmp
tar xvf linux-3.4.tar.bz2
cd linux-3.4/
cat /boot/config-`uname -r`>.config
make oldconfig

If your current kernel is 3.3.5 the questions that await are given at the bottom of this post with links to descriptions of the different options. As usual, if in doubt, just hit enter.

make-kpkg clean

Building takes ages (depending on number of cores committed), so don’t launch it at 4 pm on a Friday if you need to shut down your computer before going home… As usual, use the -jX switch for parallel builds, where X is the number of cores+1 (i.e. 4 cores => -j5)

The following command goes on a single line
time fakeroot make-kpkg -j5 –initrd –revision=3.4.0 –append-to-version=-amd64 kernel_image kernel_headers

Once the build is done, move the .deb files out of the way and to your linux-3.4 directory for safe-keeping
mv ../*3.4.0*.deb .
sudo dpkg -i *.deb


The image weighs in at about 33 Mb and the headers at 7.6 Mb
And compile time? Well, not too bad:

real 34m51.027s
user 73m35.644s
sys 15m9.169s

Pour la console système

kernel : vga=

Colors ( depth) 640×480 800×600 1024×768 1280×1024 1600×1200 —————+——-+——-+——–+———+———

256 ( 8 bit)| 769 771 773 775 796

32,768 (15 bit)| 784 787 790 793 797

65,536 (16 bit)| 785 788 791 794 798

16.8M (24 bit)| 786 789 792 795 799

viaShrimpWorks » Change your console resolution and colour depth.

Build cross-compiled kernel debian package

Par Jérôme Pouiller le vendredi, octobre 29 2010, 09:37 – Lien permanent

As you may know, you have juste to add options ARCH and if necessary CROSS_COMPILE to command line:

make ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- XXX_defconfig

make ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- XImage

My primary concern is to compile an x86 32bits kernel in 64bits environement. So my compilation line is:

make ARCH=i386 i386_defconfig

make ARCH=i386 bzImage

As you also may know, rule deb-pkg of kernel Makefile is able to create a debian package. You should use fakeroot to be able to create package with a non-root user:

fakeroot make deb-pkg

Nevertheless, it will always create a package for current architecture. So this line will create a package for powerpc:

fakeroot make ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- deb-pkg

To correct this behavior, you can use DEB_HOST_ARCH variable:

fakeroot make DEB_HOST_ARCH=powerpc ARCH=powerpc CROSS_COMPILE=ppc-linux-gnu- deb-pkg

To summary, to quickly create an x86 32bits kernel debian package in 64bits environement. I do:

mkdir build

make ARCH=i386 O=build i386_defconfig

fakeroot make -j4 DEB_HOST_ARCH=i386 ARCH=i386 O=build deb-pkg

viaBuild cross-compiled kernel debian package –

Run this script in the top level linux kernel source directory tree:

export DISTCC_HOSTS="localhost"
export CCACHE_PREFIX="distcc"
export PATH="/usr/lib/ccache:$PATH"

BUILD_NICE="nice -19"
BUILD_MAKE="make-kpkg --rootcmd fakeroot --append-to-version -mykernel-$(hostname) --revision $(date +'%Y%m%d%H%M')"

BUILD_TARGET="kernel_image kernel_headers modules_image"


viaSimple Script to Build Linux .deb Package Using make-kpkg, distcc, and ccache.