about summary refs log tree commit diff
path: root/nixos/modules/system/boot
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 15:59:11 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-05-11 18:18:36 +0200
commitc8ef5989452e191a1d345cd006f54305cb989af6 (patch)
treef0edd1611bc945688fe7e5d031ea2f3503f4fe2f /nixos/modules/system/boot
parentf19b58fb6a5cc55af6d8d8ca7979f8e64255d2d0 (diff)
downloadnixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar.gz
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar.bz2
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar.lz
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar.xz
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.tar.zst
nixlib-c8ef5989452e191a1d345cd006f54305cb989af6.zip
stage-1: Don't mount /dev/shm if it's already mounted
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 173453a17f71..330e2f97c5bf 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -85,8 +85,10 @@ done
 
 
 # More special file systems, initialise required directories.
-mkdir -m 0755 /dev/shm
-mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm
+if ! mountpoint -q /dev/shm; then
+    mkdir -m 0755 /dev/shm
+    mount -t tmpfs -o "rw,nosuid,nodev,size=@devShmSize@" tmpfs /dev/shm
+fi
 mkdir -m 0755 -p /dev/pts
 [ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
 mkdir -m 01777 -p /tmp