1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

* Don't put every package in the boot environment in $PATH but rather

create a symlink tree and put that in $PATH.

svn path=/nixos/trunk/; revision=7161
This commit is contained in:
Eelco Dolstra 2006-11-28 16:47:14 +00:00
parent cb6c02f092
commit 362f0f752b
3 changed files with 27 additions and 14 deletions

View file

@ -11,7 +11,7 @@ echo
# Set the PATH.
export PATH=/empty
for i in @path@; do
for i in @startPath@; do
PATH=$PATH:$i/bin
if test -e $i/sbin; then
PATH=$PATH:$i/sbin
@ -135,12 +135,7 @@ EOF
# Additional path for the interactive shell.
for i in @extraPath@; do
PATH=$PATH:$i/bin
if test -e $i/sbin; then
PATH=$PATH:$i/sbin
fi
done
PATH=@fullPath@/bin:@fullPath@/sbin
cat > /etc/profile <<EOF
export PATH=$PATH

View file

@ -1,4 +1,4 @@
{ genericSubstituter, shell, coreutils, findutils
{ genericSubstituter, buildEnv, shell, coreutils, findutils
, utillinux, kernel, udev, upstart
, path ? []
@ -12,16 +12,34 @@
, hostName
}:
genericSubstituter {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit shell kernel upstart readOnlyRoot upstartJobs hostName;
path = [
let
startPath = [
coreutils
findutils
utillinux
udev
upstart
];
in
genericSubstituter {
src = ./boot-stage-2-init.sh;
isExecutable = true;
inherit shell kernel upstart readOnlyRoot upstartJobs hostName;
inherit startPath;
# We don't want to put all of `startPath' and `path' in $PATH, since
# then we get an embarrassingly long $PATH. So use the user
# environment builder to make a directory with symlinks to those
# packages.
fullPath = buildEnv {
name = "boot-stage-2-path";
paths = startPath ++ path;
pathsToLink = ["/bin" "/sbin" "/man/man1" "/share/man/man1"];
ignoreCollisions = true;
};
extraPath = path;
}

View file

@ -182,7 +182,7 @@ rec {
# The init script of boot stage 2, which is supposed to do
# everything else to bring up the system.
bootStage2 = import ../boot/boot-stage-2.nix {
inherit (pkgs) genericSubstituter coreutils findutils
inherit (pkgs) genericSubstituter buildEnv coreutils findutils
utillinux kernel udev upstart;
inherit upstartJobs;
shell = pkgs.bash + "/bin/sh";