From 99a2f550c05e115b050d11d95b5c7a5ff7fed044 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Thu, 10 Jan 2008 04:43:19 +0000 Subject: [PATCH] Modifications to grub-menu-builder: copy default kernel and initrd to /boot/nixos-.. , limit menu size svn path=/nixos/trunk/; revision=10106 --- installer/grub-menu-builder.sh | 16 ++++++++++++++++ system/options.nix | 9 +++++++++ system/system.nix | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/installer/grub-menu-builder.sh b/installer/grub-menu-builder.sh index 4ad99bebb56..6b5614e9a57 100644 --- a/installer/grub-menu-builder.sh +++ b/installer/grub-menu-builder.sh @@ -35,12 +35,18 @@ if test -n "@grubSplashImage@"; then echo "splashimage $splashLocation" >> $tmp fi +configurationCounter=0; addEntry() { local name="$1" local path="$2" local shortSuffix="$3" + configurationCounter=$((configurationCounter + 1)) + if test $configurationCounter -gt @configurationLimit@ ; then + return + fi; + if ! test -e $path/kernel -a -e $path/initrd; then return fi @@ -48,6 +54,16 @@ addEntry() { local kernel=$(readlink -f $path/kernel) local initrd=$(readlink -f $path/initrd) + if test "$path" = "$default"; then + cp "$kernel" /boot/nixos-kernel + cp "$initrd" /boot/nixos-initrd + cp "$(readlink -f "$path/init")" /boot/nixos-init + cat > /boot/nixos-grub-config <