[arch-projects] [MKINITCPIO][PATCH] Add a virtio hook

Sebastien Luttringer seblu at seblu.net
Mon Sep 12 13:15:42 EDT 2011


This allow initcpio to boot vm which use virtio as network/disk backend.

Signed-off-by: Sebastien Luttringer <seblu at seblu.net>
---
 install/virtio  |   14 ++++++++++++++
 mkinitcpio.conf |    2 +-
 2 files changed, 15 insertions(+), 1 deletions(-)
 create mode 100644 install/virtio

diff --git a/install/virtio b/install/virtio
new file mode 100644
index 0000000..b2974a5
--- /dev/null
+++ b/install/virtio
@@ -0,0 +1,14 @@
+build() {
+    MODULES+=" $(checked_modules 'virtio')"
+}
+
+help ()
+{
+cat<<HELPEOF
+  This hook loads the necessary modules for virtio devices.
+  Detection will take place at runtime. To minimize the modules
+  in the image, add the autodetect hook too.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:
diff --git a/mkinitcpio.conf b/mkinitcpio.conf
index d53aabe..ed60682 100644
--- a/mkinitcpio.conf
+++ b/mkinitcpio.conf
@@ -54,7 +54,7 @@ FILES=""
 #
 ##   This setup loads an lvm2 volume group on a usb device.
 #    HOOKS="base udev usb lvm2 filesystems"
-HOOKS="base udev autodetect pata scsi sata filesystems usbinput"
+HOOKS="base udev autodetect pata scsi sata virtio filesystems usbinput"
 
 # COMPRESSION
 # Use this to compress the initramfs image. With kernels earlier than
-- 
Sebastien "Seblu" Luttringer



More information about the arch-projects mailing list