diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-03-20 15:37:33 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-03-20 15:37:33 +0000 |
commit | f976214e1d01dba4af4fc5b5e89c3b2bd329eb10 (patch) | |
tree | c67e4d9e30c9cbb0ef511143705f2b8801312553 /tools/pygrub | |
parent | 3ba523ff957c0478665541faf061962ca3c2b82f (diff) | |
download | xen-f976214e1d01dba4af4fc5b5e89c3b2bd329eb10.tar.gz xen-f976214e1d01dba4af4fc5b5e89c3b2bd329eb10.tar.bz2 xen-f976214e1d01dba4af4fc5b5e89c3b2bd329eb10.zip |
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>
Diffstat (limited to 'tools/pygrub')
-rw-r--r-- | tools/pygrub/src/pygrub | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/pygrub/src/pygrub b/tools/pygrub/src/pygrub index e3a540fa04..ba70832e62 100644 --- a/tools/pygrub/src/pygrub +++ b/tools/pygrub/src/pygrub @@ -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 } |