Notes on compiling linux kernel 3.8.8 on Ubuntu 12.04.
Installing Dependent Packages
If you plan to do ‘make xconfig’, you’ll need qt3-dev-tools and libqt3-mt-dev. If you plan to do ‘make menuconfig’, you’ll need libncurses5 and libncurse5-dev. Here, I’ll install everything for now.
sudo apt-get update
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev linux-source qt3-dev-tools libqt3-mt-dev libncurses5 libncurses5-dev fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge kernel-package
Obtaining Kernel Source
Next, get the kernel source code from https://www.kernel.org/. At first, I was cloning from github, but it took a lot of time, so I stopped. I just downloaded it to /usr/src and extracted it.
cd /usr/src
sudo wget ftp://ftp.kernel.org/pub/linux/kernel/v3.x/linux-3.8.8.tar.bz2
sudo tar -xjvf linux-3.8.8.tar.bz2
Configuration
In the state where you’ve just gotten the source code, it supports various environments, so it becomes quite large, and compilation takes time, so we’ll select only what’s necessary. First, I reused the configuration I had been using. For newly added options, I’m asked each time.
cd linux-3.8.8
sudo cp /boot/config-3.2.0-24-generic-pae .config
sudo make oldconfig
Next, I configured with ‘make menuconfig’. (‘make xconfig’ is also fine.) Either way, a menu appears and you select the necessary options. If you select “Save Configuration to an Alternate File”, you can save with a different filename and make backups.
- Nothing - Don’t use.
- M - Compile as a module and loaded when needed.
-
-
- Compiled with the kernel and loaded with the kernel.
-
make menuconfig
Compilation
In Debian, instead of ‘make’ and ‘make install’, we compile with ‘make-kpkg’. This method creates .deb packages. It takes quite a while. If you do ’export CONCURRENCY_LEVEL=4’ first, it seems to compile in parallel.
fakeroot make-kpkg --initrd --revision=1.0.bobuhiro11 kernel-image kernel-headers
Installation
When compilation is done and the .deb packages are created, install them. After reboot, they’ll be applied.
sudo dpkg -i linux-image-3.8.8_1.0.bobuhiro11_i386.deb
sudo dpkg -i linux-headers-3.8.8_1.0.bobuhiro11_i386.deb
sudo reboot
# After reboot
uname -r
3.8.8
Honestly, I have no clue about messing with configuration files.
Reference: Compile Linux Kernel on Ubuntu 12.04 LTS (Detailed)