Home Home > 2014 > 04 > 30 > Have some fun today… try your new kernel
Sign up | Login

Have some fun today… try your new kernel

April 30th, 2014 by

Last blog was about how to compile openSUSE kernel from GIT. Now we see how to get it up and running in your system. Again word of warning: Changing kernel is always bit of a hardcore trick! Even if it comes from trusted and tested binary from openSUSE (sorry I’m server admin). If you do it by yourself then you are also on your own if your machine won’t boot anymore!

Basics

Understanding how Linux boots read about Linux startup. Basics are like this: you have file name bzImage (vmlinuz) that is bzip2 compressed kernel image and then you have Linux kernel modules. You have to understand that everything can be compiled into Linux kernel (ok nearly nowadays) that is why Linux is called monolithic kernel. Most of the cases that is not how kernel is compiled. You have small boot kernel and then there is plenty of modules besides this bzImage-thing. What are these modules hmm… it’s again bit complicated.
Linux Kernel modules are extensions to Linux kernel. They can be new drivers for webcam, new filesystem or they can be bands album like here. Modules are way to get Linux kernel to minimum size and boot ultra fast. After kernel is kicked alive modules are loaded automaticly by user-space tool udev.

How to get you shiny new Linux kernel working?

Ok let’s do it. Never remove your working binary openSUSE RPM kernel or it’s modules (if you do reinstall them right away back)! If you remove kernel modules it’s most likely that your machine won’ẗ boot. Now you know what not to do.. so let’s see what you can do? You compiled kernel with tutorial that I wrote last time? Then you should have very fancy openSUSE kernel. I assume you are at commandline on same directory where your openSUSE kernel GIT is compiled. Look at directory ‘arch/x86_64/boot/’ (or arch/x86/boot/) with

ls arch/x86_64/boot/

there should be bzImage. Let’s copy it to correct location (after this only root can do these or with sudo-command) and version number you can get from Makefile current is 3.14.1 (but it changes rapidly so check first three line from Makefile if you are unsure) and suffix ‘-desktop’ comes from ‘.config’ file.

cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.14.1-desktop
cp System.map /boot/System.map-3.14.1-desktop

Ok we have kernel in correct place then we have to install modules. Now I have learned in rough way not to use ‘make install’ so we do it like this (you can use any temp directory you like I tend to use ‘/tmp/kernel-install’).

make INSTALL_MOD_PATH=/tmp/kernel-install modules_install
cd /tmp/kernel-install/lib/modules
cp -r 3.14.1-desktop /lib/modules

There is also firmwares but they should be installed by default and remember if you need some outside kernel module they are not build in your new shiny kernel. So if you have some fancy pantsy WIFI or Radeon catalyst you have to compile it afterwards (we see that next time) or you use you searching skills to find out.

cd /boot
mkinitrd -k vmlinuz-3.14.1-desktop -i initrd-3.14.1-desktop
grub2-mkconfig > grub2/grub.cfg 

And I assume you have grub2. If not don’t have you have to figure out this by yourself with YaST. GRUB1 config is /boot/grub/menu.lst if you want to do it by hand. Next time you boot it will try to first boot your new kernel you can choose old kernel from start up menu but that is up to you to discover how. If you end up system that is not booting don’t blame me there is ways to recover but it’s not this blogs agenda (my kind recommendation to have openSUSE live cd around).

What is initrd?

Initrd is for booting. Initrd will be loaded before your harddrive is. There is tools that needed for booting after harddrive is mounted Initrd will step down and kernel start using harddrive. OBS! after 13.1 initrd system will be done with new tool not any more with good old mkinitrd.

Ok now you can play with your new Linux Kernel. There can be new tricks or something can be broken. Have again time and patience as long as you have your old kernel and modules you can boot again.

Both comments and pings are currently closed.

Comments are closed.