mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 05:33:23 +00:00
0817c307dc
svn path=/nixos/trunk/; revision=7155
32 lines
702 B
Bash
32 lines
702 B
Bash
source $stdenv/setup
|
|
|
|
ensureDir $out
|
|
|
|
ln -s $kernel $out/kernel
|
|
ln -s $grub $out/grub
|
|
ln -s $bootStage2 $out/init
|
|
ln -s $initrd $out/initrd
|
|
echo "$extraKernelParams" > $out/kernel-params
|
|
|
|
cat > $out/menu.lst << GRUBEND
|
|
kernel $kernel 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
|