summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-2-init.sh
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-04-05 00:28:24 +0200
committerJörg Thalheim <joerg@thalheim.io>2017-04-05 21:40:51 +0200
commite3f031b200dfb92ecefa73e02878b724194a1d8b (patch)
tree7cbf2dfb249f7cd11a460d6544c04f36202bf48d /nixos/modules/system/boot/stage-2-init.sh
parenta17344c2adf7082b90b315eed3d954df0a4fd575 (diff)
downloadnixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar.gz
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar.bz2
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar.lz
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar.xz
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.tar.zst
nixlib-e3f031b200dfb92ecefa73e02878b724194a1d8b.zip
stage-2: reduce mkdir commands
Diffstat (limited to 'nixos/modules/system/boot/stage-2-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-2-init.sh13
1 files changed, 3 insertions, 10 deletions
diff --git a/nixos/modules/system/boot/stage-2-init.sh b/nixos/modules/system/boot/stage-2-init.sh
index 19e0877d3642..2b89c888ac8f 100644
--- a/nixos/modules/system/boot/stage-2-init.sh
+++ b/nixos/modules/system/boot/stage-2-init.sh
@@ -80,13 +80,9 @@ ln -s /proc/mounts /etc/mtab
 # More special file systems, initialise required directories.
 [ -e /proc/bus/usb ] && mount -t usbfs usbfs /proc/bus/usb # UML doesn't have USB by default
 mkdir -m 01777 -p /tmp
-mkdir -m 0755 -p /var /var/log /var/lib /var/db
-mkdir -m 0755 -p /nix/var
-mkdir -m 0700 -p /root
-chmod 0700 /root
-mkdir -m 0755 -p /bin # for the /bin/sh symlink
-mkdir -m 0755 -p /home
-mkdir -m 0755 -p /etc/nixos
+mkdir -m 0755 -p /var/{log,lib,db} /nix/var /etc/nixos/ \
+    /run/lock /home /bin # for the /bin/sh symlink
+install -m 0700 -d /root
 
 
 # Miscellaneous boot time cleanup.
@@ -98,9 +94,6 @@ rm -f /etc/{group,passwd,shadow}.lock
 rm -rf /nix/var/nix/gcroots/tmp /nix/var/nix/temproots
 
 
-mkdir -m 0755 -p /run/lock
-
-
 # For backwards compatibility, symlink /var/run to /run, and /var/lock
 # to /run/lock.
 ln -s /run /var/run