[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] pygrub: run first entry in config when invalid default boot option provided



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1237563453 0
# Node ID 6a069ea7149b9b77003f246470ef47ed777b2b36
# Parent  1dd7b640d9534bf1dd2f6f07d6f75ab7ed2c086c
pygrub: run first entry in config when invalid default boot option provided

This behaviour matches that of real GRUB.

Signed-off-by: Michal Novotny <minovotn@xxxxxxxxxx>
---
 tools/pygrub/src/pygrub |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -r 1dd7b640d953 -r 6a069ea7149b tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub   Fri Mar 20 12:33:55 2009 +0000
+++ b/tools/pygrub/src/pygrub   Fri Mar 20 15:37:33 2009 +0000
@@ -530,7 +530,11 @@ def run_grub(file, entry, fs, arg):
         print "No kernel image selected!"
         sys.exit(1)
 
-    img = g.cf.images[sel]
+    try:
+        img = g.cf.images[sel]
+    except:
+        log.debug("PyGrub: Default selection is not valid, using first boot 
configuration...")
+        img = g.cf.images[0]
 
     grubcfg = { "kernel": None, "ramdisk": None, "args": None }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.