diff options
author | Andy Lutomirski <luto@kernel.org> | 2015-10-16 17:16:47 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@kernel.org> | 2015-10-16 17:16:47 -0700 |
commit | 28bafbf8e954b578270c248b69e9ba24de67296e (patch) | |
tree | efd9fe3a082bf04fe7216458aaffe79a3552a0a0 | |
parent | d4777bd5eae003bde7dc66c09ef07ed8fa0d0bca (diff) | |
download | virtme-28bafbf8e954b578270c248b69e9ba24de67296e.tar.gz |
initramfs: Use the fallback tmpfs if there's no /run
CentOS 6 is mostly compatible with virtme and has a fully functional QEMU,
but it's missing /run. Use the fallback tmpfs if that happens.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rw-r--r-- | virtme/mkinitramfs.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/virtme/mkinitramfs.py b/virtme/mkinitramfs.py index 422c016..1a295a7 100644 --- a/virtme/mkinitramfs.py +++ b/virtme/mkinitramfs.py @@ -85,7 +85,17 @@ if ! mount -t proc -o nosuid,noexec,nodev proc /newroot/proc 2>/dev/null; then # QEMU 1.5 and below have a bug in virtfs that prevents mounting # anything on top of a virtfs mount. log "your host's virtfs is broken -- using a fallback tmpfs" + need_fallback_tmpfs=1 +else + umount /newroot/proc # Don't leave garbage behind +fi +if ! [[ -d /newroot/run ]]; then + log "your host does not have /run -- using a fallback tmpfs" + need_fallback_tmpfs=1 +fi + +if [[ "$need_fallback_tmpfs" != "" ]]; then mount --move /newroot /tmproot mount -t tmpfs root_workaround /newroot/ cd tmproot @@ -99,8 +109,6 @@ if ! mount -t proc -o nosuid,noexec,nodev proc /newroot/proc 2>/dev/null; then mknod /newroot/dev/null c 1 3 mount -o remount,ro -t tmpfs root_workaround /newroot umount -l /tmproot -else - umount /newroot/proc # Don't leave garbage behind fi mount -t tmpfs run /newroot/run |