virtfs root filesystem support
RFC PATCH 1/1 virtfs root filesystem support
Qemu/KVM provides virtfs, a paravirtualised filesystem that is implemented by running the Plan 9 folder sharing protocol over virtio.
Make booting with root=virtfs:foobar use the virtfs filesystem with mount tag 'foobar' as root filesystem, to allow booting virtual machines off virtfs.
Note that this only handles 9p over virtio (i.e. virtfs), and doesn't attempt to handle mounting 9p filesystems over TCP/IP, for example.
dracut.spec +1 -0
@@ -270,6 +270,7 @@ rm -rf $RPM_BUILD_ROOT %{dracutlibdir}/modules.d/95zfcp %{dracutlibdir}/modules.d/95terminfo %{dracutlibdir}/modules.d/95udev-rules +%{dracutlibdir}/modules.d/95virtfs %{dracutlibdir}/modules.d/96securityfs %{dracutlibdir}/modules.d/97biosdevname %{dracutlibdir}/modules.d/97masterkey
modules.d/95virtfs/module-setup.sh new file +27 -0
@@ -0,0 +1,27 @@ +#!/bin/bash +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +check() { + [[ $hostonly ]] || [[ $mount_needs ]] && { + for fs in ${host_fs_types[@]}; do + strstr "$fs" "\|9p" && return 0 + done + return 1 + } + + return 0 +} + +depends() { + return 0 +} + +installkernel() { + instmods 9p 9pnet_virtio +} + +install() { + inst_hook cmdline 95 "$moddir/parse-virtfs.sh" + inst_hook mount 99 "$moddir/mount-virtfs.sh" +}
modules.d/95virtfs/mount-virtfs.sh new file +75 -0
75 lines not on this page · raw message
modules.d/95virtfs/parse-virtfs.sh new file +7 -0
@@ -0,0 +1,7 @@ +#!/bin/sh +# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- +# ex: ts=8 sw=4 sts=4 et filetype=sh + +if [ "${root%%:*}" = "virtfs" ] ; then + rootok=1 +fi
Am 15.04.2012 02:40, schrieb Lennert Buytenhek:
Quoted 8 lines
Qemu/KVM provides virtfs, a paravirtualised filesystem that is implemented by running the Plan 9 folder sharing protocol over virtio.
Make booting with root=virtfs:foobar use the virtfs filesystem with mount tag 'foobar' as root filesystem, to allow booting virtual machines off virtfs.
Quoted 6 lines
Note that this only handles 9p over virtio (i.e. virtfs), and doesn't attempt to handle mounting 9p filesystems over TCP/IP, for example.
pushed... and yes we should factor out the mount somehow