All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make PyGrub run first entry in grub config when invalid default boot option provided
@ 2009-03-20 14:14 Michal Novotny
  2009-03-23 17:08 ` Ian Jackson
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Novotny @ 2009-03-20 14:14 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 410 bytes --]

Hello everybody,
I have created a patch for pygrub and I am sending it as an attachment. 
This patch mainly solves the issue of invalid default boot option in 
VM's configuration. If the entry doesn't exist, it doesn't exit with 
IndexError python exception but it uses first entry there to boot up the 
machine - same way like standard (real) grub does...

Signed-off-by: Michal Novotny <minovotn@redhat.com>

[-- Attachment #2: xen-pygrub-invalid-default-configuration.patch --]
[-- Type: text/plain, Size: 532 bytes --]

diff -r e1562a36094e tools/pygrub/src/pygrub
--- a/tools/pygrub/src/pygrub	Thu Mar 19 17:04:06 2009 +0000
+++ b/tools/pygrub/src/pygrub	Fri Mar 20 15:09:31 2009 +0100
@@ -530,7 +530,11 @@
         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 }
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-03-24 13:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20 14:14 [PATCH] Make PyGrub run first entry in grub config when invalid default boot option provided Michal Novotny
2009-03-23 17:08 ` Ian Jackson
2009-03-24  9:21   ` Michal Novotny
2009-03-24 13:33     ` Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.