mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +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@
|
systemConfig=@systemConfig@
|
||||||
|
|
||||||
export HOME=/root
|
export HOME=/root PATH="@path@"
|
||||||
|
|
||||||
|
|
||||||
# Print a greeting.
|
# Print a greeting.
|
||||||
|
@ -11,21 +11,6 @@ echo -e "\e[1;32m<<< NixOS Stage 2 >>>\e[0m"
|
||||||
echo
|
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.
|
# Normally, stage 1 mounts the root filesystem read/writable.
|
||||||
# However, in some environments, stage 2 is executed directly, and the
|
# However, in some environments, stage 2 is executed directly, and the
|
||||||
# root is read-only. So make it writable here.
|
# root is read-only. So make it writable here.
|
||||||
|
|
|
@ -23,11 +23,11 @@ let
|
||||||
inherit (config.nix) readOnlyStore;
|
inherit (config.nix) readOnlyStore;
|
||||||
inherit (config.networking) useHostResolvConf;
|
inherit (config.networking) useHostResolvConf;
|
||||||
inherit (config.system.build) earlyMountScript;
|
inherit (config.system.build) earlyMountScript;
|
||||||
path =
|
path = lib.makeBinPath ([
|
||||||
[ pkgs.coreutils
|
pkgs.coreutils
|
||||||
pkgs.utillinux
|
pkgs.utillinux
|
||||||
pkgs.openresolv
|
pkgs.openresolv
|
||||||
] ++ optional config.nix.readOnlyStore readonlyMountpoint;
|
] ++ optional config.nix.readOnlyStore readonlyMountpoint);
|
||||||
postBootCommands = pkgs.writeText "local-cmds"
|
postBootCommands = pkgs.writeText "local-cmds"
|
||||||
''
|
''
|
||||||
${config.boot.postBootCommands}
|
${config.boot.postBootCommands}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue