xen/pygrub-boot-legacy-sles.patch
Charles Arnold abf8af324b - Update to Xen 4.5.0 FCS
- Include systemd presets in 13.2 and older

- bnc#897352 - Enable xencommons/xendomains only during fresh install 
- disable restart on upgrade because the toolstack is not restartable

- adjust seabios, vgabios, stubdom and hvmloader build to reduce
  build-compare noise
  xen.build-compare.mini-os.patch
  xen.build-compare.smbiosdate.patch
  xen.build-compare.ipxe.patch
  xen.build-compare.vgabios.patch
  xen.build-compare.seabios.patch
  xen.build-compare.man.patch

- Update to Xen 4.5.0 RC4

- Remove xend specific if-up scripts
  Recording bridge slaves is a generic task which should be handled
  by generic network code

- Use systemd features from upstream
  requires updated systemd-presets-branding package

- Update to Xen 4.5.0 RC3

- Set GIT, WGET and FTP to /bin/false

- Use new configure features instead of make variables

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=337
2015-01-14 20:58:52 +00:00

64 lines
2.4 KiB
Diff

Index: xen-4.5.0-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-4.5.0-testing.orig/tools/pygrub/src/pygrub
+++ xen-4.5.0-testing/tools/pygrub/src/pygrub
@@ -450,7 +450,7 @@ class Grub:
self.cf.filename = f
break
if self.__dict__.get('cf', None) is None:
- raise RuntimeError, "couldn't find bootloader config file in the image provided."
+ return
f = fs.open_file(self.cf.filename)
# limit read size to avoid pathological cases
buf = f.read(FS_READ_MAX)
@@ -622,6 +622,20 @@ def run_grub(file, entry, fs, cfg_args):
g = Grub(file, fs)
+ # If missing config or grub has no menu entries to select, look for
+ # vmlinuz-xen and initrd-xen in /boot
+ if g.__dict__.get('cf', None) is None or len(g.cf.images) == 0 or re.search(r"xen(-pae)?\.gz",g.cf.images[0].kernel[1]):
+ if not list_entries:
+ 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 g.__dict__.get('cf', None) is None:
+ raise RuntimeError, "couldn't find bootloader config file in the image provided."
+ else:
+ return
+
if list_entries:
for i in range(len(g.cf.images)):
img = g.cf.images[i]
@@ -717,6 +731,19 @@ def sniff_netware(fs, cfg):
return cfg
+def sniff_xen_kernel(fs, cfg):
+ if not cfg["kernel"]:
+ if fs.file_exists('/boot/vmlinuz-xen'):
+ cfg["kernel"] = '/boot/vmlinuz-xen'
+ elif fs.file_exists('/boot/vmlinuz-xenpae'):
+ cfg["kernel"] = '/boot/vmlinuz-xenpae'
+ if cfg["kernel"] and not cfg["ramdisk"]:
+ if fs.file_exists('/boot/initrd-xen'):
+ cfg["ramdisk"] = '/boot/initrd-xen'
+ elif fs.file_exists('/boot/initrd-xenpae'):
+ cfg["ramdisk"] = '/boot/initrd-xenpae'
+ return cfg
+
def format_sxp(kernel, ramdisk, args):
s = "linux (kernel %s)" % kernel
if ramdisk:
@@ -797,7 +824,7 @@ if __name__ == "__main__":
debug = False
not_really = False
output_format = "sxp"
- output_directory = "/var/run/xen/pygrub"
+ output_directory = "/var/run/xen"
# what was passed in
incfg = { "kernel": None, "ramdisk": None, "args": "" }