2006-11-12 23:30:03 +00:00
|
|
|
source $stdenv/setup
|
|
|
|
|
|
|
|
ensureDir $out
|
|
|
|
|
|
|
|
ln -s $kernel $out/kernel
|
|
|
|
ln -s $grub $out/grub
|
2006-11-27 13:59:50 +00:00
|
|
|
ln -s $bootStage2 $out/init
|
|
|
|
ln -s $initrd $out/initrd
|
|
|
|
echo "$extraKernelParams" > $out/kernel-params
|
2006-11-12 23:30:03 +00:00
|
|
|
|
|
|
|
cat > $out/menu.lst << GRUBEND
|
2006-11-27 13:59:50 +00:00
|
|
|
kernel $kernel init=$bootStage2 $extraKernelParams
|
2006-11-24 00:04:29 +00:00
|
|
|
initrd $initrd
|
2006-11-12 23:30:03 +00: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 15:31:28 +00:00
|
|
|
mkdir -m 0700 -p /boot/grub
|
2006-11-23 23:22:43 +00:00
|
|
|
$grubMenuBuilder $out
|
2006-11-27 13:51:08 +00:00
|
|
|
if test "\$NIXOS_INSTALL_GRUB" = 1; then
|
|
|
|
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
|
|
|
|
fi
|
2006-11-12 23:30:03 +00:00
|
|
|
fi
|
2006-11-29 23:10:22 +00:00
|
|
|
sync
|
2006-11-12 23:30:03 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
chmod +x $out/bin/switch-to-configuration
|