* 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:
parent
d48e2fdb4d
commit
4046056cdc
@ -51,15 +51,17 @@ in
|
|||||||
merge = mergeTypedOption "script" builtins.isAttrs (fold mergeAttrs {});
|
merge = mergeTypedOption "script" builtins.isAttrs (fold mergeAttrs {});
|
||||||
|
|
||||||
apply = set: {
|
apply = set: {
|
||||||
script = pkgs.writeScript "nixos-activation-script"
|
script =
|
||||||
''
|
''
|
||||||
#! ${pkgs.stdenv.shell}
|
#! ${pkgs.stdenv.shell}
|
||||||
|
|
||||||
|
systemConfig=@out@
|
||||||
|
|
||||||
export PATH=/empty
|
export PATH=/empty
|
||||||
for i in ${toString path}; do
|
for i in ${toString path}; do
|
||||||
PATH=$PATH:$i/bin:$i/sbin;
|
PATH=$PATH:$i/bin:$i/sbin;
|
||||||
done
|
done
|
||||||
|
|
||||||
${
|
${
|
||||||
let
|
let
|
||||||
set' = mapAttrs (n: v: if builtins.isString v then noDepEntry v else v) set;
|
set' = mapAttrs (n: v: if builtins.isString v then noDepEntry v else v) set;
|
||||||
@ -87,14 +89,6 @@ in
|
|||||||
|
|
||||||
config = {
|
config = {
|
||||||
|
|
||||||
system.activationScripts.systemConfig =
|
|
||||||
''
|
|
||||||
systemConfig="$1"
|
|
||||||
if test -z "$systemConfig"; then
|
|
||||||
systemConfig="/system" # for the installation CD
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
|
|
||||||
system.activationScripts.stdio =
|
system.activationScripts.stdio =
|
||||||
''
|
''
|
||||||
# Needed by some programs.
|
# Needed by some programs.
|
||||||
|
@ -102,9 +102,15 @@ let
|
|||||||
if [ -n "$grub" ]; then
|
if [ -n "$grub" ]; then
|
||||||
ln -s $grub $out/grub
|
ln -s $grub $out/grub
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ln -s ${config.system.build.bootStage2} $out/init
|
ln -s ${config.system.build.bootStage2} $out/init
|
||||||
ln -s ${config.system.build.initialRamdisk}/initrd $out/initrd
|
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.build.etc}/etc $out/etc
|
||||||
ln -s ${config.system.path} $out/sw
|
ln -s ${config.system.path} $out/sw
|
||||||
ln -s ${config.system.build.upstart} $out/upstart
|
ln -s ${config.system.build.upstart} $out/upstart
|
||||||
@ -116,7 +122,7 @@ let
|
|||||||
|
|
||||||
mkdir $out/fine-tune
|
mkdir $out/fine-tune
|
||||||
childCount=0;
|
childCount=0;
|
||||||
for i in $children; do
|
for i in $children; do
|
||||||
childCount=$(( childCount + 1 ));
|
childCount=$(( childCount + 1 ));
|
||||||
ln -s $i $out/fine-tune/child-$childCount;
|
ln -s $i $out/fine-tune/child-$childCount;
|
||||||
done
|
done
|
||||||
@ -142,6 +148,7 @@ let
|
|||||||
config.boot.kernelParams ++ config.boot.extraKernelParams;
|
config.boot.kernelParams ++ config.boot.extraKernelParams;
|
||||||
menuBuilder = config.system.build.menuBuilder;
|
menuBuilder = config.system.build.menuBuilder;
|
||||||
initScriptBuilder = config.system.build.initScriptBuilder;
|
initScriptBuilder = config.system.build.initScriptBuilder;
|
||||||
|
activationScript = config.system.activationScripts.script;
|
||||||
# Most of these are needed by grub-install.
|
# Most of these are needed by grub-install.
|
||||||
path = [
|
path = [
|
||||||
pkgs.coreutils
|
pkgs.coreutils
|
||||||
|
@ -153,7 +153,7 @@ fi
|
|||||||
# Run the script that performs all configuration activation that does
|
# Run the script that performs all configuration activation that does
|
||||||
# not have to be done at boot time.
|
# not have to be done at boot time.
|
||||||
echo "running activation script..."
|
echo "running activation script..."
|
||||||
@activateConfiguration@ "$systemConfig"
|
"$systemConfig"/activate
|
||||||
|
|
||||||
|
|
||||||
# Record the boot configuration.
|
# Record the boot configuration.
|
||||||
|
@ -43,7 +43,7 @@ let
|
|||||||
bootStage2 = substituteAll {
|
bootStage2 = substituteAll {
|
||||||
src = ./stage-2-init.sh;
|
src = ./stage-2-init.sh;
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit kernel activateConfiguration;
|
inherit kernel;
|
||||||
inherit (config.boot) devShmSize;
|
inherit (config.boot) devShmSize;
|
||||||
ttyGid = config.ids.gids.tty;
|
ttyGid = config.ids.gids.tty;
|
||||||
upstart = config.system.build.upstart;
|
upstart = config.system.build.upstart;
|
||||||
|
@ -55,7 +55,7 @@ in
|
|||||||
|
|
||||||
system.build.etc = etc;
|
system.build.etc = etc;
|
||||||
|
|
||||||
system.activationScripts.etc = stringAfter [ "systemConfig" "stdio" ]
|
system.activationScripts.etc = stringAfter [ "stdio" ]
|
||||||
''
|
''
|
||||||
# Set up the statically computed bits of /etc.
|
# Set up the statically computed bits of /etc.
|
||||||
echo "setting up /etc..."
|
echo "setting up /etc..."
|
||||||
|
@ -82,8 +82,8 @@ in
|
|||||||
jobs.klogd.preStart = "dmesg -c > /dev/null";
|
jobs.klogd.preStart = "dmesg -c > /dev/null";
|
||||||
|
|
||||||
# Prevent tests from accessing the Internet.
|
# Prevent tests from accessing the Internet.
|
||||||
networking.defaultGateway = mkOverrideTemplate 150 {} "";
|
networking.defaultGateway = mkOverride 150 "";
|
||||||
networking.nameservers = mkOverrideTemplate 150 {} [ ];
|
networking.nameservers = mkOverride 150 [ ];
|
||||||
|
|
||||||
# Require a patch to the kernel to increase the 15s CIFS timeout.
|
# Require a patch to the kernel to increase the 15s CIFS timeout.
|
||||||
assertions =
|
assertions =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user