diff --git a/anaconda/anaconda.spec b/anaconda/anaconda.spec index 5bb6e1c..6a48a19 100644 --- a/anaconda/anaconda.spec +++ b/anaconda/anaconda.spec @@ -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} diff --git a/anaconda/pyanaconda/iutil.py b/anaconda/pyanaconda/iutil.py index d966ca6..20ed543 100644 --- a/anaconda/pyanaconda/iutil.py +++ b/anaconda/pyanaconda/iutil.py @@ -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 diff --git a/anaconda/pyanaconda/ui/gui/spokes/welcome.glade b/anaconda/pyanaconda/ui/gui/spokes/welcome.glade index 2373a75..87e5bf0 100644 --- a/anaconda/pyanaconda/ui/gui/spokes/welcome.glade +++ b/anaconda/pyanaconda/ui/gui/spokes/welcome.glade @@ -507,7 +507,7 @@ True False start - 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. + 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/ True diff --git a/anaconda/pyanaconda/ui/gui/spokes/welcome.py b/anaconda/pyanaconda/ui/gui/spokes/welcome.py index c77e362..802a217 100644 --- a/anaconda/pyanaconda/ui/gui/spokes/welcome.py +++ b/anaconda/pyanaconda/ui/gui/spokes/welcome.py @@ -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() diff --git a/anaconda/pyanaconda/ui/tui/spokes/warnings_spoke.py b/anaconda/pyanaconda/ui/tui/spokes/warnings_spoke.py index 6334c65..8aed096 100644 --- a/anaconda/pyanaconda/ui/tui/spokes/warnings_spoke.py +++ b/anaconda/pyanaconda/ui/tui/spokes/warnings_spoke.py @@ -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