anaconda: check for virtualization features

Warn if the hardware lack features required for proper Qubes OS
operation.

Fixes QubesOS/qubes-issues#2977
pull/15/head
Marek Marczykowski-Górecki 7 years ago
parent 2d3405de9a
commit 696bd4ccf3
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

@ -150,6 +150,9 @@ Requires: anaconda-tui = %{epoch}:%{version}-%{release}
# Make sure we get the en locale one way or another
Requires: glibc-langpack-en
# check for supported hardware on Qubes OS require xl binary
Requires: xen-runtime
Obsoletes: anaconda-images <= 10
Provides: anaconda-images = %{version}-%{release}
Obsoletes: anaconda-runtime < %{version}-%{release}

@ -1098,6 +1098,23 @@ def is_unsupported_hw():
tainted = 0
status = bool(tainted & UNSUPPORTED_HW)
try:
xl_info = subprocess.check_output(['xl', 'info'])
xl_dmesg = subprocess.check_output(['xl', 'dmesg'])
except subprocess.CalledProcessError:
status = 'xl call failed'
else:
missing_features = []
for line in xl_info.splitlines():
if line.startswith(b'virt_caps'):
if b'hvm' not in line:
missing_features.append('HVM/VT-x/AMD-V')
if b'hvm_directio' not in line:
missing_features.append('IOMMU/VT-d/AMD-Vi')
if b'HVM: Hardware Assisted Paging (HAP) detected' not in xl_dmesg:
missing_features.append('HAP/SLAT/EPT/RVI')
status = ', '.join(missing_features)
if status:
log.debug("Installing on Unsupported Hardware")
return status

@ -507,7 +507,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
<property name="label" translatable="yes">This hardware (or a combination thereof) is not supported by Red Hat. For more information on supported hardware, please refer to http://www.redhat.com/hardware.</property>
<property name="label" translatable="yes">This hardware lack features required by Qubes OS. Missing features: %(features)s. For more information on supported hardware, please refer to https://www.qubes-os.org/system-requirements/</property>
<property name="wrap">True</property>
<attributes>
<attribute name="font-desc" value="Cantarell 12"/>

@ -295,9 +295,13 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
sys.exit(0)
# pylint: disable=no-member
if productName.startswith("Red Hat ") and \
is_unsupported_hw() and not self.data.unsupportedhardware.unsupported_hardware:
unsupported_status = is_unsupported_hw()
if unsupported_status:
# Fedora kickstart do not have unsupported_hardware option:
# and not self.data.unsupportedhardware.unsupported_hardware:
dlg = self.builder.get_object("unsupportedHardwareDialog")
msg = self.builder.get_object("unsupportedHardwareDesc")
msg.set_text(_(msg.get_text()) % {'features': unsupported_status})
with self.main_window.enlightbox(dlg):
rc = dlg.run()
dlg.destroy()

@ -43,15 +43,15 @@ class WarningsSpoke(StandaloneTUISpoke):
def __init__(self, *args, **kwargs):
StandaloneTUISpoke.__init__(self, *args, **kwargs)
self._message = _("This hardware (or a combination thereof) is not "
"supported by Red Hat. For more information on "
"supported hardware, please refer to "
"http://www.redhat.com/hardware.")
self._message = _("This hardware lack features required by Qubes OS. "
"Missing features: %(features)s. "
"For more information on supported hardware, "
"please refer to https://www.qubes-os.org/system-requirements/")
# Does anything need to be displayed?
# pylint: disable=no-member
self._unsupported = productName.startswith("Red Hat ") and \
is_unsupported_hw() and \
not self.data.unsupportedhardware.unsupported_hardware
# self._unsupported = not self.data.unsupportedhardware.unsupported_hardware \
# and is_unsupported_hw()
self._unsupported = is_unsupported_hw()
@property
def completed(self):
@ -60,7 +60,7 @@ class WarningsSpoke(StandaloneTUISpoke):
def refresh(self, args=None):
StandaloneTUISpoke.refresh(self, args)
self._window += [TextWidget(self._message), ""]
self._window += [TextWidget(self._message % {'features': self._unsupported}), ""]
return True

Loading…
Cancel
Save