ia64/xen-unstable

changeset 19425:6a069ea7149b

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@redhat.com>
author Keir Fraser <keir.fraser@citrix.com>
date Fri Mar 20 15:37:33 2009 +0000 (2009-03-20)
parents 1dd7b640d953
children 11650ecdd31e
files tools/pygrub/src/pygrub
line diff
     1.1 --- a/tools/pygrub/src/pygrub	Fri Mar 20 12:33:55 2009 +0000
     1.2 +++ b/tools/pygrub/src/pygrub	Fri Mar 20 15:37:33 2009 +0000
     1.3 @@ -530,7 +530,11 @@ def run_grub(file, entry, fs, arg):
     1.4          print "No kernel image selected!"
     1.5          sys.exit(1)
     1.6  
     1.7 -    img = g.cf.images[sel]
     1.8 +    try:
     1.9 +        img = g.cf.images[sel]
    1.10 +    except:
    1.11 +        log.debug("PyGrub: Default selection is not valid, using first boot configuration...")
    1.12 +        img = g.cf.images[0]
    1.13  
    1.14      grubcfg = { "kernel": None, "ramdisk": None, "args": None }
    1.15