
I've come across a bug in boottool that comes up when using lilo as your
bootloader. Basically, if the label of the default image on your machine is
numeric then boottool interprets it as an index into the list of boot images
instead of as a string that it should match against the image labels. So
when tries to look up information about the default image it uses the wrong
one; in most cases it just gets an undef value as the default image. The end
result was that when adding a new kernel using boottool it would screw up
the value of image, and so lilo would of course refuse to boot to the new
kernel because it couldn't find the image file.

I've attached a simple patch that fixes the bug if you're using lilo, but I
don't know how this will impact other boot loaders that boottool is supposed
to work with. If there's another loader out there that interprets numeric
labels as an index and non-numeric labels as an image label, then this patch
will break in that case.

John Admanski

Index: client/tools/boottool
===================================================================
--- client/tools/boottool	(revision 1009)
+++ client/tools/boottool	(working copy)
@@ -236,7 +236,7 @@
     $sections[0]{'default'} = '0';
 
   # if default is label name, we need position
-  } elsif ($sections[0]{'default'} !~ m/^\d+$/) {
+  } else {
     foreach my $index (1..$#sections) {
       if ($sections[$index]{'title'} eq $sections[0]{'default'}) {
         $sections[0]{'default'} = $index-1;
