Making generations-dir consider the pkgs.platform.

stdenv-updates stuff. Still to be reviewed, but at least an implementation to have
some different armv5tel-linux platforms: qemu versatile and the sheevaplug.


svn path=/nixos/trunk/; revision=18290
This commit is contained in:
Lluís Batlle i Rossell 2009-11-08 17:38:35 +00:00
parent 616c844336
commit 420639a4b1
2 changed files with 24 additions and 5 deletions

View File

@ -68,18 +68,31 @@ addEntry() {
mkdir -p $outdir
ln -sf $(readlink -f $path) $outdir/system
ln -sf $(readlink -f $path/init) $outdir/init
ln -sf $(readlink -f $path/initrd) $outdir/initrd
ln -sf $(readlink -f $path/kernel) $outdir/kernel
ln -sf $initrd $outdir/initrd
ln -sf $kernel $outdir/kernel
if test $(readlink -f "$path") = "$default"; then
cp "$kernel" /boot/nixos-kernel
cp "$initrd" /boot/nixos-initrd
cp "$(readlink -f "$path/init")" /boot/nixos-init
mkdir -p /boot/default
if [ -e /boot/default/system ];
rm /boot/default/system
fi
ln -sf $(readlink -f $path) /boot/default/system
if [ -e /boot/default/init ];
rm /boot/default/init
fi
ln -sf $(readlink -f $path/init) /boot/default/init
ln -sf $(readlink -f $path/initrd) /boot/default/initrd
ln -sf $(readlink -f $path/kernel) /boot/default/kernel
if [ -e /boot/default/initrd ];
rm /boot/default/initrd
fi
ln -sf $initrd /boot/default/initrd
if [ -e /boot/default/kernel ];
rm /boot/default/kernel
fi
ln -sf $kernel /boot/default/kernel
fi
}

View File

@ -41,6 +41,9 @@ let
inherit (config.boot.loader.generationsDir) copyKernels;
};
# Temporary check, for nixos to cope both with nixpkgs stdenv-updates and trunk
platform = (if pkgs ? platform then pkgs.platform else
{ name = "pc"; uboot = null; });
in
{
require = [
@ -55,6 +58,9 @@ in
menuBuilder = generationsDirBuilder;
};
boot.loader.id = "generationsDir";
boot.loader.kernelFile = "uImage";
boot.loader.kernelFile = (
if (platform.name == "sheevaplug") then "uImage"
else if (platform.name == "versatileARM") then "zImage"
else "vmlinuz");
};
}