summary refs log tree commit diff
path: root/nixos/modules/system/boot/stage-1-init.sh
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-11 23:48:31 +0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-11-11 23:48:31 +0100
commitc5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999 (patch)
tree1aeaedbac053af568b9bad7d424ec207fc72c682 /nixos/modules/system/boot/stage-1-init.sh
parentf33fa1b66bbf181503e87a957e05c841093f2f8d (diff)
downloadnixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar.gz
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar.bz2
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar.lz
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar.xz
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.tar.zst
nixlib-c5a7ff0afd6dd2a2b67e2a9bb5cdac7ce375e999.zip
Fix /dev/root udev rule in the ISO
Diffstat (limited to 'nixos/modules/system/boot/stage-1-init.sh')
-rw-r--r--nixos/modules/system/boot/stage-1-init.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/stage-1-init.sh b/nixos/modules/system/boot/stage-1-init.sh
index 5a9beeeafa1d..5caef2068c20 100644
--- a/nixos/modules/system/boot/stage-1-init.sh
+++ b/nixos/modules/system/boot/stage-1-init.sh
@@ -369,7 +369,11 @@ exec 3>&-
 
 
 # Emit a udev rule for /dev/root to prevent systemd from complaining.
-eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot || true)
+if [ -e /mnt-root/iso ]; then
+    eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=/mnt-root/iso || true)
+else
+    eval $(udevadm info --export --export-prefix=ROOT_ --device-id-of-file=$targetRoot || true)
+fi
 if [ "$ROOT_MAJOR" -a "$ROOT_MINOR" -a "$ROOT_MAJOR" != 0 ]; then
     mkdir -p /run/udev/rules.d
     echo 'ACTION=="add|change", SUBSYSTEM=="block", ENV{MAJOR}=="'$ROOT_MAJOR'", ENV{MINOR}=="'$ROOT_MINOR'", SYMLINK+="root"' > /run/udev/rules.d/61-dev-root-link.rules