mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
8c0b223c3c
NIXOS_INSTALL_GRUB is set (which we do in the installer). svn path=/nixu/trunk/; revision=7146
28 lines
626 B
Bash
28 lines
626 B
Bash
source $stdenv/setup
|
|
|
|
ensureDir $out
|
|
|
|
ln -s $kernel $out/kernel
|
|
ln -s $grub $out/grub
|
|
|
|
cat > $out/menu.lst << GRUBEND
|
|
kernel $kernel selinux=0 apm=on acpi=on init=$bootStage2 $extraKernelParams
|
|
initrd $initrd
|
|
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
|
|
mkdir -m 0700 -p /boot/grub
|
|
$grubMenuBuilder $out
|
|
if test "\$NIXOS_INSTALL_GRUB" = 1; then
|
|
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
|
|
fi
|
|
fi
|
|
EOF
|
|
|
|
chmod +x $out/bin/switch-to-configuration
|