Preparing the Linux Kernel Source
With the source installed and the tools installed, we are ready to start the process of building a custom Linux kernel. This article covers those tasks that need to be performed prior to configuration. The steps are not difficult, but there are variations between distros of Linux.
To simplify the instructions, I created /usr/src/linux as a symbolic link that points to the current kernel source tree. Following are the commands for the seven distros, with which I am working:
$ cd ~ ; su -c"ln -s $PWD/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.i686 \ /usr/src/linux" #CentOS 5.4 $ cd ~ : su -c"ln -s $PWD/rpmbuild/BUILD/kernel-2.6.31/linux-2.6.31.i686 \ /usr/src/linux" #Fedora 12 $ sudo ln -s ~/linux-2.6.31 /usr/src/linux # Linux Mint 8, Ubuntu, Xubuntu $ # Created as part of install on Mandriva 2010, openSUSE 10.2, and SimplyMepis 8.0
After establishing the symbolic link, you need to execute the following commands:
$ cd /usr/src/linux $ make mrproper # removes all work files, including .config. $ cp /boot/config-$(uname -r) .config $ make oldconfig
Notes:
- If you wish to retain the .config file, you need to use ‘make clean’ instead of ‘make proper’.
- While there are other alternatives for creating a .config file, I prefer to start with one that works.
- Although there should not be any difference between the .config file and the configuration options in the source tree, it never hurts to verify that the source does match the running kernel. If they are different, the script will prompt you about how to handle the module. At this point, you can just accept the default.
The .config file is now ready for editing, which is the subject of the next article.



Links 1/3/2010: New Linux Benchmarks ARM Development Studio for Linux | Boycott Novell Said,
March 1, 2010 @ 6:05 pm
[...] Preparing the Linux Kernel Source [...]