0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

stage-2: simplify exporting path

This commit is contained in:
Jörg Thalheim 2017-04-04 22:50:48 +02:00
parent 527512e554
commit a5ad8b4f69
No known key found for this signature in database
GPG key ID: CA4106B8D7CC79FA
2 changed files with 6 additions and 21 deletions

View file

@ -2,7 +2,7 @@
systemConfig=@systemConfig@
export HOME=/root
export HOME=/root PATH="@path@"
# Print a greeting.
@ -11,21 +11,6 @@ echo -e "\e[1;32m<<< NixOS Stage 2 >>>\e[0m"
echo
# Set the PATH.
setPath() {
local dirs="$1"
export PATH=/empty
for i in $dirs; do
PATH=$PATH:$i/bin
if test -e $i/sbin; then
PATH=$PATH:$i/sbin
fi
done
}
setPath "@path@"
# Normally, stage 1 mounts the root filesystem read/writable.
# However, in some environments, stage 2 is executed directly, and the
# root is read-only. So make it writable here.

View file

@ -23,11 +23,11 @@ let
inherit (config.nix) readOnlyStore;
inherit (config.networking) useHostResolvConf;
inherit (config.system.build) earlyMountScript;
path =
[ pkgs.coreutils
pkgs.utillinux
pkgs.openresolv
] ++ optional config.nix.readOnlyStore readonlyMountpoint;
path = lib.makeBinPath ([
pkgs.coreutils
pkgs.utillinux
pkgs.openresolv
] ++ optional config.nix.readOnlyStore readonlyMountpoint);
postBootCommands = pkgs.writeText "local-cmds"
''
${config.boot.postBootCommands}