# [solved] genkernel initramfs virtio problem

## HRH_H_Crab

For some time I've been using genkernel to build my gentoo kvm guest kernels.

I cannot remember exactly how I did it, but I managed to get it to build virtio_blk and virtio_net into the initramfs.

Sadly for some reason I cannot understand it has stopped doing this, and I can't get the guests to boot.

I've already added: 

```
MODULES_KVM="virtio virtio_balloon virtio_ring virtio_pci virtio_blk virtio_net
```

 to /etc/genkernel.conf but it does not seem to want to play ball. I wonder if someone could refresh my memory?Last edited by HRH_H_Crab on Mon Jul 18, 2011 10:28 am; edited 1 time in total

----------

## BradN

As a workaround you could consider including these statically in the kernel - I think genkernel gives a way to invoke menuconfig and do your own changes.  I don't use genkernel so unfortunately I can't offer better advice.

----------

## jormartr

Append this to kernel boot options:

```
doload=virtio_pci,virtio_blk
```

----------

## HRH_H_Crab

@ BradN at: least one of them seems to want to be a module (that is to say that while it is possible to build them in using the --menuconfig option they don't work properly).

@ jormatr: I have that set in my grub.conf for the new kernel but it doesn't seem to work. What is more, I never seemed to need it before.

----------

## jormartr

Please, could you write the boot entry in /boot/grub/menu.lst ?

----------

## HRH_H_Crab

Here are two lines from menu.lst:

```

title=Gentoo Linux (2.6.39-gentoo-r3)

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-2.6.39-gentoo-r3 raid=noautodetect root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/vda3 console=tty0 console=ttyS0,9600n8

initrd /boot/initramfs-genkernel-x86_64-2.6.39-gentoo-r3 doload=virtio_pci,virtio_blk

title Gentoo Linux 2.6.37-r4 - Genkernel

root (hd0,0)

kernel /boot/kernel-genkernel-x86_64-2.6.37-gentoo-r4 raid=noautodetect root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/vda3 console=tty0 console=ttyS0,9600n8

initrd /boot/initramfs-genkernel-x86_64-2.6.37-gentoo-r4

```

Note the first (2.6.39-gentoo-r3) is the one which fails to scan for the modules, and therefore won't boot.

The second one works fine (note that it actually doesn't contain the "doload" argument).

This leads me to suspect that the "doload" argument is not required (unless something has changed which I am not aware of).

Edit: as you can see I had the "doload" argument in the wrong place. I placed it after the "kernel" line and before the "initrd" line.

I still don't understand why it is needed for this kernel version though - you can see it wasn't there for the previous one which works o.k.

Anyway, thanks for your help.

----------

