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:
parent
527512e554
commit
a5ad8b4f69
2 changed files with 6 additions and 21 deletions
|
@ -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.
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue