From 7243eb1d1d97a469a20c4e4a73e8d43ce8c09eaf Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 9 May 2007 17:32:41 +0000 Subject: [PATCH] * Create /bin on the CD to suppress the /bin/sh symlink creation error. * Put the top-level system config on the CD, otherwise root doesn't get a working login shell on the CD (and the system PATH is broken as well). svn path=/nixos/trunk/; revision=8658 --- boot/boot-stage-2-init.sh | 1 + configuration/rescue-cd.nix | 5 ++++- system/activate-configuration.sh | 8 +++++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/boot/boot-stage-2-init.sh b/boot/boot-stage-2-init.sh index 5678c6d53d4..0ec0807e853 100644 --- a/boot/boot-stage-2-init.sh +++ b/boot/boot-stage-2-init.sh @@ -79,6 +79,7 @@ needWritableDir /tmp 01777 needWritableDir /var 0755 needWritableDir /nix/var 0755 needWritableDir /root 0700 +needWritableDir /bin 0755 # for the /bin/sh symlink # Miscellaneous boot time cleanup. diff --git a/configuration/rescue-cd.nix b/configuration/rescue-cd.nix index a48049777fb..819eb6785db 100644 --- a/configuration/rescue-cd.nix +++ b/configuration/rescue-cd.nix @@ -92,7 +92,7 @@ rec { cdMountPoints = pkgs.runCommand "mount-points" {} " ensureDir $out cd $out - mkdir proc sys tmp etc dev var mnt nix nix/var root + mkdir proc sys tmp etc dev var mnt nix nix/var root bin touch $out/${configuration.boot.rootLabel} "; @@ -174,6 +174,9 @@ rec { { object = system.bootStage2; symlink = "/init"; } + { object = system.system; + symlink = "/system"; + } # To speed up the installation, provide the full stdenv. { object = pkgs.stdenv; symlink = "none"; diff --git a/system/activate-configuration.sh b/system/activate-configuration.sh index 76c2782f623..105acba4cb4 100644 --- a/system/activate-configuration.sh +++ b/system/activate-configuration.sh @@ -1,6 +1,9 @@ #! @shell@ systemConfig="$1" +if test -z "$systemConfig"; then + systemConfig="/system" # for the installation CD +fi export PATH=/empty for i in @path@; do PATH=$PATH:$i/bin:$i/sbin; done @@ -140,9 +143,8 @@ hostname @hostName@ # Make this configuration the current configuration. -if test -n "$systemConfig"; then - ln -sfn "$systemConfig" /var/run/current-system -fi +ln -sfn "$systemConfig" /var/run/current-system + # Prevent the current configuration from being garbage-collected. ln -sfn /var/run/current-system /nix/var/nix/gcroots/current-system