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 <