boottool: support SLES10 lilo simulation wrapper round yaboot

Add support for the SLES10 fake lilo which builds a yaboot.conf in
the background and really uses that!  Note that this simulated wrapper
does not support the read-only tag, so this patch also disables that.
This flag in theory implies that root should be mounted read-only at
first boot, but the kernel always seems to do that anyway.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@1373 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/client/tools/boottool b/client/tools/boottool
index e1c093e..4cd0b97 100755
--- a/client/tools/boottool
+++ b/client/tools/boottool
@@ -395,7 +395,7 @@
   push (@newkernel, "\tappend=\"$param{args}\"\n") if defined $param{args};
   push (@newkernel, "\tinitrd=$param{initrd}\n") if defined $param{initrd};
   push (@newkernel, "\troot=$param{root}\n") if defined $param{root};
-  push (@newkernel, "\tread-only\n\n");
+  ##push (@newkernel, "\tread-only\n\n");
 
   if (!defined $param{position} || $param{position} !~ /end|\d+/) {
     $param{position}=0;
@@ -852,9 +852,17 @@
         return @boot_loader;
     } elsif (@boot_loader == 1) {
         return pop( @boot_loader );
-    } else {
-        return undef;
+    } elsif (@boot_loader == 2) {
+	if ($boot_loader[0] eq 'lilo' && $boot_loader[1] eq 'yaboot') {
+		return 'lilo';
+	}
     }
+
+    if (scalar(@boot_loader) > 1) {
+        warn "Warning: Multiple bootloader configs; not certain which is in use.\n";
+	warn "         " . join(' ', @boot_loader) . "\n";
+    }
+    return undef;
 }
 
 =head2 detect_bootloader_from_mbr([@devices])
@@ -915,6 +923,7 @@
         }
     } else {
         warn "Warning: Multiple MBR's present; not certain which is in use.\n";
+	warn "         " . join(' ', @boot_loader) . "\n";
         return undef;
     }