Getting a dom0 kernel


Again, you have two main methods of getting a dom0 kernel on Fedora. (I’m sure there are other ways, but these are the recommended methods)

  1. Using a prebuilt dom0 kernel
  2. Compile a dom0 kernel yourself

Using a prebuilt dom0 kernel

It’s a bit behind the latest updates, but Michael Young, a Fedora developer, has been compiling dom0 capable kernels and posting them on his Fedora user page. While he’s been building the kernels against Fedora 12, they should work on later Fedoras. (For info: He’s building the kernel against Fedora 12 because the stable branch of Xen is built against kernel 2.6.32.x, and Fedora 12 is the most recent version of Fedora built against 2.6.32.x)

Compiling a dom0-capable kernel

However, with the periodic lag in releases of a dom0 kernel rpm (Currently there seems to be a lag for a few weeks between releases of an RPM), you might choose to download & compile your own kernel. Now, because we’re compiling from source, you’ll need to grab

yum groupinstall "Development Libraries" "Development Tools"

if you didn’t decide to install Xen from source.

You have 3 main choices of which branch you want to use:

Dev/unstable branch: xen/next-2.6.39

Dev/stable branch: xen/next-2.6.32

Release/stable branch: xen/stable-2.6.32.x

For the purposes of this tutorial, we’re going to use the Release/stable branch.

[[email protected] ~]# git clone git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen.git linux-2.6-xen
Cloning into linux-2.6-xen...
remote: Counting objects: 2039617, done.
remote: Compressing objects: 100% (337851/337851), done.
remote: Total 2039617 (delta 1697484), reused 2023396 (delta 1682548)
Receiving objects: 100% (2039617/2039617), 424.38 MiB | 1005 KiB/s, done.
Resolving deltas: 100% (1697484/1697484), done.
[[email protected] ~]# cd linux-2.6-xen/
[[email protected] linux-2.6-xen]# git checkout -b xen/stable-2.6.32.x origin/xen/stable-2.6.32.x
Branch xen/stable-2.6.32.x set up to track remote branch xen/stable-2.6.32.x from origin.
Switched to a new branch 'xen/stable-2.6.32.x'

Note the xen/stable-2.6.32.x – By changing this, you can select what branch you want to use. Replace it with the respective branches that you want to use.

>> To-do: Need to come up with a suitable .config, maybe even .rpm files <<

Configure the kernel options – run

make menuconfig

Hit ‘/’ and search for “xen”, and make sure the option “XEN_DOM0” is set to yes:

Check that the status of the option "XEN_DOM0" is set to yes

Once that’s done, run make clean to clean any unused files. From there, run

make -j<number of processors> bzImage && make -j<number of processors> modules

where <number of processors> is replaced by the number of processors you have. If you aren’t sure, just put 1.

If that finishes without errors, run

make modules_install

From hereon, it is important to note the kernel version that you built. In this case, I built version 2.6.32.39, so that’s what I’m using. If you’re not sure what you’re using, look at the last line of the earlier step – It should show a version number. If it doesn’t, run make menuconfig, and take note of the title at the top of the window. It should read Linux Kernel v <Version> Configuration.

The next step is to build a list of modules that the kernel needs to load to boot successfully with depmod -a 2.6.32.39

Next, copy over the kernel and related files to /boot:

cp -a arch/x86/boot/bzImage /boot/vmlinuz-2.6.32.39
cp -a System.map /boot/System.map-2.6.32.39
cp -a .config /boot/config-2.6.32.39

Note the version numbers. Change them to reflect the version of the kernel that you built.

Finally, switch to /boot and generate the initial RAM image for booting. Again, change the version number if necessary.

cd /boot
dracut initramfs-2.6.32.39.img 2.6.32.39

Congratulations. You have now configured & compiled your own custom kernel.

  1. No comments yet.
(will not be published)