Index: xen-4.3.1-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-4.3.1-testing.orig/tools/pygrub/src/pygrub
+++ xen-4.3.1-testing/tools/pygrub/src/pygrub
@@ -607,6 +607,14 @@ def run_grub(file, entry, fs, cfg_args):
print " args: %s" % img.args
print " initrd: %s" % img.initrd[1]
+ # If grub has no menu entries to select, look for vmlinuz-xen and initrd-xen in /boot
+ if len(g.cf.images) == 0:
+ chosencfg = { "kernel": None, "ramdisk": None, "args": "" }
+ chosencfg = sniff_xen_kernel(fs, incfg)
+ if chosencfg["kernel"] and chosencfg["ramdisk"]:
+ chosencfg["args"] = cfg_args
+ return chosencfg
+
if interactive and not list_entries:
curses.wrapper(run_main)
else:
@@ -693,6 +701,14 @@ def sniff_netware(fs, cfg):
return cfg
+def sniff_xen_kernel(fs, cfg):
+ if not cfg["kernel"] and fs.file_exists('/boot/vmlinuz-xen'):
+ cfg["kernel"] = '/boot/vmlinuz-xen'
+ if cfg["kernel"] and not cfg["ramdisk"]:
+ if fs.file_exists('/boot/initrd-xen'):
+ cfg["ramdisk"] = '/boot/initrd-xen'
+ return cfg
def format_sxp(kernel, ramdisk, args):
s = "linux (kernel %s)" % kernel
if ramdisk: