virt-p2v-make-disk and -make-kickstart should add firmware files to the virt-builder image. I'm trying to build a USB key to migrate a physical machine with an Adaptec SAS controller that needs aic94xx firmware. I added "--run-command "yum -y groupinstall 'Hardware Support'" to the -make-disk script (which of course is Fedora specific).
This patch (only lightly tested) should fix it: https://github.com/libguestfs/libguestfs/commit/91788cd76f23227c102293a5dc5eef1c30cf7858
Another hardware-related note (let me know if I should instead open a new ticket): I put the disk image I built on a USB key, but it won't complete boot because dracut doesn't include the usb-storage kernel module by default (so it never finds the root filesystem). I fixed this by adding an uploaded file to the virt-builder call to put this in /etc/dracut.conf.d/local.conf: add_drivers+=" usb-storage " Of course, this will only take effect if the virt-builder --update call installs a new kernel (which it does now, but wouldn't do right after an OS release). The scripts might need to manually rebuild the initramfs to make sure. Also, the pre-built Fedora 20 image (at least) sets a serial console by default in grub.conf (don't know if affects the actual running, I just noticed it while debugging).
One additional note on the firmware: I think the --install (that adds the firmware) should be done before the --update. This is because otherwise the necessary firmware doesn't end up in the dracut-built initramfs (so the aic94xx module loads during dracut stage, can't find the firmware, and fails).
(In reply to Chris Adams from comment #2) > Another hardware-related note (let me know if I should instead open a new > ticket): I put the disk image I built on a USB key, but it won't complete > boot because dracut doesn't include the usb-storage kernel module by default > (so it never finds the root filesystem). I fixed this by adding an uploaded > file to the virt-builder call to put this in /etc/dracut.conf.d/local.conf: > > add_drivers+=" usb-storage " > > Of course, this will only take effect if the virt-builder --update call > installs a new kernel (which it does now, but wouldn't do right after an OS > release). The scripts might need to manually rebuild the initramfs to make > sure. Try this commit: https://github.com/libguestfs/libguestfs/commit/7a6d44ebfe23f28f46f6af1fd48ea8371473529b I don't have a module called "usb-storage" and I can't find it anywhere, so this change has no effect for me. > Also, the pre-built Fedora 20 image (at least) sets a serial console by > default in grub.conf (don't know if affects the actual running, I just > noticed it while debugging). It should send messages to both the serial port and the VGA console. If it's not doing that, then it would be a (separate) bug. However this works for me under virtualization. (In reply to Chris Adams from comment #3) > One additional note on the firmware: I think the --install (that adds the > firmware) should be done before the --update. This is because otherwise the > necessary firmware doesn't end up in the dracut-built initramfs (so the > aic94xx module loads during dracut stage, can't find the firmware, and > fails). The patch above runs dracut last, so hopefully it will include everything that has been installed, and work in the "new release, no kernel update" case you mention above.
(In reply to Richard W.M. Jones from comment #4) > (In reply to Chris Adams from comment #2) > > Another hardware-related note (let me know if I should instead open a new > > ticket): I put the disk image I built on a USB key, but it won't complete > > boot because dracut doesn't include the usb-storage kernel module by default > > (so it never finds the root filesystem). I fixed this by adding an uploaded > > file to the virt-builder call to put this in /etc/dracut.conf.d/local.conf: > > > > add_drivers+=" usb-storage " > > > > Of course, this will only take effect if the virt-builder --update call > > installs a new kernel (which it does now, but wouldn't do right after an OS > > release). The scripts might need to manually rebuild the initramfs to make > > sure. > > Try this commit: > https://github.com/libguestfs/libguestfs/commit/ > 7a6d44ebfe23f28f46f6af1fd48ea8371473529b Urgh I see that doesn't work because dracut -f builds a module for the running kernel, not the installed kernel. Back to the drawing board ... > I don't have a module called "usb-storage" and I can't find it anywhere, > so this change has no effect for me. Kernel module, not dracut module. OK.
(In reply to Richard W.M. Jones from comment #5) > Urgh I see that doesn't work because dracut -f builds a module > for the running kernel, not the installed kernel. Back to the > drawing board ... Yep, was just about to say that. What about adding the dracut config file before --update, and then running dracut -f at the end? That should cover both cases; if a kernel is installed as an update, the dracut config will kick in then (and the dracut -f at the end wastes a little time but doesn't hurt). If no kernel update is installed, then dracut -f at the end will rebuild for the running kernel (which will be the boot kernel as well). This does also assume dracut is used on all supported OSes (I only know Fedora/RHEL/CentOS).
This should be better: https://github.com/libguestfs/libguestfs/commit/b09b60c987ff113bc4520ab994142da912ffa3d6