anaconda: check for virtualization features
Warn if the hardware lack features required for proper Qubes OS operation. Fixes QubesOS/qubes-issues#2977
This commit is contained in:
parent
2d3405de9a
commit
696bd4ccf3
@ -150,6 +150,9 @@ Requires: anaconda-tui = %{epoch}:%{version}-%{release}
|
|||||||
# Make sure we get the en locale one way or another
|
# Make sure we get the en locale one way or another
|
||||||
Requires: glibc-langpack-en
|
Requires: glibc-langpack-en
|
||||||
|
|
||||||
|
# check for supported hardware on Qubes OS require xl binary
|
||||||
|
Requires: xen-runtime
|
||||||
|
|
||||||
Obsoletes: anaconda-images <= 10
|
Obsoletes: anaconda-images <= 10
|
||||||
Provides: anaconda-images = %{version}-%{release}
|
Provides: anaconda-images = %{version}-%{release}
|
||||||
Obsoletes: anaconda-runtime < %{version}-%{release}
|
Obsoletes: anaconda-runtime < %{version}-%{release}
|
||||||
|
@ -1098,6 +1098,23 @@ def is_unsupported_hw():
|
|||||||
tainted = 0
|
tainted = 0
|
||||||
|
|
||||||
status = bool(tainted & UNSUPPORTED_HW)
|
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:
|
if status:
|
||||||
log.debug("Installing on Unsupported Hardware")
|
log.debug("Installing on Unsupported Hardware")
|
||||||
return status
|
return status
|
||||||
|
@ -507,7 +507,7 @@
|
|||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">False</property>
|
<property name="can_focus">False</property>
|
||||||
<property name="valign">start</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>
|
<property name="wrap">True</property>
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="font-desc" value="Cantarell 12"/>
|
<attribute name="font-desc" value="Cantarell 12"/>
|
||||||
|
@ -295,9 +295,13 @@ class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke):
|
|||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
if productName.startswith("Red Hat ") and \
|
unsupported_status = is_unsupported_hw()
|
||||||
is_unsupported_hw() and not self.data.unsupportedhardware.unsupported_hardware:
|
if unsupported_status:
|
||||||
|
# Fedora kickstart do not have unsupported_hardware option:
|
||||||
|
# and not self.data.unsupportedhardware.unsupported_hardware:
|
||||||
dlg = self.builder.get_object("unsupportedHardwareDialog")
|
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):
|
with self.main_window.enlightbox(dlg):
|
||||||
rc = dlg.run()
|
rc = dlg.run()
|
||||||
dlg.destroy()
|
dlg.destroy()
|
||||||
|
@ -43,15 +43,15 @@ class WarningsSpoke(StandaloneTUISpoke):
|
|||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
StandaloneTUISpoke.__init__(self, *args, **kwargs)
|
StandaloneTUISpoke.__init__(self, *args, **kwargs)
|
||||||
|
|
||||||
self._message = _("This hardware (or a combination thereof) is not "
|
self._message = _("This hardware lack features required by Qubes OS. "
|
||||||
"supported by Red Hat. For more information on "
|
"Missing features: %(features)s. "
|
||||||
"supported hardware, please refer to "
|
"For more information on supported hardware, "
|
||||||
"http://www.redhat.com/hardware.")
|
"please refer to https://www.qubes-os.org/system-requirements/")
|
||||||
# Does anything need to be displayed?
|
# Does anything need to be displayed?
|
||||||
# pylint: disable=no-member
|
# pylint: disable=no-member
|
||||||
self._unsupported = productName.startswith("Red Hat ") and \
|
# self._unsupported = not self.data.unsupportedhardware.unsupported_hardware \
|
||||||
is_unsupported_hw() and \
|
# and is_unsupported_hw()
|
||||||
not self.data.unsupportedhardware.unsupported_hardware
|
self._unsupported = is_unsupported_hw()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def completed(self):
|
def completed(self):
|
||||||
@ -60,7 +60,7 @@ class WarningsSpoke(StandaloneTUISpoke):
|
|||||||
def refresh(self, args=None):
|
def refresh(self, args=None):
|
||||||
StandaloneTUISpoke.refresh(self, args)
|
StandaloneTUISpoke.refresh(self, args)
|
||||||
|
|
||||||
self._window += [TextWidget(self._message), ""]
|
self._window += [TextWidget(self._message % {'features': self._unsupported}), ""]
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user