--- 10_linux 2009-08-10 19:49:44.000000000 +0200 +++ 10_linux.new 2009-09-27 16:09:49.490014838 +0200 @@ -66,7 +66,17 @@ if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` -while [ "x$list" != "x" ] ; do +# Validate GRUB_HOW_MANY variable +case "$GRUB_HOW_MANY" in + [0-9]|[0-9][0-9]) + howmany=$GRUB_HOW_MANY + ;; + *) + howmany=99 + ;; +esac + +while [ "x$list" != "x" -a $howmany -gt 0 ] ; do linux=`version_find_latest $list` echo "Found linux image: $linux" >&2 basename=`basename $linux` @@ -75,6 +85,7 @@ version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` alt_version=`echo $version | sed -e "s,\.old$,,g"` linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + howmany=$((howmany-1)) initrd= for i in "initrd.img-${version}" "initrd-${version}.img" \