xen/pygrub-boot-legacy-sles.patch
Charles Arnold 508747f303 - Update to Xen 4.20.0 pre-release (jsc#PED-8907)
xen-4.20.0-testing-src.tar.bz2
- New Features
  * On Arm:
    - Experimental support for Armv8-R.
    - Support for NXP S32G3 Processors Family and NXP LINFlexD UART driver.
    - Basic handling for SCMI requests over SMC using Shared Memory, by allowing
      forwarding the calls to EL3 FW if coming from hwdom.
    - Support for LLC (Last Level Cache) coloring.
  * On x86:
    - xl suspend/resume subcommands.
- Changed Features
  * Fixed blkif protocol specification for sector sizes different than 512b.
  * The dombuilder in libxenguest no longer un-gzips secondary modules, instead
    leaving this to the guest kernel to do in guest context.
  * On x86:
    - Prefer ACPI reboot over UEFI ResetSystem() run time service call.
    - Switched the xAPIC flat driver to use physical destination mode for external
      interrupts instead of logical destination mode.
- Removed Features
  * On x86:
    - Support for running on Xeon Phi processors.
    - Removed the `ucode=allow-same` command line option.
    - Removed x2APIC Cluster Mode for external interrupts.  x2APIC Physical and
      Mixed Modes are still available.
- Dropped patches
  xsa466.patch

- Move /etc/bash_completion.d/xl back to %_datadir/bash-completion/completions

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=863
2025-01-02 17:22:02 +00:00

64 lines
2.4 KiB
Diff

Index: xen-4.19.0-testing/tools/pygrub/src/pygrub
===================================================================
--- xen-4.19.0-testing.orig/tools/pygrub/src/pygrub
+++ xen-4.19.0-testing/tools/pygrub/src/pygrub
@@ -593,7 +593,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)
@@ -768,6 +768,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]
@@ -854,6 +868,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)" % repr(kernel)
if ramdisk:
@@ -932,7 +959,7 @@ if __name__ == "__main__":
debug = False
not_really = False
output_format = "sxp"
- output_directory = "/var/run/xen/pygrub/"
+ output_directory = "/var/run/xen"
uid = None
# what was passed in