nixpkgs-suyu/test/system-configuration.sh
Eelco Dolstra 2cccff268d * Pass the path of the stage 2 init script to stage 1 init through the
kernel command line, instead of having a /init symlink.  This allows
  us to switch between configurations.
* Some debug support: adding `debug' to the kernel command line gives
  a stage 1 shell.

svn path=/nixu/trunk/; revision=7107
2006-11-24 00:04:29 +00:00

25 lines
519 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
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
$grubMenuBuilder $out
$grub/sbin/grub-install "$grubDevice" --no-floppy --recheck
fi
EOF
chmod +x $out/bin/switch-to-configuration