From: Ulrich Dangel Date: Mon, 16 Jan 2012 10:40:12 +0000 (+0100) Subject: Try to read grml-autoconfig bootparameters from 9p virtio filesystem. X-Git-Tag: v0.9.49~1 X-Git-Url: https://git.grml.org/?p=grml-autoconfig.git;a=commitdiff_plain;h=8a3d2ff3a55bf5fe28e1bce5c2fcc79d0a54a2b2;hp=262313876c0c64158bce55196cfd0439ce5ef035;ds=sidebyside Try to read grml-autoconfig bootparameters from 9p virtio filesystem. The idea is to share a filesystem with the mount-tag grml-parameters which will be used to add additional commandline parameters to your system. --- diff --git a/autoconfig.functions b/autoconfig.functions index 6e0a6b8..b890f4c 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -40,6 +40,17 @@ if [ -z "$CMDLINE" ]; then CMDLINE="$(cat /proc/cmdline)" [ -d /cdrom/bootparams/ ] && CMDLINE="$CMDLINE $(cat /cdrom/bootparams/* | tr '\n' ' ')" [ -d /live/image/bootparams/ ] && CMDLINE="$CMDLINE $(cat /live/image/bootparams/* | tr '\n' ' ')" + modprobe 9p 2>/dev/null || true + if grep -q 9p /proc/filesystems ; then + local TAG="grml-parameters" + if grep -q "$TAG" /sys/bus/virtio/devices/*/mount_tag 2>/dev/null ; then + local MOUNTDIR="$(mktemp -d)" + mount -t 9p -o trans=virtio,ro "$TAG" "$MOUNTDIR" + CMDLINE="$CMDLINE $(cat "$MOUNTDIR"/* 2>/dev/null | tr '\n' ' ')" + umount "$MOUNTDIR" + rmdir "$MOUNTDIR" + fi + fi fi # }}}