Long Live Open Source Software !!

Hello guys, it’s been a long time since my last post.  I have many ideas to be written to this blog, but i didn’t know which one should be published first.

Just now, i’ve been working with User Mode Linux again. But now, it is easier to set up server as UML host. You just have to patch your host kernel with SKAS patch and install user-mode-linux and uml-utilities package from the repository. With user-mode-linux package, you will get a linux executable. For simple use, it is enough. But i found a problem when i want to add ip_vs module into my kernel. So i must compile my own linux kernel executable. And the bad thing is i forgot how to do that :mrgreen:. Because of that, i make this post, so i can remember it whenever needed.

First thing to do is download the kernel source from repository. I recommend using debian to compile the source and run the UML. Because when i used ubuntu, i got many unknown error and kernel panic when running the UML. After downloading the kernel source, it must be located in /usr/src.

Go to directory /usr/src and extract the kernel source tarball with command :

tar -xjvf linux-source-2.6.26.tar.bz2

Open the kernel source directory and open Makefile, edit line that look like below as your need

VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 26
EXTRAVERSION =

Next thing to do is configure the kernel. Just run this command :

make ARCH=um menuconfig

Config it to suit your needs. If you have finished, run this command to make kernel executable :

make ARCH=um linux

If you have some modules that need to be installed, you can compile your modules with this command :

make ARCH=um modules

After that you must install the newly created modules to a directory :

mkdir mymods
make ARCH=um modules_install INSTALL_MOD_PATH=/usr/src/linux-source-2.6.26/mymods

To finish your kernel installation, copy the installed modules to your root_fs /lib/modules directory.If you feel that the ‘linux’ executable file size is very big, you can make it smaller with this command :

strip linux

Hope this guide will help you.

Enhanced by Zemanta
Be Sociable, Share!

Maybe you like this post too :