Support 9p-virtio filesystem for mounting the DCS-directory.
authorUlrich Dangel <mru@grml.org>
Sun, 8 Jan 2012 11:25:00 +0000 (12:25 +0100)
committerUlrich Dangel <mru@grml.org>
Sun, 8 Jan 2012 12:48:36 +0000 (13:48 +0100)
This patch allows to use exported directories via 9p-virtio to be used as
DCS-directory. This allows customization of standard Grml ISO images in
virtualized environments without the need to adjust anything or create
specialized blockdevices/floppy images.

For a short introduction about using 9p with qemu/kvm see
http://wiki.qemu.org/Documentation/9psetup

autoconfig.functions

index 23eee82..5a25040 100755 (executable)
@@ -1512,6 +1512,17 @@ else
         fi
       fi
       DCSDEVICE=$(blkid -t LABEL=$GRMLCFG | head -1 | awk -F: '{print $1}')
         fi
       fi
       DCSDEVICE=$(blkid -t LABEL=$GRMLCFG | head -1 | awk -F: '{print $1}')
+
+      modprobe 9p 2>/dev/null || true
+      if [ -z "$DCSDEVICE" ] && grep -q 9p /proc/filesystems ; then
+          if grep -q "$GRMLCFG" /sys/bus/virtio/devices/*/mount_tag 2>/dev/null ; then
+            einfo "Found 9p-virtio fs with mount_tag $GRMLCFG"
+            DCSDEVICE="$GRMLCFG"
+            MOUNTOPTIONS="ro,trans=virtio"
+            DCSFS="9p"
+          fi
+      fi
+
       if [ -n "$DCSDEVICE" ]; then
         DCSMP="/mnt/grmlcfg"
       fi
       if [ -n "$DCSDEVICE" ]; then
         DCSMP="/mnt/grmlcfg"
       fi