Enable arm32+uefi (bz #1613996)
This commit is contained in:
		
							parent
							
								
									121fcaf2e1
								
							
						
					
					
						commit
						6fd8521329
					
				| @ -0,0 +1,34 @@ | ||||
| From: Cole Robinson <crobinso@redhat.com> | ||||
| Date: Wed, 8 Aug 2018 11:55:29 -0400 | ||||
| Subject: [PATCH virt-manager] domcapabilities: Whitelist fedora arm and ia32 | ||||
|  edk2 paths | ||||
| 
 | ||||
| (cherry picked from commit b623ece2ba6736cd5b8ea2401ae9dd8504df391e) | ||||
| ---
 | ||||
|  virtinst/domcapabilities.py | 6 ++++++ | ||||
|  1 file changed, 6 insertions(+) | ||||
| 
 | ||||
| diff --git a/virtinst/domcapabilities.py b/virtinst/domcapabilities.py
 | ||||
| index 5ea94948..ba061c96 100644
 | ||||
| --- a/virtinst/domcapabilities.py
 | ||||
| +++ b/virtinst/domcapabilities.py
 | ||||
| @@ -149,6 +149,9 @@ class DomainCapabilities(XMLBuilder):
 | ||||
|      # only use this info to do things automagically for the user, it shouldn't | ||||
|      # validate anything the user explicitly enters. | ||||
|      _uefi_arch_patterns = { | ||||
| +        "i686": [
 | ||||
| +            ".*ovmf-ia32.*",  # fedora, gerd's firmware repo
 | ||||
| +        ],
 | ||||
|          "x86_64": [ | ||||
|              ".*OVMF_CODE\.fd",  # RHEL | ||||
|              ".*ovmf-x64/OVMF.*\.fd",  # gerd's firmware repo | ||||
| @@ -160,6 +163,9 @@ class DomainCapabilities(XMLBuilder):
 | ||||
|              ".*aarch64/QEMU_EFI.*",  # gerd's firmware repo | ||||
|              ".*aarch64.*",  # generic attempt at a catchall | ||||
|          ], | ||||
| +        "armv7l": [
 | ||||
| +            ".*arm/QEMU_EFI.*",  # fedora, gerd's firmware repo
 | ||||
| +        ],
 | ||||
|      } | ||||
|   | ||||
|      def find_uefi_path_for_arch(self): | ||||
							
								
								
									
										198
									
								
								0002-virt-install-Support-armv7l-and-i686-uefi.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										198
									
								
								0002-virt-install-Support-armv7l-and-i686-uefi.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,198 @@ | ||||
| From: Cole Robinson <crobinso@redhat.com> | ||||
| Date: Wed, 8 Aug 2018 15:11:19 -0400 | ||||
| Subject: [PATCH virt-manager] virt-install: Support armv7l and i686 uefi | ||||
| 
 | ||||
| (cherry picked from commit eb0f4a612fe4c12f498ed8a80e5665d368b5f76c) | ||||
| ---
 | ||||
|  tests/capabilities-xml/kvm-x86_64-domcaps.xml |   2 + | ||||
|  .../compare/virt-install-arm-kvm-import.xml   |   1 + | ||||
|  .../compare/virt-install-kvm-i686-uefi.xml    | 115 ++++++++++++++++++ | ||||
|  tests/clitest.py                              |   1 + | ||||
|  virt-install                                  |   6 +- | ||||
|  5 files changed, 122 insertions(+), 3 deletions(-) | ||||
|  create mode 100644 tests/cli-test-xml/compare/virt-install-kvm-i686-uefi.xml | ||||
| 
 | ||||
| diff --git a/tests/capabilities-xml/kvm-x86_64-domcaps.xml b/tests/capabilities-xml/kvm-x86_64-domcaps.xml
 | ||||
| index d2a3d11f..451f5844 100644
 | ||||
| --- a/tests/capabilities-xml/kvm-x86_64-domcaps.xml
 | ||||
| +++ b/tests/capabilities-xml/kvm-x86_64-domcaps.xml
 | ||||
| @@ -8,6 +8,8 @@
 | ||||
|      <loader supported='yes'> | ||||
|        <value>/usr/share/AAVMF/AAVMF_CODE.fd</value> | ||||
|        <value>/usr/share/OVMF/OVMF_CODE.fd</value> | ||||
| +      <value>/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</value>
 | ||||
| +      <value>/usr/share/edk2/arm/QEMU_EFI-pflash.raw</value>
 | ||||
|        <enum name='type'> | ||||
|          <value>rom</value> | ||||
|          <value>pflash</value> | ||||
| diff --git a/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml b/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
 | ||||
| index b1a98b75..802589b3 100644
 | ||||
| --- a/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
 | ||||
| +++ b/tests/cli-test-xml/compare/virt-install-arm-kvm-import.xml
 | ||||
| @@ -6,6 +6,7 @@
 | ||||
|    <vcpu>1</vcpu> | ||||
|    <os> | ||||
|      <type arch="armv7l" machine="virt">hvm</type> | ||||
| +    <loader readonly="yes" type="pflash">/usr/share/edk2/arm/QEMU_EFI-pflash.raw</loader>
 | ||||
|      <boot dev="hd"/> | ||||
|    </os> | ||||
|    <cpu mode="host-passthrough"/> | ||||
| diff --git a/tests/cli-test-xml/compare/virt-install-kvm-i686-uefi.xml b/tests/cli-test-xml/compare/virt-install-kvm-i686-uefi.xml
 | ||||
| new file mode 100644 | ||||
| index 00000000..9aabfef2
 | ||||
| --- /dev/null
 | ||||
| +++ b/tests/cli-test-xml/compare/virt-install-kvm-i686-uefi.xml
 | ||||
| @@ -0,0 +1,115 @@
 | ||||
| +<domain type="kvm">
 | ||||
| +  <name>foobar</name>
 | ||||
| +  <uuid>00000000-1111-2222-3333-444444444444</uuid>
 | ||||
| +  <memory>65536</memory>
 | ||||
| +  <currentMemory>65536</currentMemory>
 | ||||
| +  <vcpu>1</vcpu>
 | ||||
| +  <os>
 | ||||
| +    <type arch="i686">hvm</type>
 | ||||
| +    <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</loader>
 | ||||
| +    <boot dev="network"/>
 | ||||
| +  </os>
 | ||||
| +  <features>
 | ||||
| +    <acpi/>
 | ||||
| +    <apic/>
 | ||||
| +    <pae/>
 | ||||
| +    <vmport state="off"/>
 | ||||
| +  </features>
 | ||||
| +  <clock offset="utc">
 | ||||
| +    <timer name="rtc" tickpolicy="catchup"/>
 | ||||
| +    <timer name="pit" tickpolicy="delay"/>
 | ||||
| +    <timer name="hpet" present="no"/>
 | ||||
| +  </clock>
 | ||||
| +  <on_reboot>destroy</on_reboot>
 | ||||
| +  <pm>
 | ||||
| +    <suspend-to-mem enabled="no"/>
 | ||||
| +    <suspend-to-disk enabled="no"/>
 | ||||
| +  </pm>
 | ||||
| +  <devices>
 | ||||
| +    <emulator>/usr/bin/qemu-kvm</emulator>
 | ||||
| +    <controller type="usb" index="0" model="ich9-ehci1"/>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci1">
 | ||||
| +      <master startport="0"/>
 | ||||
| +    </controller>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci2">
 | ||||
| +      <master startport="2"/>
 | ||||
| +    </controller>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci3">
 | ||||
| +      <master startport="4"/>
 | ||||
| +    </controller>
 | ||||
| +    <interface type="bridge">
 | ||||
| +      <source bridge="eth0"/>
 | ||||
| +      <mac address="00:11:22:33:44:55"/>
 | ||||
| +    </interface>
 | ||||
| +    <console type="pty"/>
 | ||||
| +    <channel type="spicevmc">
 | ||||
| +      <target type="virtio" name="com.redhat.spice.0"/>
 | ||||
| +    </channel>
 | ||||
| +    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
 | ||||
| +      <image compression="off"/>
 | ||||
| +    </graphics>
 | ||||
| +    <sound model="ich6"/>
 | ||||
| +    <video>
 | ||||
| +      <model type="qxl"/>
 | ||||
| +    </video>
 | ||||
| +    <redirdev bus="usb" type="spicevmc"/>
 | ||||
| +    <redirdev bus="usb" type="spicevmc"/>
 | ||||
| +  </devices>
 | ||||
| +</domain>
 | ||||
| +<domain type="kvm">
 | ||||
| +  <name>foobar</name>
 | ||||
| +  <uuid>00000000-1111-2222-3333-444444444444</uuid>
 | ||||
| +  <memory>65536</memory>
 | ||||
| +  <currentMemory>65536</currentMemory>
 | ||||
| +  <vcpu>1</vcpu>
 | ||||
| +  <os>
 | ||||
| +    <type arch="i686">hvm</type>
 | ||||
| +    <loader readonly="yes" type="pflash">/usr/share/edk2/ovmf-ia32/OVMF_CODE.fd</loader>
 | ||||
| +    <boot dev="network"/>
 | ||||
| +  </os>
 | ||||
| +  <features>
 | ||||
| +    <acpi/>
 | ||||
| +    <apic/>
 | ||||
| +    <pae/>
 | ||||
| +    <vmport state="off"/>
 | ||||
| +  </features>
 | ||||
| +  <clock offset="utc">
 | ||||
| +    <timer name="rtc" tickpolicy="catchup"/>
 | ||||
| +    <timer name="pit" tickpolicy="delay"/>
 | ||||
| +    <timer name="hpet" present="no"/>
 | ||||
| +  </clock>
 | ||||
| +  <pm>
 | ||||
| +    <suspend-to-mem enabled="no"/>
 | ||||
| +    <suspend-to-disk enabled="no"/>
 | ||||
| +  </pm>
 | ||||
| +  <devices>
 | ||||
| +    <emulator>/usr/bin/qemu-kvm</emulator>
 | ||||
| +    <controller type="usb" index="0" model="ich9-ehci1"/>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci1">
 | ||||
| +      <master startport="0"/>
 | ||||
| +    </controller>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci2">
 | ||||
| +      <master startport="2"/>
 | ||||
| +    </controller>
 | ||||
| +    <controller type="usb" index="0" model="ich9-uhci3">
 | ||||
| +      <master startport="4"/>
 | ||||
| +    </controller>
 | ||||
| +    <interface type="bridge">
 | ||||
| +      <source bridge="eth0"/>
 | ||||
| +      <mac address="00:11:22:33:44:55"/>
 | ||||
| +    </interface>
 | ||||
| +    <console type="pty"/>
 | ||||
| +    <channel type="spicevmc">
 | ||||
| +      <target type="virtio" name="com.redhat.spice.0"/>
 | ||||
| +    </channel>
 | ||||
| +    <graphics type="spice" port="-1" tlsPort="-1" autoport="yes">
 | ||||
| +      <image compression="off"/>
 | ||||
| +    </graphics>
 | ||||
| +    <sound model="ich6"/>
 | ||||
| +    <video>
 | ||||
| +      <model type="qxl"/>
 | ||||
| +    </video>
 | ||||
| +    <redirdev bus="usb" type="spicevmc"/>
 | ||||
| +    <redirdev bus="usb" type="spicevmc"/>
 | ||||
| +  </devices>
 | ||||
| +</domain>
 | ||||
| diff --git a/tests/clitest.py b/tests/clitest.py
 | ||||
| index a62a9105..c3e1b807 100644
 | ||||
| --- a/tests/clitest.py
 | ||||
| +++ b/tests/clitest.py
 | ||||
| @@ -772,6 +772,7 @@ c.add_compare("--disk %(EXISTIMG1)s --pxe --os-variant rhel6.4", "kvm-rhel6")  #
 | ||||
|  c.add_compare("--disk %(EXISTIMG1)s --pxe --os-variant rhel7.0", "kvm-rhel7")  # RHEL7 defaults | ||||
|  c.add_compare("--disk %(EXISTIMG1)s --pxe --os-variant centos7.0", "kvm-centos7")  # Centos 7 defaults | ||||
|  c.add_compare("--os-variant win7 --cdrom %(EXISTIMG2)s --boot loader_type=pflash,loader=CODE.fd,nvram_template=VARS.fd --disk %(EXISTIMG1)s", "win7-uefi")  # no HYPER-V with UEFI | ||||
| +c.add_compare("--arch i686 --boot uefi --pxe --disk none", "kvm-i686-uefi")  # i686 uefi
 | ||||
|  c.add_compare("--machine q35 --cdrom %(EXISTIMG2)s --disk %(EXISTIMG1)s", "q35-defaults")  # proper q35 disk defaults | ||||
|  c.add_compare("--disk size=20 --os-variant solaris10", "solaris10-defaults")  # test solaris OS defaults | ||||
|  c.add_compare("--connect %(URI-KVM-REMOTE)s --import --disk %(EXISTIMG1)s --os-variant fedora21 --pm suspend_to_disk=yes", "f21-kvm-remote") | ||||
| diff --git a/virt-install b/virt-install
 | ||||
| index c0a028c9..4b39b350 100755
 | ||||
| --- a/virt-install
 | ||||
| +++ b/virt-install
 | ||||
| @@ -609,7 +609,7 @@ def build_guest_instance(conn, options):
 | ||||
|      guest.add_default_devices() | ||||
|   | ||||
|      # Default to UEFI for aarch64 | ||||
| -    if (guest.os.is_arm64() and
 | ||||
| +    if ((guest.os.is_arm64() or guest.os.is_arm32()) and
 | ||||
|          not guest.os.kernel and | ||||
|          not guest.os.loader and | ||||
|          guest.os.loader_ro is None and | ||||
| @@ -617,10 +617,10 @@ def build_guest_instance(conn, options):
 | ||||
|          try: | ||||
|              guest.set_uefi_default() | ||||
|          except Exception as e: | ||||
| -            logging.debug("Error setting UEFI default for aarch64",
 | ||||
| +            logging.debug("Error setting UEFI default",
 | ||||
|                  exc_info=True) | ||||
|              logging.warning("Couldn't configure UEFI: %s", e) | ||||
| -            logging.warning("Your aarch64 VM may not boot successfully.")
 | ||||
| +            logging.warning("Your VM may not boot successfully.")
 | ||||
|   | ||||
|      # Check usability of SMM feature | ||||
|      if guest.features.smm: | ||||
							
								
								
									
										51
									
								
								0003-create-Support-UEFI-installs-for-armv7l.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								0003-create-Support-UEFI-installs-for-armv7l.patch
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,51 @@ | ||||
| From: Cole Robinson <crobinso@redhat.com> | ||||
| Date: Wed, 8 Aug 2018 14:27:27 -0400 | ||||
| Subject: [PATCH virt-manager] create: Support UEFI installs for armv7l | ||||
| 
 | ||||
| Will be supported with Fedora 29 | ||||
| 
 | ||||
| https://fedoraproject.org/wiki/Changes/uEFIforARMv7 | ||||
| 
 | ||||
| We should probably limit this by selected OS, but that's tricky | ||||
| with the wizard as it is, so lets see if anyone cares | ||||
| 
 | ||||
| (cherry picked from commit cab540792f4fc5ad0270d68d41b54a8fbeea5a7b) | ||||
| ---
 | ||||
|  virtManager/create.py | 10 +++++----- | ||||
|  1 file changed, 5 insertions(+), 5 deletions(-) | ||||
| 
 | ||||
| diff --git a/virtManager/create.py b/virtManager/create.py
 | ||||
| index 5afe0afe..f0f41ffb 100644
 | ||||
| --- a/virtManager/create.py
 | ||||
| +++ b/virtManager/create.py
 | ||||
| @@ -472,17 +472,17 @@ class vmmCreate(vmmGObjectUI):
 | ||||
|          installable_arch = (self._capsinfo.arch in | ||||
|              ["i686", "x86_64", "ppc64", "ppc64le", "s390x"]) | ||||
|   | ||||
| -        if self._capsinfo.arch == "aarch64":
 | ||||
| +        if self._capsinfo.arch in ["aarch64", "armv7l"]:
 | ||||
|              try: | ||||
|                  guest = self.conn.caps.build_virtinst_guest(self._capsinfo) | ||||
|                  guest.set_uefi_default() | ||||
|                  installable_arch = True | ||||
| -                logging.debug("UEFI found for aarch64, setting it as default.")
 | ||||
| +                logging.debug("UEFI found, setting it as default.")
 | ||||
|              except Exception as e: | ||||
|                  installable_arch = False | ||||
| -                logging.debug("Error checking for aarch64 UEFI default",
 | ||||
| +                logging.debug("Error checking for UEFI default",
 | ||||
|                      exc_info=True) | ||||
| -                msg = _("Failed to setup UEFI for AArch64: %s\n"
 | ||||
| +                msg = _("Failed to setup UEFI: %s\n"
 | ||||
|                          "Install options are limited.") % e | ||||
|                  self._show_arch_warning(msg) | ||||
|   | ||||
| @@ -1864,7 +1864,7 @@ class vmmCreate(vmmGObjectUI):
 | ||||
|              self.err.val_err(_("Error setting OS information."), str(e)) | ||||
|              return None | ||||
|   | ||||
| -        if guest.os.is_arm64():
 | ||||
| +        if guest.os.is_arm64() or guest.os.is_arm():
 | ||||
|              try: | ||||
|                  guest.set_uefi_default() | ||||
|              except Exception: | ||||
| @ -24,7 +24,7 @@ | ||||
| 
 | ||||
| Name: virt-manager | ||||
| Version: 1.6.0 | ||||
| Release: 0.3.git3bc7ff24c%{?dist} | ||||
| Release: 1.3.git3bc7ff24c%{?dist} | ||||
| %global verrel %{version}-%{release} | ||||
| 
 | ||||
| Summary: Desktop tool for managing virtual machines via libvirt | ||||
| @ -40,6 +40,11 @@ URL: http://virt-manager.org/ | ||||
| # ./setup.py sdist | ||||
| Source0: virt-manager-1.6.0.tar.gz | ||||
| 
 | ||||
| # Enable arm32+uefi (bz #1613996) | ||||
| Patch0001: 0001-domcapabilities-Whitelist-fedora-arm-and-ia32-edk2-p.patch | ||||
| Patch0002: 0002-virt-install-Support-armv7l-and-i686-uefi.patch | ||||
| Patch0003: 0003-create-Support-UEFI-installs-for-armv7l.patch | ||||
| 
 | ||||
| 
 | ||||
| Requires: virt-manager-common = %{verrel} | ||||
| Requires: python3-gobject | ||||
| @ -114,6 +119,11 @@ machine). | ||||
| %prep | ||||
| %setup -q | ||||
| 
 | ||||
| # Enable arm32+uefi (bz #1613996) | ||||
| %patch0001 -p1 | ||||
| %patch0002 -p1 | ||||
| %patch0003 -p1 | ||||
| 
 | ||||
| 
 | ||||
| %build | ||||
| %if %{qemu_user} | ||||
| @ -212,6 +222,9 @@ done | ||||
| 
 | ||||
| 
 | ||||
| %changelog | ||||
| * Fri Sep 07 2018 Cole Robinson <crobinso@redhat.com> - 1.6.0-1.3.3.git3bc7ff24c | ||||
| - Enable arm32+uefi (bz #1613996) | ||||
| 
 | ||||
| * Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.0-0.3.git3bc7ff24c | ||||
| - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user