aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlmb <i@lmb.io>2019-05-09 09:41:53 +0100
committerlmb <i@lmb.io>2019-05-09 09:41:53 +0100
commit2fbc38cf7eab54875bbac7fcd1af35d8fa739e40 (patch)
tree8f639ae3cef60b7e1a58dba77fda6e0067e7eef2
parent40cec5386aedce4477d1561aa87ae580af741887 (diff)
downloadvirtme-2fbc38cf7eab54875bbac7fcd1af35d8fa739e40.tar.gz
virtme-init: use findmnt to detect /dev mount
In my environment, /dev is available via the 9p root mount, and therefore virtme-init does not mount a fresh devtmpfs. This means that udevd later is unable to generate new entries for /dev/vport*. Using --script-sh or --script-exec therefore fails. Instead, use findmnt to check whether /dev is automounted by the current kernel. Signed-off-by: Lorenz Bauer <i@lmb.io>
-rwxr-xr-xvirtme/guest/virtme-init2
1 files changed, 1 insertions, 1 deletions
diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init
index 44a018a..9dfe3c6 100755
--- a/virtme/guest/virtme-init
+++ b/virtme/guest/virtme-init
@@ -57,7 +57,7 @@ fi
mount -t proc -o nosuid,noexec,nodev proc /proc/
# devtmpfs might be automounted; if not, mount it.
-if [[ "`stat --format=%m /dev`" != "/dev" ]]; then
+if ! findmnt --kernel --mountpoint /dev &>/dev/null; then
# Ideally we'll use devtmpfs (but don't rely on /dev/null existing).
if [[ -c /dev/null ]]; then
mount -n -t devtmpfs -o mode=0755,nosuid,noexec devtmpfs /dev \