summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-2-init.sh
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-07-22 12:23:48 +0200
commit9647609e3eb687079d2120b57bdf095d8643671f (patch)
tree5f7e2d343b98ca8f6a3b8922ffd46b1ee6c500db /nixos/modules/system/boot/stage-2-init.sh
parent6bd4e0b8cd8a5f043492846d7ee4531349962102 (diff)
downloadnixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar.gz
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar.bz2
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar.lz
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar.xz
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.tar.zst
nixlib-9647609e3eb687079d2120b57bdf095d8643671f.zip
stage-1: Don't mount /dev/shm if it's already mounted
(cherry picked from commit c8ef5989452e191a1d345cd006f54305cb989af6)
Diffstat (limited to 'nixos/modules/system/boot/stage-2-init.sh')
-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