Introduction, ah it will be boring, skip below first screenshot to get the kernel compilation how to.
But if you have time to read and patience to hear, good luck with the following paras, :)
After long time, I am finding a bit of free time and used my leisure time to build i7 optimized kernel, recorded every command into script, install and test and create this article for later reference for anyone who would wish to build/play around with kernel ... and know what?
I followed my own earlier
article to build this kernel, why not?
My memory is not unlimited and after many tries with Ubuntu, Fedora, Kubuntu and in between some heavy office work, some boring books to read from libraries (due to due dates), exploring my xperia phone with ics updates, fixing my windows 7 which gobbled a whole day, updating my friends galaxy s2 to ics, googling cars, visiting relatives, spending my time in doctors lobby and much more day to day stuff ...
My linux sense triggered again to build and play with Kernel 3.4
This time, I do not have Ubuntu (sorry Unity I am damn confused how to use it)
It hardly matters, I have a better Ubuntu which is Mint 13 with Cinnamon. Now the base is Ubuntu 12.04 and everything related to kernel compilation is same to my happiness.
I have been too lazy to touch Mint and build kernel, as it is quite stable and does not give me problems to look inside or play around. But hey, I am not going to let Mint spoil my geekiness
Here I come, Mint, to shatter your stability and perched laziness by pushing my custom built kernel into you to displace your rock stable kernel
Come on gutsy guys, if you dare, you could get yourself into kernel compilation voyage. If you are faint hearted, be happy with Mint 13 default, do not even touch it
Read ahead, buf if you are impatient to build and try the fruits of my efforts, scroll down to the bottom and you have the download links. This time I tried google drive for sharing and it should be easy to download (tell me if you like)
Straight to the point, here is the Mint 13 screenshot showing new kernel running
To build Kernel 3.4.4 in Mint13 or Ubuntu 12.04 yourself follow this steps
- Install Build dependencies
- Download Kernel 3.4.4 and Ubuntu patches
- Extract and apply Ubuntu patches
- Create i7 flavour and tweak kernel config for i7 flavour
- Tweak Makefile for optimizing
- Build
- Optionally install xorg x-swat ppa and upgrade
- Reboot and Test
I will try to explain each step in this article
Install build dependencies
Execute these apt-get commands as a sudo user from terminal
sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge libncurses5 binutils-dev libelf-dev libdw-dev libnewt-dev libncurses5-dev
sudo apt-get install flex
sudo apt-get install bison
sudo apt-get --no-install-recommends install asciidoc xmlto
Optional: GCC 4.7 in Ubuntu 12.04 or Mint 13
If you want to build using gcc 4.7 then follow these steps to install gcc 4.7 in Ubuntu 12.04 from PPA
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.7
sudo apt-get install g++-4.7
Download Kernel sources and Ubuntu patches
You could download the kernel 3.4.4 sources from
kernel.org and Ubuntu patches for kernel 3.4.4 from
kernel ppa directory
If you prefer not to worry downloading individually, you could just copy and paste these commands in command line and let wget do the downloading job for you
mkdir Builds
cd Builds
wget -c http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.4.4.tar.bz2
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4.4-quantal/0001-base-packaging.patch
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4.4-quantal/0002-debian-changelog.patch
wget -c http://kernel.ubuntu.com/~kernel-ppa/mainline/v3.4.4-quantal/0003-default-configs.patch
Here is a screenshot showing how I got the download links of ppa for wget, you would not need this if you just use wget given above
Here is a screenshot showing efficient wget completion of sources and ubuntu patches
You could use gui to unzip the bz2 kernel tarball, but if you prefer command line, use the following command
Create a soft link for the extracted folder and change to the linux folder using cd
From the terminal do the following from inside the linux folder, see previous step to know what I mean as linux folder
Before creating a new kernel flavor, we give execute permissions for the build scripts
copy existing config from rock stable 12.04 kernel using uname -r, do not save it in .config, as this file is heavily modified when calling editconfigs