* In the activation script, don't require the path to the "system"

derivation on the command line.

svn path=/nixos/trunk/; revision=23770
This commit is contained in:
Eelco Dolstra 2010-09-13 18:19:15 +00:00
parent d48e2fdb4d
commit 4046056cdc
6 changed files with 18 additions and 17 deletions

View file

@ -51,15 +51,17 @@ in
merge = mergeTypedOption "script" builtins.isAttrs (fold mergeAttrs {});
apply = set: {
script = pkgs.writeScript "nixos-activation-script"
script =
''
#! ${pkgs.stdenv.shell}
systemConfig=@out@
export PATH=/empty
for i in ${toString path}; do
PATH=$PATH:$i/bin:$i/sbin;
done
${
let
set' = mapAttrs (n: v: if builtins.isString v then noDepEntry v else v) set;
@ -87,14 +89,6 @@ in
config = {
system.activationScripts.systemConfig =
''
systemConfig="$1"
if test -z "$systemConfig"; then
systemConfig="/system" # for the installation CD
fi
'';
system.activationScripts.stdio =
''
# Needed by some programs.

View file

@ -102,9 +102,15 @@ let
if [ -n "$grub" ]; then
ln -s $grub $out/grub
fi
ln -s ${config.system.build.bootStage2} $out/init
ln -s ${config.system.build.initialRamdisk}/initrd $out/initrd
ln -s ${config.system.activationScripts.script} $out/activate
echo "$activationScript" > $out/activate
substituteInPlace $out/activate --subst-var out
chmod u+x $out/activate
unset activationScript
ln -s ${config.system.build.etc}/etc $out/etc
ln -s ${config.system.path} $out/sw
ln -s ${config.system.build.upstart} $out/upstart
@ -116,7 +122,7 @@ let
mkdir $out/fine-tune
childCount=0;
for i in $children; do
for i in $children; do
childCount=$(( childCount + 1 ));
ln -s $i $out/fine-tune/child-$childCount;
done
@ -142,6 +148,7 @@ let
config.boot.kernelParams ++ config.boot.extraKernelParams;
menuBuilder = config.system.build.menuBuilder;
initScriptBuilder = config.system.build.initScriptBuilder;
activationScript = config.system.activationScripts.script;
# Most of these are needed by grub-install.
path = [
pkgs.coreutils

View file

@ -153,7 +153,7 @@ fi
# Run the script that performs all configuration activation that does
# not have to be done at boot time.
echo "running activation script..."
@activateConfiguration@ "$systemConfig"
"$systemConfig"/activate
# Record the boot configuration.

View file

@ -43,7 +43,7 @@ let
bootStage2 = substituteAll {
src = ./stage-2-init.sh;
isExecutable = true;
inherit kernel activateConfiguration;
inherit kernel;
inherit (config.boot) devShmSize;
ttyGid = config.ids.gids.tty;
upstart = config.system.build.upstart;

View file

@ -55,7 +55,7 @@ in
system.build.etc = etc;
system.activationScripts.etc = stringAfter [ "systemConfig" "stdio" ]
system.activationScripts.etc = stringAfter [ "stdio" ]
''
# Set up the statically computed bits of /etc.
echo "setting up /etc..."

View file

@ -82,8 +82,8 @@ in
jobs.klogd.preStart = "dmesg -c > /dev/null";
# Prevent tests from accessing the Internet.
networking.defaultGateway = mkOverrideTemplate 150 {} "";
networking.nameservers = mkOverrideTemplate 150 {} [ ];
networking.defaultGateway = mkOverride 150 "";
networking.nameservers = mkOverride 150 [ ];
# Require a patch to the kernel to increase the 15s CIFS timeout.
assertions =