From 7ffc87b6a6465e1e93379859edca2ab336405672 Mon Sep 17 00:00:00 2001 From: Chris Lalancette Date: Mar 16 2019 15:31:37 +0000 Subject: Update to upstream 0.17.0. Signed-off-by: Chris Lalancette --- diff --git a/01-clarify-bz-instance.patch b/01-clarify-bz-instance.patch new file mode 100644 index 0000000..ca66636 --- /dev/null +++ b/01-clarify-bz-instance.patch @@ -0,0 +1,37 @@ +From fbce72eb95ab15f5c830c542333e9007f3126487 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 23 Jan 2019 03:00:08 +0000 +Subject: [PATCH 01/13] Clarify bugzilla instance for bug references + +Substitute BZ -> RHBZ to clarify BZ locations. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 4f66c2f..034749d 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -465,7 +465,7 @@ class Guest(object): + oz.ozutil.lxml_subelement(features, "pae") + # CPU + if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": +- # Possibly related to BZ 1171501 - need host passthrough for aarch64 and arm with kvm ++ # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm + cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'custom', 'match': 'exact'}) + oz.ozutil.lxml_subelement(cpu, "model", "host", {'fallback': 'allow'}) + # os +@@ -597,7 +597,7 @@ class Guest(object): + + capacity = size + if backing_filename: +- # FIXME: Revisit as BZ 958510 evolves ++ # FIXME: Revisit as RHBZ 958510 evolves + # At the moment libvirt forces us to specify a size rather than + # assuming we want to inherit the size of our backing file. + # It may be possible to avoid this inspection step if libvirt +-- +2.20.1 + diff --git a/02-drop-armv7-special-console-handling.patch b/02-drop-armv7-special-console-handling.patch new file mode 100644 index 0000000..4276dc0 --- /dev/null +++ b/02-drop-armv7-special-console-handling.patch @@ -0,0 +1,29 @@ +From 9e8592849675baa11a30774550a24b34d5611b1b Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 14 Mar 2019 12:41:01 +0000 +Subject: [PATCH 02/13] drop ARMv7 special handling for console port + +It's unnecessary and breaks grpahical output. Qemu generates a DT with all +the appropriate bits in it to setup the console. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 034749d..e346904 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -481,8 +481,6 @@ class Guest(object): + if initrd: + oz.ozutil.lxml_subelement(osNode, "initrd", initrd) + if cmdline: +- if self.tdl.arch == "armv7l": +- cmdline += " console=ttyAMA0" + oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline) + if self.tdl.arch == "aarch64": + loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) +-- +2.20.1 + diff --git a/03-add-appropriate-arch-checks.patch b/03-add-appropriate-arch-checks.patch new file mode 100644 index 0000000..c6754da --- /dev/null +++ b/03-add-appropriate-arch-checks.patch @@ -0,0 +1,37 @@ +From 0b32e08e5ddfd7088297d267aed71950219dad79 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 27 Feb 2019 10:54:43 +0000 +Subject: [PATCH 03/13] Add appropriate arch checks for architecture specific + features + +In a lot of cases qemu just ignores incorrect cmd line options when run +against a different architecture but sometimes it causes issues so lets +add the appropriate checks to ensure no issues. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index e346904..e3a5da5 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -460,9 +460,11 @@ class Guest(object): + oz.ozutil.lxml_subelement(domain, "vcpu", str(self.install_cpus)) + # features + features = oz.ozutil.lxml_subelement(domain, "features") +- oz.ozutil.lxml_subelement(features, "acpi") +- oz.ozutil.lxml_subelement(features, "apic") +- oz.ozutil.lxml_subelement(features, "pae") ++ if self.tdl.arch in ["aarch64", "x86_64"]: ++ oz.ozutil.lxml_subelement(features, "acpi") ++ if self.tdl.arch in ["x86_64"]: ++ oz.ozutil.lxml_subelement(features, "apic") ++ oz.ozutil.lxml_subelement(features, "pae") + # CPU + if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": + # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm +-- +2.20.1 + diff --git a/04-armv7-define-gicv2.patch b/04-armv7-define-gicv2.patch new file mode 100644 index 0000000..69fd31e --- /dev/null +++ b/04-armv7-define-gicv2.patch @@ -0,0 +1,29 @@ +From 1048f98e3606781696f1a81704235960f426519d Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 27 Feb 2019 10:56:36 +0000 +Subject: [PATCH 04/13] ARMv7 only supports GICv2 so we need to explicitly + define it + +Add the GIC version to the cpu features list to ensure we get the right GIC + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/oz/Guest.py b/oz/Guest.py +index e3a5da5..4e74fe1 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -465,6 +465,8 @@ class Guest(object): + if self.tdl.arch in ["x86_64"]: + oz.ozutil.lxml_subelement(features, "apic") + oz.ozutil.lxml_subelement(features, "pae") ++ if self.tdl.arch in ["armv7l"]: ++ oz.ozutil.lxml_subelement(features, "gic", attributes={'version': '2'}) + # CPU + if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": + # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm +-- +2.20.1 + diff --git a/05-arm-fix-input-devices.patch b/05-arm-fix-input-devices.patch new file mode 100644 index 0000000..267f859 --- /dev/null +++ b/05-arm-fix-input-devices.patch @@ -0,0 +1,46 @@ +From c197d163ccbd2997d400942e14442257dd9d2285 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 27 Feb 2019 11:08:25 +0000 +Subject: [PATCH 05/13] Fix input devices for ARMv7 and aarch64 + +The Arm architectures don't work well with the legacy ps2 bits causing +issues with graphical output. Qemu also doesn't, due to a historical +oversight, automatically setup input so we need to do it here else +graphical out and hence screenshots don't work. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 4e74fe1..418b888 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -255,7 +255,10 @@ class Guest(object): + self.clockoffset = "utc" + self.mousetype = mousetype + if self.mousetype is None: +- self.mousetype = "ps2" ++ if self.tdl.arch in ["aarch64", "armv7l"]: ++ self.mousetype = "usb" ++ else: ++ self.mousetype = "ps2" + if diskbus is None or diskbus == "ide": + self.disk_bus = "ide" + self.disk_dev = "hda" +@@ -512,6 +515,11 @@ class Guest(object): + elif self.mousetype == "usb": + mousedict['type'] = 'tablet' + oz.ozutil.lxml_subelement(devices, "input", None, mousedict) ++ if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": ++ # Other arches add a keyboard by default, for historical reasons ARM doesn't ++ # so we add it here so graphical works and hence we can get debug screenshots RHBZ 1538637 ++ oz.ozutil.lxml_subelement(devices, 'controller', None, {'type': 'usb', 'index': '0'}) ++ oz.ozutil.lxml_subelement(devices, 'input', None, {'type': 'keyboard', 'bus': 'usb'}) + # serial console pseudo TTY + console = oz.ozutil.lxml_subelement(devices, "serial", None, {'type': 'pty'}) + oz.ozutil.lxml_subelement(console, "target", None, {'port': '0'}) +-- +2.20.1 + diff --git a/06-setup-graphical-all-except-s390x.patch b/06-setup-graphical-all-except-s390x.patch new file mode 100644 index 0000000..e13fc1b --- /dev/null +++ b/06-setup-graphical-all-except-s390x.patch @@ -0,0 +1,33 @@ +From d4c4ea8c4ea77471fc72639d31c38d3d39bc0453 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 23 Jan 2019 03:19:21 +0000 +Subject: [PATCH 06/13] Setup graphical console on all architectures except + s390x + +The graphical console is now supported on all architectures except +s390x so set it up to enable screenshot fucntionality across all +supported architectures. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 418b888..dfb63e4 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -500,8 +500,8 @@ class Guest(object): + # devices + devices = oz.ozutil.lxml_subelement(domain, "devices") + # graphics +- if self.tdl.arch not in ["aarch64", "armv7l", "s390x"]: +- # qemu for arm/aarch64/s390x does not support a graphical console - amazingly ++ if not self.tdl.arch in ["s390x"]: ++ # qemu for s390x does not support a graphical console + oz.ozutil.lxml_subelement(devices, "graphics", None, {'port': '-1', 'type': 'vnc'}) + # network + interface = oz.ozutil.lxml_subelement(devices, "interface", None, {'type': 'bridge'}) +-- +2.20.1 + diff --git a/07-use-2gb-ram.patch b/07-use-2gb-ram.patch new file mode 100644 index 0000000..d98ab16 --- /dev/null +++ b/07-use-2gb-ram.patch @@ -0,0 +1,35 @@ +From fb257ff2fbb66a732a1369445b8c580a4ec61339 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 27 Feb 2019 12:30:07 +0000 +Subject: [PATCH 07/13] Default to using 2Gb on all architectures + +The original 1Gb should be enough but RAM is cheap and sometimes things +like the initrd unexpectently bloat so 2Gb gives us room to move. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index dfb63e4..3bb144e 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -178,13 +178,8 @@ class Guest(object): + 1) + # the memory in the configuration file is specified in megabytes, but + # libvirt expects kilobytes, so multiply by 1024 +- if self.tdl.arch in ["ppc64", "ppc64le"]: +- # ppc64 needs at least 2Gb RAM +- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', ++ self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', + 'memory', 2048)) * 1024 +- else: +- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', +- 'memory', 1024)) * 1024 + self.image_type = oz.ozutil.config_get_key(config, 'libvirt', + 'image_type', 'raw') + +-- +2.20.1 + diff --git a/08-add-latest-location-ovmf.patch b/08-add-latest-location-ovmf.patch new file mode 100644 index 0000000..1ca7f78 --- /dev/null +++ b/08-add-latest-location-ovmf.patch @@ -0,0 +1,29 @@ +From e274f7bbcac0ef1ccc6ccd7e98fd645793c5a649 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 23 Jan 2019 03:05:22 +0000 +Subject: [PATCH 08/13] Add the latest location for EDK2 OVMF firmware location + +The Tianocore EDK2 OVMF firmware can now often be found in the +/usr/share/edk2/ovmf location so add this as an extra option. + +Signed-off-by: Peter Robinson +--- + oz/ozutil.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/oz/ozutil.py b/oz/ozutil.py +index 273a028..989c9d4 100644 +--- a/oz/ozutil.py ++++ b/oz/ozutil.py +@@ -1050,6 +1050,8 @@ def find_uefi_firmware(arch): + elif arch in ['x86_64']: + uefi_list = [UEFI('/usr/share/OVMF/OVMF_CODE.fd', + '/usr/share/OVMF/OVMF_VARS.fd'), ++ UEFI('/usr/share/edk2/ovmf/OVMF_CODE.fd', ++ '/usr/share/edk2/ovmf/OVMF_VARS.fd'), + UEFI('/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd', + '/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd')] + elif arch in ['aarch64']: +-- +2.20.1 + diff --git a/09-add-tianocore-check.patch b/09-add-tianocore-check.patch new file mode 100644 index 0000000..aa9c5ee --- /dev/null +++ b/09-add-tianocore-check.patch @@ -0,0 +1,31 @@ +From c24fa91acae23bdce21595654db002521f49fef2 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Wed, 23 Jan 2019 03:12:50 +0000 +Subject: [PATCH 09/13] Add check for TianoCore EDK2 firmware for ARMv7 + +There's now TianoCore EDK2 firmwares for ARMv7 so add a check to +see if they're available in preparation of building UEFI enabled +ARMv7 images. + +Signed-off-by: Peter Robinson +--- + oz/ozutil.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/oz/ozutil.py b/oz/ozutil.py +index 989c9d4..d6a4a28 100644 +--- a/oz/ozutil.py ++++ b/oz/ozutil.py +@@ -1061,6 +1061,9 @@ def find_uefi_firmware(arch): + '/usr/share/edk2/aarch64/vars-template-pflash.raw'), + UEFI('/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw', + '/usr/share/edk2.git/aarch64/vars-template-pflash.raw')] ++ elif arch in ['armv7l']: ++ uefi_list = [UEFI('/usr/share/edk2/arm/QEMU_EFI-pflash.raw', ++ '/usr/share/edk2/arm/vars-template-pflash.raw')] + else: + raise Exception("Invalid arch for UEFI firmware") + +-- +2.20.1 + diff --git a/10-check-edk2-firmware-armv7.patch b/10-check-edk2-firmware-armv7.patch new file mode 100644 index 0000000..70371dc --- /dev/null +++ b/10-check-edk2-firmware-armv7.patch @@ -0,0 +1,29 @@ +From a23d97852bd5a6693920a4f9c823f606e244f783 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 14 Mar 2019 12:46:38 +0000 +Subject: [PATCH 10/13] Check for UEFI EDK2 firmware on ARMv7 + +Checks for EDK2 firmware on ARMv7 along side aarch64 as it now also +supports UEFI now if the firmware is available. + +Signed-off-by: Peter Robinson +--- + oz/Guest.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/oz/Guest.py b/oz/Guest.py +index 3bb144e..fc3ae6d 100644 +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -484,7 +484,7 @@ class Guest(object): + oz.ozutil.lxml_subelement(osNode, "initrd", initrd) + if cmdline: + oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline) +- if self.tdl.arch == "aarch64": ++ if self.tdl.arch in ["aarch64", "armv7l"]: + loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) + oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) + oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) +-- +2.20.1 + diff --git a/11-make-uefi-configurable.patch b/11-make-uefi-configurable.patch new file mode 100644 index 0000000..463278a --- /dev/null +++ b/11-make-uefi-configurable.patch @@ -0,0 +1,180 @@ +From 00047d25ca9b4afbcc692f36617c38e82b375591 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 14 Mar 2019 13:02:47 +0000 +Subject: [PATCH 11/13] Make whether we use UEFI configurable on devices that + have legacy options + +This allows us to specifiy whether a OS version supports/defaults to +UEFI or legacy BIOS on x86. + +Signed-off-by: Peter Robinson +--- + oz/Fedora.py | 15 ++++++++++++--- + oz/Guest.py | 15 ++++++++++----- + oz/Linux.py | 4 ++-- + oz/RedHat.py | 12 ++++++------ + 4 files changed, 30 insertions(+), 16 deletions(-) + +diff --git a/oz/Fedora.py b/oz/Fedora.py +--- a/oz/Fedora.py ++++ b/oz/Fedora.py +@@ -32,7 +32,7 @@ class FedoraConfiguration(object): + """ + def __init__(self, has_virtio_channel, use_yum, use_dev_cdrom_device, + createpart, directkernel, default_netdev, default_diskbus, +- brokenisomethod, haverepo): ++ brokenisomethod, haverepo, useuefi=False): + self._has_virtio_channel = has_virtio_channel + self._use_yum = use_yum + self._use_dev_cdrom_device = use_dev_cdrom_device +@@ -42,6 +42,7 @@ class FedoraConfiguration(object): + self._default_diskbus = default_diskbus + self._brokenisomethod = brokenisomethod + self._haverepo = haverepo ++ self._useuefi = useuefi + + @property + def has_virtio_channel(self): +@@ -107,6 +108,13 @@ class FedoraConfiguration(object): + """ + return self._haverepo + ++ @property ++ def useuefi(self): ++ """ ++ Property method for whether to default to using UEFI as firmware or legacy method. ++ """ ++ return self._useuefi ++ + + version_to_config = { + '29': FedoraConfiguration(has_virtio_channel=True, use_yum=False, +@@ -235,7 +243,7 @@ class FedoraGuest(oz.RedHat.RedHatLinuxC + # ignored now; we leave it in place for backwards API compatibility. + def __init__(self, tdl, config, auto, nicmodel, haverepo, diskbus, # pylint: disable=unused-argument + brokenisomethod, output_disk=None, macaddress=None, # pylint: disable=unused-argument +- assumed_update=None): ++ assumed_update=None, useuefi=False): + self.config = version_to_config[tdl.update] + if nicmodel is None: + nicmodel = self.config.default_netdev +@@ -247,7 +255,8 @@ class FedoraGuest(oz.RedHat.RedHatLinuxC + oz.RedHat.RedHatLinuxCDYumGuest.__init__(self, tdl, config, auto, + output_disk, nicmodel, diskbus, + True, True, self.config.directkernel, +- macaddress, self.config.use_yum) ++ macaddress, self.config.use_yum, ++ self.config.useuefi) + + if self.assumed_update is not None: + self.log.warning("==== WARN: TDL contains Fedora update %s, which is newer than Oz knows about; pretending this is Fedora %s, but this may fail ====", tdl.update, assumed_update) +diff --git a/oz/Guest.py b/oz/Guest.py +--- a/oz/Guest.py ++++ b/oz/Guest.py +@@ -129,7 +129,7 @@ class Guest(object): + self._discover_libvirt_type() + + def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, +- mousetype, diskbus, iso_allowed, url_allowed, macaddress): ++ mousetype, diskbus, iso_allowed, url_allowed, macaddress, useuefi): + self.tdl = tdl + + # for backwards compatibility +@@ -488,6 +488,11 @@ class Guest(object): + loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) + oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) + oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) ++ # x86_64 has legacy requirements so we check for defaults as well as for edk2 ++ if self.tdl.arch in ["x86_64"] and self.config.useuefi == True: ++ loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) ++ oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) ++ oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) + # poweroff, reboot, crash + oz.ozutil.lxml_subelement(domain, "on_poweroff", "destroy") + oz.ozutil.lxml_subelement(domain, "on_reboot", "destroy") +@@ -1309,10 +1314,10 @@ class CDGuest(Guest): + self.seqnum = seqnum + + def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, +- mousetype, diskbus, iso_allowed, url_allowed, macaddress): ++ mousetype, diskbus, iso_allowed, url_allowed, macaddress, useuefi): + Guest.__init__(self, tdl, config, auto, output_disk, nicmodel, + clockoffset, mousetype, diskbus, iso_allowed, +- url_allowed, macaddress) ++ url_allowed, macaddress, useuefi) + + self.orig_iso = os.path.join(self.data_dir, "isos", + self.tdl.distro + self.tdl.update + self.tdl.arch + "-" + self.tdl.installtype + ".iso") +@@ -1777,9 +1782,9 @@ class FDGuest(Guest): + Class for guest installation via floppy disk. + """ + def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, +- mousetype, diskbus, macaddress): ++ mousetype, diskbus, macaddress, useuefi): + Guest.__init__(self, tdl, config, auto, output_disk, nicmodel, +- clockoffset, mousetype, diskbus, False, True, macaddress) ++ clockoffset, mousetype, diskbus, False, True, macaddress, useuefi) + self.orig_floppy = os.path.join(self.data_dir, "floppies", + self.tdl.distro + self.tdl.update + self.tdl.arch + ".img") + self.modified_floppy_cache = os.path.join(self.data_dir, "floppies", +diff --git a/oz/Linux.py b/oz/Linux.py +--- a/oz/Linux.py ++++ b/oz/Linux.py +@@ -33,10 +33,10 @@ class LinuxCDGuest(oz.Guest.CDGuest): + Class for Linux installation. + """ + def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, +- iso_allowed, url_allowed, macaddress): ++ iso_allowed, url_allowed, macaddress, useuefi): + oz.Guest.CDGuest.__init__(self, tdl, config, auto, output_disk, + nicmodel, None, None, diskbus, iso_allowed, +- url_allowed, macaddress) ++ url_allowed, macaddress, useuefi) + + def _test_ssh_connection(self, guestaddr): + """ +diff --git a/oz/RedHat.py b/oz/RedHat.py +--- a/oz/RedHat.py ++++ b/oz/RedHat.py +@@ -40,10 +40,10 @@ class RedHatLinuxCDGuest(oz.Linux.LinuxC + Class for RedHat-based CD guests. + """ + def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, +- iso_allowed, url_allowed, initrdtype, macaddress): ++ iso_allowed, url_allowed, initrdtype, macaddress, useuefi): + oz.Linux.LinuxCDGuest.__init__(self, tdl, config, auto, output_disk, + nicmodel, diskbus, iso_allowed, +- url_allowed, macaddress) ++ url_allowed, macaddress, useuefi) + self.crond_was_active = False + self.sshd_was_active = False + self.sshd_config = """\ +@@ -722,11 +722,11 @@ class RedHatLinuxCDYumGuest(RedHatLinuxC + Class for RedHat-based CD guests with yum support. + """ + def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, +- iso_allowed, url_allowed, initrdtype, macaddress, use_yum): ++ iso_allowed, url_allowed, initrdtype, macaddress, use_yum, useuefi): + oz.RedHat.RedHatLinuxCDGuest.__init__(self, tdl, config, auto, + output_disk, nicmodel, diskbus, + iso_allowed, url_allowed, +- initrdtype, macaddress) ++ initrdtype, macaddress, useuefi) + + self.use_yum = use_yum + +@@ -845,9 +845,9 @@ class RedHatFDGuest(oz.Guest.FDGuest): + Class for RedHat-based floppy guests. + """ + def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, +- macaddress): ++ macaddress, useuefi): + oz.Guest.FDGuest.__init__(self, tdl, config, auto, output_disk, +- nicmodel, None, None, diskbus, macaddress) ++ nicmodel, None, None, diskbus, macaddress, useuefi) + + if self.tdl.arch != "i386": + raise oz.OzException.OzException("Invalid arch " + self.tdl.arch + "for " + self.tdl.distro + " guest") +-- +2.20.1 + diff --git a/12-fix-f29-config.patch b/12-fix-f29-config.patch new file mode 100644 index 0000000..abf3f19 --- /dev/null +++ b/12-fix-f29-config.patch @@ -0,0 +1,43 @@ +From 4f5df1e7b1081c550f846e53197277a41dd9dc88 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 14 Mar 2019 13:05:13 +0000 +Subject: [PATCH 12/13] Add Fedora 29 support + +Signed-off-by: Peter Robinson +--- + oz/auto/Fedora29.auto | 23 +++++++++++++++++++++++ + 1 files changed, 23 insertions(+) + create mode 100644 oz/auto/Fedora29.auto + +diff --git a/oz/auto/Fedora29.auto b/oz/auto/Fedora29.auto +new file mode 100644 +index 0000000..1dae86a +--- /dev/null ++++ b/oz/auto/Fedora29.auto +@@ -0,0 +1,23 @@ ++install ++text ++keyboard us ++lang en_US.UTF-8 ++skipx ++network --device ens3 --bootproto dhcp ++rootpw %ROOTPW% ++firewall --disabled ++authconfig --enableshadow --enablemd5 ++selinux --enforcing ++timezone --utc America/New_York ++bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" ++ ++zerombr ++clearpart --all --initlabel ++autopart --type=lvm ++ ++reboot ++ ++%packages ++@core ++ ++%end +-- +2.20.1 + diff --git a/13-add-f30-support.patch b/13-add-f30-support.patch new file mode 100644 index 0000000..0abb6c4 --- /dev/null +++ b/13-add-f30-support.patch @@ -0,0 +1,62 @@ +From 5369c963106f2c8d53d36787b51e4d19f8057902 Mon Sep 17 00:00:00 2001 +From: Peter Robinson +Date: Thu, 14 Mar 2019 13:07:37 +0000 +Subject: [PATCH 13/13] Add Fedora 30 support + +In this release, if specified, we default to UEFI support. + +Signed-off-by: Peter Robinson +--- + oz/Fedora.py | 5 +++++ + oz/auto/Fedora30.auto | 23 +++++++++++++++++++++++ + 2 files changed, 28 insertions(+) + create mode 100644 oz/auto/Fedora30.auto + +diff --git a/oz/Fedora.py b/oz/Fedora.py +index 118fd84..34c4fe7 100644 +--- a/oz/Fedora.py ++++ b/oz/Fedora.py +@@ -117,6 +117,11 @@ class FedoraConfiguration(object): + + + version_to_config = { ++ '30': FedoraConfiguration(has_virtio_channel=True, use_yum=False, ++ use_dev_cdrom_device=True, createpart=False, ++ directkernel="cpio", default_netdev='virtio', ++ default_diskbus='virtio', brokenisomethod=False, ++ haverepo=True, useuefi=True), + '29': FedoraConfiguration(has_virtio_channel=True, use_yum=False, + use_dev_cdrom_device=True, createpart=False, + directkernel="cpio", default_netdev='virtio', +diff --git a/oz/auto/Fedora30.auto b/oz/auto/Fedora30.auto +new file mode 100644 +index 0000000..1dae86a +--- /dev/null ++++ b/oz/auto/Fedora30.auto +@@ -0,0 +1,23 @@ ++install ++text ++keyboard us ++lang en_US.UTF-8 ++skipx ++network --device ens3 --bootproto dhcp ++rootpw %ROOTPW% ++firewall --disabled ++authconfig --enableshadow --enablemd5 ++selinux --enforcing ++timezone --utc America/New_York ++bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" ++ ++zerombr ++clearpart --all --initlabel ++autopart --type=lvm ++ ++reboot ++ ++%packages ++@core ++ ++%end +-- +2.20.1 + diff --git a/fixes-and-enhancements.patch b/fixes-and-enhancements.patch deleted file mode 100644 index d5f8003..0000000 --- a/fixes-and-enhancements.patch +++ /dev/null @@ -1,641 +0,0 @@ -From fbce72eb95ab15f5c830c542333e9007f3126487 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 23 Jan 2019 03:00:08 +0000 -Subject: [PATCH 01/13] Clarify bugzilla instance for bug references - -Substitute BZ -> RHBZ to clarify BZ locations. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index 4f66c2f..034749d 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -465,7 +465,7 @@ class Guest(object): - oz.ozutil.lxml_subelement(features, "pae") - # CPU - if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": -- # Possibly related to BZ 1171501 - need host passthrough for aarch64 and arm with kvm -+ # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm - cpu = oz.ozutil.lxml_subelement(domain, "cpu", None, {'mode': 'custom', 'match': 'exact'}) - oz.ozutil.lxml_subelement(cpu, "model", "host", {'fallback': 'allow'}) - # os -@@ -597,7 +597,7 @@ class Guest(object): - - capacity = size - if backing_filename: -- # FIXME: Revisit as BZ 958510 evolves -+ # FIXME: Revisit as RHBZ 958510 evolves - # At the moment libvirt forces us to specify a size rather than - # assuming we want to inherit the size of our backing file. - # It may be possible to avoid this inspection step if libvirt --- -2.20.1 - -From 9e8592849675baa11a30774550a24b34d5611b1b Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Thu, 14 Mar 2019 12:41:01 +0000 -Subject: [PATCH 02/13] drop ARMv7 special handling for console port - -It's unnecessary and breaks grpahical output. Qemu generates a DT with all -the appropriate bits in it to setup the console. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index 034749d..e346904 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -481,8 +481,6 @@ class Guest(object): - if initrd: - oz.ozutil.lxml_subelement(osNode, "initrd", initrd) - if cmdline: -- if self.tdl.arch == "armv7l": -- cmdline += " console=ttyAMA0" - oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline) - if self.tdl.arch == "aarch64": - loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) --- -2.20.1 - -From 0b32e08e5ddfd7088297d267aed71950219dad79 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 27 Feb 2019 10:54:43 +0000 -Subject: [PATCH 03/13] Add appropriate arch checks for architecture specific - features - -In a lot of cases qemu just ignores incorrect cmd line options when run -against a different architecture but sometimes it causes issues so lets -add the appropriate checks to ensure no issues. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index e346904..e3a5da5 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -460,9 +460,11 @@ class Guest(object): - oz.ozutil.lxml_subelement(domain, "vcpu", str(self.install_cpus)) - # features - features = oz.ozutil.lxml_subelement(domain, "features") -- oz.ozutil.lxml_subelement(features, "acpi") -- oz.ozutil.lxml_subelement(features, "apic") -- oz.ozutil.lxml_subelement(features, "pae") -+ if self.tdl.arch in ["aarch64", "x86_64"]: -+ oz.ozutil.lxml_subelement(features, "acpi") -+ if self.tdl.arch in ["x86_64"]: -+ oz.ozutil.lxml_subelement(features, "apic") -+ oz.ozutil.lxml_subelement(features, "pae") - # CPU - if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": - # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm --- -2.20.1 - -From 1048f98e3606781696f1a81704235960f426519d Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 27 Feb 2019 10:56:36 +0000 -Subject: [PATCH 04/13] ARMv7 only supports GICv2 so we need to explicitly - define it - -Add the GIC version to the cpu features list to ensure we get the right GIC - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/oz/Guest.py b/oz/Guest.py -index e3a5da5..4e74fe1 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -465,6 +465,8 @@ class Guest(object): - if self.tdl.arch in ["x86_64"]: - oz.ozutil.lxml_subelement(features, "apic") - oz.ozutil.lxml_subelement(features, "pae") -+ if self.tdl.arch in ["armv7l"]: -+ oz.ozutil.lxml_subelement(features, "gic", attributes={'version': '2'}) - # CPU - if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": - # Possibly related to RHBZ 1171501 - need host passthrough for aarch64 and arm with kvm --- -2.20.1 - -From c197d163ccbd2997d400942e14442257dd9d2285 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 27 Feb 2019 11:08:25 +0000 -Subject: [PATCH 05/13] Fix input devices for ARMv7 and aarch64 - -The Arm architectures don't work well with the legacy ps2 bits causing -issues with graphical output. Qemu also doesn't, due to a historical -oversight, automatically setup input so we need to do it here else -graphical out and hence screenshots don't work. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 10 +++++++++- - 1 file changed, 9 insertions(+), 1 deletion(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index 4e74fe1..418b888 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -255,7 +255,10 @@ class Guest(object): - self.clockoffset = "utc" - self.mousetype = mousetype - if self.mousetype is None: -- self.mousetype = "ps2" -+ if self.tdl.arch in ["aarch64", "armv7l"]: -+ self.mousetype = "usb" -+ else: -+ self.mousetype = "ps2" - if diskbus is None or diskbus == "ide": - self.disk_bus = "ide" - self.disk_dev = "hda" -@@ -512,6 +515,11 @@ class Guest(object): - elif self.mousetype == "usb": - mousedict['type'] = 'tablet' - oz.ozutil.lxml_subelement(devices, "input", None, mousedict) -+ if self.tdl.arch in ["aarch64", "armv7l"] and self.libvirt_type == "kvm": -+ # Other arches add a keyboard by default, for historical reasons ARM doesn't -+ # so we add it here so graphical works and hence we can get debug screenshots RHBZ 1538637 -+ oz.ozutil.lxml_subelement(devices, 'controller', None, {'type': 'usb', 'index': '0'}) -+ oz.ozutil.lxml_subelement(devices, 'input', None, {'type': 'keyboard', 'bus': 'usb'}) - # serial console pseudo TTY - console = oz.ozutil.lxml_subelement(devices, "serial", None, {'type': 'pty'}) - oz.ozutil.lxml_subelement(console, "target", None, {'port': '0'}) --- -2.20.1 - -From d4c4ea8c4ea77471fc72639d31c38d3d39bc0453 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 23 Jan 2019 03:19:21 +0000 -Subject: [PATCH 06/13] Setup graphical console on all architectures except - s390x - -The graphical console is now supported on all architectures except -s390x so set it up to enable screenshot fucntionality across all -supported architectures. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index 418b888..dfb63e4 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -500,8 +500,8 @@ class Guest(object): - # devices - devices = oz.ozutil.lxml_subelement(domain, "devices") - # graphics -- if self.tdl.arch not in ["aarch64", "armv7l", "s390x"]: -- # qemu for arm/aarch64/s390x does not support a graphical console - amazingly -+ if not self.tdl.arch in ["s390x"]: -+ # qemu for s390x does not support a graphical console - oz.ozutil.lxml_subelement(devices, "graphics", None, {'port': '-1', 'type': 'vnc'}) - # network - interface = oz.ozutil.lxml_subelement(devices, "interface", None, {'type': 'bridge'}) --- -2.20.1 - -From fb257ff2fbb66a732a1369445b8c580a4ec61339 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 27 Feb 2019 12:30:07 +0000 -Subject: [PATCH 07/13] Default to using 2Gb on all architectures - -The original 1Gb should be enough but RAM is cheap and sometimes things -like the initrd unexpectently bloat so 2Gb gives us room to move. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 7 +------ - 1 file changed, 1 insertion(+), 6 deletions(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index dfb63e4..3bb144e 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -178,13 +178,8 @@ class Guest(object): - 1) - # the memory in the configuration file is specified in megabytes, but - # libvirt expects kilobytes, so multiply by 1024 -- if self.tdl.arch in ["ppc64", "ppc64le"]: -- # ppc64 needs at least 2Gb RAM -- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', -+ self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', - 'memory', 2048)) * 1024 -- else: -- self.install_memory = int(oz.ozutil.config_get_key(config, 'libvirt', -- 'memory', 1024)) * 1024 - self.image_type = oz.ozutil.config_get_key(config, 'libvirt', - 'image_type', 'raw') - --- -2.20.1 - -From e274f7bbcac0ef1ccc6ccd7e98fd645793c5a649 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 23 Jan 2019 03:05:22 +0000 -Subject: [PATCH 08/13] Add the latest location for EDK2 OVMF firmware location - -The Tianocore EDK2 OVMF firmware can now often be found in the -/usr/share/edk2/ovmf location so add this as an extra option. - -Signed-off-by: Peter Robinson ---- - oz/ozutil.py | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/oz/ozutil.py b/oz/ozutil.py -index 273a028..989c9d4 100644 ---- a/oz/ozutil.py -+++ b/oz/ozutil.py -@@ -1050,6 +1050,8 @@ def find_uefi_firmware(arch): - elif arch in ['x86_64']: - uefi_list = [UEFI('/usr/share/OVMF/OVMF_CODE.fd', - '/usr/share/OVMF/OVMF_VARS.fd'), -+ UEFI('/usr/share/edk2/ovmf/OVMF_CODE.fd', -+ '/usr/share/edk2/ovmf/OVMF_VARS.fd'), - UEFI('/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd', - '/usr/share/edk2.git/ovmf-x64/OVMF_VARS-pure-efi.fd')] - elif arch in ['aarch64']: --- -2.20.1 - -From c24fa91acae23bdce21595654db002521f49fef2 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Wed, 23 Jan 2019 03:12:50 +0000 -Subject: [PATCH 09/13] Add check for TianoCore EDK2 firmware for ARMv7 - -There's now TianoCore EDK2 firmwares for ARMv7 so add a check to -see if they're available in preparation of building UEFI enabled -ARMv7 images. - -Signed-off-by: Peter Robinson ---- - oz/ozutil.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/oz/ozutil.py b/oz/ozutil.py -index 989c9d4..d6a4a28 100644 ---- a/oz/ozutil.py -+++ b/oz/ozutil.py -@@ -1061,6 +1061,9 @@ def find_uefi_firmware(arch): - '/usr/share/edk2/aarch64/vars-template-pflash.raw'), - UEFI('/usr/share/edk2.git/aarch64/QEMU_EFI-pflash.raw', - '/usr/share/edk2.git/aarch64/vars-template-pflash.raw')] -+ elif arch in ['armv7l']: -+ uefi_list = [UEFI('/usr/share/edk2/arm/QEMU_EFI-pflash.raw', -+ '/usr/share/edk2/arm/vars-template-pflash.raw')] - else: - raise Exception("Invalid arch for UEFI firmware") - --- -2.20.1 - -From a23d97852bd5a6693920a4f9c823f606e244f783 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Thu, 14 Mar 2019 12:46:38 +0000 -Subject: [PATCH 10/13] Check for UEFI EDK2 firmware on ARMv7 - -Checks for EDK2 firmware on ARMv7 along side aarch64 as it now also -supports UEFI now if the firmware is available. - -Signed-off-by: Peter Robinson ---- - oz/Guest.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/oz/Guest.py b/oz/Guest.py -index 3bb144e..fc3ae6d 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -484,7 +484,7 @@ class Guest(object): - oz.ozutil.lxml_subelement(osNode, "initrd", initrd) - if cmdline: - oz.ozutil.lxml_subelement(osNode, "cmdline", cmdline) -- if self.tdl.arch == "aarch64": -+ if self.tdl.arch in ["aarch64", "armv7l"]: - loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) - oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) - oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) --- -2.20.1 - -From 00047d25ca9b4afbcc692f36617c38e82b375591 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Thu, 14 Mar 2019 13:02:47 +0000 -Subject: [PATCH 11/13] Make whether we use UEFI configurable on devices that - have legacy options - -This allows us to specifiy whether a OS version supports/defaults to -UEFI or legacy BIOS on x86. - -Signed-off-by: Peter Robinson ---- - oz/Fedora.py | 15 ++++++++++++--- - oz/Guest.py | 15 ++++++++++----- - oz/Linux.py | 4 ++-- - oz/RedHat.py | 12 ++++++------ - 4 files changed, 30 insertions(+), 16 deletions(-) - -diff --git a/oz/Fedora.py b/oz/Fedora.py -index 1d73ca1..9ecc744 100644 ---- a/oz/Fedora.py -+++ b/oz/Fedora.py -@@ -32,7 +32,7 @@ class FedoraConfiguration(object): - """ - def __init__(self, has_virtio_channel, use_yum, use_dev_cdrom_device, - createpart, directkernel, default_netdev, default_diskbus, -- brokenisomethod, haverepo): -+ brokenisomethod, haverepo, useuefi=False): - self._has_virtio_channel = has_virtio_channel - self._use_yum = use_yum - self._use_dev_cdrom_device = use_dev_cdrom_device -@@ -42,6 +42,7 @@ class FedoraConfiguration(object): - self._default_diskbus = default_diskbus - self._brokenisomethod = brokenisomethod - self._haverepo = haverepo -+ self._useuefi = useuefi - - @property - def has_virtio_channel(self): -@@ -107,6 +108,13 @@ class FedoraConfiguration(object): - """ - return self._haverepo - -+ @property -+ def useuefi(self): -+ """ -+ Property method for whether to default to using UEFI as firmware or legacy method. -+ """ -+ return self._useuefi -+ - - version_to_config = { - '28': FedoraConfiguration(has_virtio_channel=True, use_yum=False, -@@ -230,7 +238,7 @@ class FedoraGuest(oz.RedHat.RedHatLinuxCDYumGuest): - # ignored now; we leave it in place for backwards API compatibility. - def __init__(self, tdl, config, auto, nicmodel, haverepo, diskbus, # pylint: disable=unused-argument - brokenisomethod, output_disk=None, macaddress=None, # pylint: disable=unused-argument -- assumed_update=None): -+ assumed_update=None, useuefi=False): - self.config = version_to_config[tdl.update] - if nicmodel is None: - nicmodel = self.config.default_netdev -@@ -242,7 +250,8 @@ class FedoraGuest(oz.RedHat.RedHatLinuxCDYumGuest): - oz.RedHat.RedHatLinuxCDYumGuest.__init__(self, tdl, config, auto, - output_disk, nicmodel, diskbus, - True, True, self.config.directkernel, -- macaddress, self.config.use_yum) -+ macaddress, self.config.use_yum, -+ self.config.useuefi) - - if self.assumed_update is not None: - self.log.warning("==== WARN: TDL contains Fedora update %s, which is newer than Oz knows about; pretending this is Fedora %s, but this may fail ====", tdl.update, assumed_update) -diff --git a/oz/Guest.py b/oz/Guest.py -index fc3ae6d..c33a25e 100644 ---- a/oz/Guest.py -+++ b/oz/Guest.py -@@ -129,7 +129,7 @@ class Guest(object): - self._discover_libvirt_type() - - def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, -- mousetype, diskbus, iso_allowed, url_allowed, macaddress): -+ mousetype, diskbus, iso_allowed, url_allowed, macaddress, useuefi): - self.tdl = tdl - - # for backwards compatibility -@@ -488,6 +488,11 @@ class Guest(object): - loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) - oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) - oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) -+ # x86_64 has legacy requirements so we check for defaults as well as for edk2 -+ if self.tdl.arch in ["x86_64"] and self.config.useuefi == True: -+ loader, nvram = oz.ozutil.find_uefi_firmware(self.tdl.arch) -+ oz.ozutil.lxml_subelement(osNode, "loader", loader, {'readonly': 'yes', 'type': 'pflash'}) -+ oz.ozutil.lxml_subelement(osNode, "nvram", None, {'template': nvram}) - # poweroff, reboot, crash - oz.ozutil.lxml_subelement(domain, "on_poweroff", "destroy") - oz.ozutil.lxml_subelement(domain, "on_reboot", "destroy") -@@ -1314,10 +1319,10 @@ class CDGuest(Guest): - self.seqnum = seqnum - - def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, -- mousetype, diskbus, iso_allowed, url_allowed, macaddress): -+ mousetype, diskbus, iso_allowed, url_allowed, macaddress, useuefi): - Guest.__init__(self, tdl, config, auto, output_disk, nicmodel, - clockoffset, mousetype, diskbus, iso_allowed, -- url_allowed, macaddress) -+ url_allowed, macaddress, useuefi) - - self.orig_iso = os.path.join(self.data_dir, "isos", - self.tdl.distro + self.tdl.update + self.tdl.arch + "-" + self.tdl.installtype + ".iso") -@@ -1782,9 +1787,9 @@ class FDGuest(Guest): - Class for guest installation via floppy disk. - """ - def __init__(self, tdl, config, auto, output_disk, nicmodel, clockoffset, -- mousetype, diskbus, macaddress): -+ mousetype, diskbus, macaddress, useuefi): - Guest.__init__(self, tdl, config, auto, output_disk, nicmodel, -- clockoffset, mousetype, diskbus, False, True, macaddress) -+ clockoffset, mousetype, diskbus, False, True, macaddress, useuefi) - self.orig_floppy = os.path.join(self.data_dir, "floppies", - self.tdl.distro + self.tdl.update + self.tdl.arch + ".img") - self.modified_floppy_cache = os.path.join(self.data_dir, "floppies", -diff --git a/oz/Linux.py b/oz/Linux.py -index a9e8935..aef837f 100644 ---- a/oz/Linux.py -+++ b/oz/Linux.py -@@ -33,10 +33,10 @@ class LinuxCDGuest(oz.Guest.CDGuest): - Class for Linux installation. - """ - def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, -- iso_allowed, url_allowed, macaddress): -+ iso_allowed, url_allowed, macaddress, useuefi): - oz.Guest.CDGuest.__init__(self, tdl, config, auto, output_disk, - nicmodel, None, None, diskbus, iso_allowed, -- url_allowed, macaddress) -+ url_allowed, macaddress, useuefi) - - def _test_ssh_connection(self, guestaddr): - """ -diff --git a/oz/RedHat.py b/oz/RedHat.py -index fa0084a..7cb7bb6 100644 ---- a/oz/RedHat.py -+++ b/oz/RedHat.py -@@ -40,10 +40,10 @@ class RedHatLinuxCDGuest(oz.Linux.LinuxCDGuest): - Class for RedHat-based CD guests. - """ - def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, -- iso_allowed, url_allowed, initrdtype, macaddress): -+ iso_allowed, url_allowed, initrdtype, macaddress, useuefi): - oz.Linux.LinuxCDGuest.__init__(self, tdl, config, auto, output_disk, - nicmodel, diskbus, iso_allowed, -- url_allowed, macaddress) -+ url_allowed, macaddress, useuefi) - self.crond_was_active = False - self.sshd_was_active = False - self.sshd_config = """\ -@@ -714,11 +714,11 @@ class RedHatLinuxCDYumGuest(RedHatLinuxCDGuest): - Class for RedHat-based CD guests with yum support. - """ - def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, -- iso_allowed, url_allowed, initrdtype, macaddress, use_yum): -+ iso_allowed, url_allowed, initrdtype, macaddress, use_yum, useuefi): - oz.RedHat.RedHatLinuxCDGuest.__init__(self, tdl, config, auto, - output_disk, nicmodel, diskbus, - iso_allowed, url_allowed, -- initrdtype, macaddress) -+ initrdtype, macaddress, useuefi) - - self.use_yum = use_yum - -@@ -837,9 +837,9 @@ class RedHatFDGuest(oz.Guest.FDGuest): - Class for RedHat-based floppy guests. - """ - def __init__(self, tdl, config, auto, output_disk, nicmodel, diskbus, -- macaddress): -+ macaddress, useuefi): - oz.Guest.FDGuest.__init__(self, tdl, config, auto, output_disk, -- nicmodel, None, None, diskbus, macaddress) -+ nicmodel, None, None, diskbus, macaddress, useuefi) - - if self.tdl.arch != "i386": - raise oz.OzException.OzException("Invalid arch " + self.tdl.arch + "for " + self.tdl.distro + " guest") --- -2.20.1 - -From 4f5df1e7b1081c550f846e53197277a41dd9dc88 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Thu, 14 Mar 2019 13:05:13 +0000 -Subject: [PATCH 12/13] Add Fedora 29 support - -Signed-off-by: Peter Robinson ---- - oz/Fedora.py | 5 +++++ - oz/auto/Fedora29.auto | 23 +++++++++++++++++++++++ - 2 files changed, 28 insertions(+) - create mode 100644 oz/auto/Fedora29.auto - -diff --git a/oz/Fedora.py b/oz/Fedora.py -index 9ecc744..118fd84 100644 ---- a/oz/Fedora.py -+++ b/oz/Fedora.py -@@ -117,6 +117,11 @@ class FedoraConfiguration(object): - - - version_to_config = { -+ '29': FedoraConfiguration(has_virtio_channel=True, use_yum=False, -+ use_dev_cdrom_device=True, createpart=False, -+ directkernel="cpio", default_netdev='virtio', -+ default_diskbus='virtio', brokenisomethod=False, -+ haverepo=True), - '28': FedoraConfiguration(has_virtio_channel=True, use_yum=False, - use_dev_cdrom_device=True, createpart=False, - directkernel="cpio", default_netdev='virtio', -diff --git a/oz/auto/Fedora29.auto b/oz/auto/Fedora29.auto -new file mode 100644 -index 0000000..1dae86a ---- /dev/null -+++ b/oz/auto/Fedora29.auto -@@ -0,0 +1,23 @@ -+install -+text -+keyboard us -+lang en_US.UTF-8 -+skipx -+network --device ens3 --bootproto dhcp -+rootpw %ROOTPW% -+firewall --disabled -+authconfig --enableshadow --enablemd5 -+selinux --enforcing -+timezone --utc America/New_York -+bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" -+ -+zerombr -+clearpart --all --initlabel -+autopart --type=lvm -+ -+reboot -+ -+%packages -+@core -+ -+%end --- -2.20.1 - -From 5369c963106f2c8d53d36787b51e4d19f8057902 Mon Sep 17 00:00:00 2001 -From: Peter Robinson -Date: Thu, 14 Mar 2019 13:07:37 +0000 -Subject: [PATCH 13/13] Add Fedora 30 support - -In this release, if specified, we default to UEFI support. - -Signed-off-by: Peter Robinson ---- - oz/Fedora.py | 5 +++++ - oz/auto/Fedora30.auto | 23 +++++++++++++++++++++++ - 2 files changed, 28 insertions(+) - create mode 100644 oz/auto/Fedora30.auto - -diff --git a/oz/Fedora.py b/oz/Fedora.py -index 118fd84..34c4fe7 100644 ---- a/oz/Fedora.py -+++ b/oz/Fedora.py -@@ -117,6 +117,11 @@ class FedoraConfiguration(object): - - - version_to_config = { -+ '30': FedoraConfiguration(has_virtio_channel=True, use_yum=False, -+ use_dev_cdrom_device=True, createpart=False, -+ directkernel="cpio", default_netdev='virtio', -+ default_diskbus='virtio', brokenisomethod=False, -+ haverepo=True, useuefi=True), - '29': FedoraConfiguration(has_virtio_channel=True, use_yum=False, - use_dev_cdrom_device=True, createpart=False, - directkernel="cpio", default_netdev='virtio', -diff --git a/oz/auto/Fedora30.auto b/oz/auto/Fedora30.auto -new file mode 100644 -index 0000000..1dae86a ---- /dev/null -+++ b/oz/auto/Fedora30.auto -@@ -0,0 +1,23 @@ -+install -+text -+keyboard us -+lang en_US.UTF-8 -+skipx -+network --device ens3 --bootproto dhcp -+rootpw %ROOTPW% -+firewall --disabled -+authconfig --enableshadow --enablemd5 -+selinux --enforcing -+timezone --utc America/New_York -+bootloader --location=mbr --append="console=tty0 console=ttyS0,115200" -+ -+zerombr -+clearpart --all --initlabel -+autopart --type=lvm -+ -+reboot -+ -+%packages -+@core -+ -+%end --- -2.20.1 - diff --git a/oz.spec b/oz.spec index e2728a8..91a7aab 100644 --- a/oz.spec +++ b/oz.spec @@ -1,21 +1,31 @@ Name: oz Version: 0.17.0 -Release: 0.2%{?dist} +Release: 0.3%{?dist} Summary: Library and utilities for automated guest OS installs License: LGPLv2 URL: http://github.com/clalancette/oz -# Source0: https://github.com/clalancette/%{name}/files/1209916/%{name}-%{version}.tar.gz -# Upstream git snapshot while waiting for 0.17 -Source0: %{name}-%{version}-ecadc58.tar.gz +Source0: https://github.com/clalancette/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz # https://github.com/clalancette/oz/pull/269 -Patch1: fixes-and-enhancements.patch +Patch1: 01-clarify-bz-instance.patch +Patch2: 02-drop-armv7-special-console-handling.patch +Patch3: 03-add-appropriate-arch-checks.patch +Patch4: 04-armv7-define-gicv2.patch +Patch5: 05-arm-fix-input-devices.patch +Patch6: 06-setup-graphical-all-except-s390x.patch +Patch7: 07-use-2gb-ram.patch +Patch8: 08-add-latest-location-ovmf.patch +Patch9: 09-add-tianocore-check.patch +Patch10: 10-check-edk2-firmware-armv7.patch +Patch11: 11-make-uefi-configurable.patch +Patch12: 12-fix-f29-config.patch +Patch13: 13-add-f30-support.patch BuildArch: noarch -Requires: python2 >= 2.5 -Requires: python2-libguestfs >= 1.18 -Requires: python2-lxml -Requires: python2-libvirt >= 0.9.7 +Requires: python3 +Requires: python3-libguestfs >= 1.18 +Requires: python3-lxml +Requires: python3-libvirt # in theory, oz doesn't really require libvirtd to be local to operate # properly. However, because of the libguestfs manipulations, in practice # it really does. Make it depend on libvirt (so we get libvirtd) for now, @@ -23,16 +33,16 @@ Requires: python2-libvirt >= 0.9.7 Requires: libvirt-daemon-kvm Requires: libvirt-daemon-qemu Requires: libvirt-daemon-config-network -Requires: python2-requests +Requires: python3-requests Requires: genisoimage Requires: mtools Requires: openssh-clients -Requires: m2crypto -Requires: python2-monotonic +Requires: python3-m2crypto +Requires: python3-monotonic -BuildRequires: python2 -BuildRequires: python2-devel -BuildRequires: python2-setuptools +BuildRequires: python3 +BuildRequires: python3-devel +BuildRequires: python3-setuptools %description Oz is a set of libraries and utilities for doing automated guest OS @@ -42,10 +52,10 @@ installations, with minimal input from the user. %autosetup -p1 %build -python2 setup.py build +%py3_build %install -python2 setup.py install --root=$RPM_BUILD_ROOT --skip-build +%py3_install mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/oz/ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/lib/oz/isocontent/ @@ -79,15 +89,18 @@ fi %dir %attr(0755, root, root) %{_localstatedir}/lib/oz/jeos/ %dir %attr(0755, root, root) %{_localstatedir}/lib/oz/kernels/ %dir %attr(0755, root, root) %{_localstatedir}/lib/oz/screenshots/ -%{python2_sitelib}/oz +%{python3_sitelib}/oz %{_bindir}/oz-install %{_bindir}/oz-generate-icicle %{_bindir}/oz-customize %{_bindir}/oz-cleanup-cache -%{python2_sitelib}/oz-*.egg-info +%{python3_sitelib}/%{name}-%{version}-py%{python3_version}.egg-info %{_mandir}/man1/* %changelog +* Sat Mar 16 2019 Chris Lalancette - 0.17.0-0.3 +- Update to latest upstream changes for Python 3 + * Wed Mar 13 2019 Peter Robinson 0.17.0-0.2 - Rebase to latest PR for ARMv7/aarch64 UEFI diff --git a/sources b/sources index ccf5bec..12804c8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (oz-0.17.0-ecadc58.tar.gz) = 8d9210c68f23ed78817df05da5796fd96ee8064e4c6900db57b1686b604d53921ae0491bf93b850404eb2c0f83ec5274c938881d056c6d0c9cce317011e6f159 +SHA512 (oz-0.17.0.tar.gz) = cb7d43bef0e6ae6f962988afbda96532c16983ace2bb0d36082495664c61637f467faa3d8ecbef0938786b8150b5910063c05b5d844ff98729c251550a850409