From: Ulrich Dangel Date: Sun, 8 Jan 2012 11:25:00 +0000 (+0100) Subject: Support 9p-virtio filesystem for mounting the DCS-directory. X-Git-Tag: v0.9.47~1 X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=122114fc5d2828993afc44c17b5c5f5069b44cff;ds=inline Support 9p-virtio filesystem for mounting the DCS-directory. 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 --- diff --git a/autoconfig.functions b/autoconfig.functions index 23eee82..5a25040 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1512,6 +1512,17 @@ else 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