Turns out grub shipped by OpenSUSE 12.1 has the batch cmd
savedefault disabled:

linux-yk2o:~ # grub --batch

    GNU GRUB  version 0.97  (640K lower / 3072K upper memory)

 [ Minimal BASH-like line editing is supported.  For the first word, TAB
   lists possible command completions.  Anywhere else TAB lists the
possible
   completions of a device/filename. ]
grub> savedefault --default=0 --once
savedefault --default=0 --once

Error 27: Unrecognized command

Horray for great engineering decisions! Kudos to the OpenSUSE team.

Also, since this wasn't captured by our code, it means
it went to stdout rather than stderr. So let's capture
both stdout and stderr to look for errors instead.

Signed-off-by: Lucas Meneghel Rodrigues <[email protected]>
---
 client/tools/boottool |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/client/tools/boottool b/client/tools/boottool
index 13ddd3a..5789869 100755
--- a/client/tools/boottool
+++ b/client/tools/boottool
@@ -1410,12 +1410,19 @@ class Grubby(object):
                              stdin=subprocess.PIPE,
                              stdout=subprocess.PIPE,
                              stderr=subprocess.PIPE)
-        _, err = p.communicate(grub_instructions_text)
+        out, err = p.communicate(grub_instructions_text)
 
+        complete_out = ''
+        if out is not None:
+            complete_out = out
         if err is not None:
-            harmless = ['Probing devices to guess BIOS drives. '
+            complete_out += err
+
+        if complete_out:
+            harmless = [grub_instructions,
+                        'Probing devices to guess BIOS drives. '
                         'This may take a long time.']
-            err_lines = err.splitlines()
+            err_lines = complete_out.splitlines()
             err_harmful = [l for l in err_lines if l and l not in harmless]
 
             if err_harmful:
-- 
1.7.10.2

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to