Added possibility of building multiple configurations by one nixos-rebuild.

svn path=/nixos/trunk/; revision=9959
This commit is contained in:
Michael Raskin 2007-12-20 11:36:30 +00:00
parent 6733486ec8
commit f81bebe2d7
4 changed files with 25 additions and 3 deletions

View file

@ -88,9 +88,13 @@ EOF
# Add all generations of the system profile to the menu, in reverse
# (most recent to least recent) order.
for link in $(
(ls -d $default/fine-tune/* ) \
| sort -n); do
date=$(stat --printf="%y\n" $link | sed 's/\..*//')
addEntry "NixOS - variation" $link ""
done
for generation in $(
(cd $default/fine-tune && ls -d *) \
| sort -n) $(
(cd /nix/var/nix/profiles && ls -d system-*-link) \
| sed 's/system-\([0-9]\+\)-link/\1/' \
| sort -n -r); do

View file

@ -1737,5 +1737,13 @@ root ALL=(ALL) SETENV: ALL
};
nesting = {
children = mkOption {
default = [];
description = "
Additional configurations to build.
";
};
};
}

View file

@ -356,6 +356,9 @@ rec {
pkgs.diffutils
pkgs.upstart # for initctl
];
children = map (x: ((import ./system.nix)
{inherit platform stage2Init; configuration = x;}).system)
config.nesting.children;
configurationName = config.boot.configurationName;
}) (pkgs.getConfig ["checkConfigurationOptions"] false)
optionDeclarations configuration ;

View file

@ -14,6 +14,13 @@ ln -s $upstart $out/upstart
echo "$kernelParams" > $out/kernel-params
echo "$configurationName" > $out/configuration-name
mkdir $out/fine-tune
ChildCount=0;
for i in $children; do
ChildCount=$(( ChildCount + 1 ));
ln -s $i $out/fine-tune/child-$ChildCount;
done
cat > $out/menu.lst << GRUBEND
kernel $kernel init=$bootStage2 $kernelParams
initrd $initrd