Compiling new kernel on Slackware 12.2

I have visited to check the latest version of the Linux kernel. At this writing, version was the latest. So I have downloaded it from here. I wanted to install and test the new features of this kernel. Here are the steps I made to compile and use it.

1. Acquire root privilege
sudo su

2. Download the kernel sources

3. copy the sources to /usr/src
cp ./linux- /usr/src

4. extract the sources
cd /usr/src/; tar xvjf linux-

5. go inside the new linux kernel source directory
cd ./linux-

6. Clean the directory
make clean

7. Make the configuration file or have an old one loaded
make menuconfig

8. If you want to load your old kernel’s config file, scroll at the buttom of the screen and choose Load an alternative Configuration File
and type the location of your old configuration file

9. When the config is loaded, check other kernel settings you might want to change, and enable or disable a module by selecting it from the list. The configuration file you have just loaded works since it was the one included in your distro, so if you want new features then scroll and select it from the list.

10. After selecting the features you wanted to compile or added as a module, go to the exit at the buttom of the page, then click ok to exit the menuconfig.

11. Make the kernel

12. Install the kernel
make install

12. Make the kernel image
make bzImage

13. Make and install the modules
make modules && make modules_install

14. copy the new image to /boot
cp ./arch/i386/boot/bzImage /boot/vmlinuz-
and your config to /boot
cp .config /boot/config-

15. Create an initial ramdisk. (change the ext3 to whatever file system you use and the device file in which your root partition resides. In my case, my / is on device /dev/sda5)
mkinitrd -c -k vmlinuz- -m jbd:ext3 -f ext3 -r /dev/sda5

16. After the mkinitrd command, it will generate /boot/initrd.gz. If you want, you can change your initrd.gz name.
mv /boot/initrd.gz /boot/initd-

17. Edit your /etc/lilo.conf and add new entries at the buttom. Don’t remove the old settings so you would have a fallback.
Add these lines. Change the root value to the device for your / partition. You can also change the label.
image = /boot/vmlinuz-
initrd = /boot/initrd-
root = /dev/sda5
label = Linux-

18. After saving your lilo.conf, install it.

19. Restart your computer

Then on the bootsplash screen, select your new kernel and If you're lucky, it will work!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s