2006-11-13 00:30:03 +01:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
ensureDir $out
|
|
|
|
|
|
|
|
ln -s $kernel $out/kernel
|
|
|
|
ln -s $grub $out/grub
|
2006-11-27 14:59:50 +01:00
|
|
|
ln -s $bootStage2 $out/init
|
|
|
|
ln -s $initrd $out/initrd
|
|
|
|
echo "$extraKernelParams" > $out/kernel-params
|
2006-11-13 00:30:03 +01:00
|
|
|
|
|
|
|
cat > $out/menu.lst << GRUBEND
|
2006-11-27 14:59:50 +01:00
|
|
|
kernel $kernel init=$bootStage2 $extraKernelParams
|
2006-11-24 01:04:29 +01:00
|
|
|
initrd $initrd
|
2006-11-13 00:30:03 +01:00
|
|
|
GRUBEND
|
|
|
|
|
|
|
|
ensureDir $out/bin
|
|
|
|
|
|
|
|
cat > $out/bin/switch-to-configuration <<EOF
|
|
|
|
#! $SHELL
|
|
|
|
set -e
|
|
|
|
export PATH=$coreutils/bin:$gnused/bin:$gnugrep/bin:$diffutils/bin
|
|
|
|
if test -n "$grubDevice"; then
|
2006-11-24 16:31:28 +01:00
|
|
|
mkdir -m 0700 -p /boot/grub
|
2006-11-24 00:22:43 +01:00
|
|
|
$grubMenuBuilder $out
|
2006-11-27 14:51:08 +01:00
|
|
|
if test "\$NIXOS_INSTALL_GRUB" = 1; then
|
|
|
|
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
|
|
|
|
fi
|
2006-11-13 00:30:03 +01:00
|
|
|
fi
|
2006-11-30 00:10:22 +01:00
|
|
|
sync
|
2006-11-13 00:30:03 +01:00
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/switch-to-configuration
|