virt-manager/360fe110-add-s390x-arch-support.patch
Charles Arnold 35c5930eff - Add upstream s390x support patch (bnc#869024)
360fe110-add-s390x-arch-support.patch
  virtinst-add-ppc64-arch-support.patch
  Drop virtinst-add-s390x-ppc64-arch-support.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=264
2015-09-11 17:24:15 +00:00

72 lines
2.9 KiB
Diff

Subject: virtinst: correctly find the sles s390x kernel and initrd
From: Charles Arnold carnold@suse.com Fri Sep 11 09:41:09 2015 -0600
Date: Fri Sep 11 12:48:52 2015 -0400:
Git: 360fe11040b0d7dc0235aecf10e96536619c616b
Allow virt-install to correctly find the SLES kernel/initrd on the media
when installing an s390x VM.
Signed-off-by: Charles Arnold <carnold@suse.com>
(crobinso: fix minor pep8 issues)
diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index c48e9d5..40f7c05 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -369,6 +369,8 @@ def _distroFromSUSEContent(fetcher, arch, vmtype=None):
arch = "x86_64"
elif cbuf.find("i586") != -1:
arch = "i586"
+ elif cbuf.find("s390x") != -1:
+ arch = "s390x"
dclass = GenericDistro
if distribution:
@@ -934,16 +936,22 @@ class SuseDistro(Distro):
oldkern += "64"
oldinit += "64"
- # Tested with Opensuse >= 10.2, 11, and sles 10
- self._hvm_kernel_paths = [("boot/%s/loader/linux" % self.arch,
- "boot/%s/loader/initrd" % self.arch)]
- # Tested with Opensuse 10.0
- self._hvm_kernel_paths.append(("boot/loader/%s" % oldkern,
- "boot/loader/%s" % oldinit))
+ if self.arch == "s390x":
+ self._hvm_kernel_paths = [("boot/%s/linux" % self.arch,
+ "boot/%s/initrd" % self.arch)]
+ # No Xen on s390x
+ self._xen_kernel_paths = []
+ else:
+ # Tested with Opensuse >= 10.2, 11, and sles 10
+ self._hvm_kernel_paths = [("boot/%s/loader/linux" % self.arch,
+ "boot/%s/loader/initrd" % self.arch)]
+ # Tested with Opensuse 10.0
+ self._hvm_kernel_paths.append(("boot/loader/%s" % oldkern,
+ "boot/loader/%s" % oldinit))
- # Matches Opensuse > 10.2 and sles 10
- self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch,
- "boot/%s/initrd-xen" % self.arch)]
+ # Matches Opensuse > 10.2 and sles 10
+ self._xen_kernel_paths = [("boot/%s/vmlinuz-xen" % self.arch,
+ "boot/%s/initrd-xen" % self.arch)]
def _variantFromVersion(self):
distro_version = self.version_from_content[1].strip()
@@ -971,6 +979,13 @@ class SuseDistro(Distro):
self._variantFromVersion()
self.os_variant = self._detect_osdict_from_url()
+
+ # Reset kernel name for sle11 source on s390x
+ if self.arch == "s390x":
+ if self.os_variant == "sles11" or self.os_variant == "sled11":
+ self._hvm_kernel_paths = [("boot/%s/vmrdr.ikr" % self.arch,
+ "boot/%s/initrd" % self.arch)]
+
return True
def _get_method_arg(self):