From 331ccebe9fe8cbae97fe0b96ba845337778d84e1 Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Tue, 19 Nov 2019 14:45:25 -0600 Subject: Qt UI: Add UI.Firmware page --- ui/qt5/CMakeLists.txt | 5 ++++ ui/qt5/firmwarepage.cc | 54 ++++++++++++++++++++++++++++++++++++++ ui/qt5/firmwarepage.hh | 30 +++++++++++++++++++++ ui/qt5/horizon.qrc | 1 + ui/qt5/horizonwizard.cc | 6 +++++ ui/qt5/resources/firmware-help.txt | 49 ++++++++++++++++++++++++++++++++++ 6 files changed, 145 insertions(+) create mode 100644 ui/qt5/firmwarepage.cc create mode 100644 ui/qt5/firmwarepage.hh create mode 100644 ui/qt5/resources/firmware-help.txt diff --git a/ui/qt5/CMakeLists.txt b/ui/qt5/CMakeLists.txt index 6279cc1..d33e74a 100644 --- a/ui/qt5/CMakeLists.txt +++ b/ui/qt5/CMakeLists.txt @@ -17,6 +17,11 @@ set(UI_SOURCES hostnamepage.cc horizon.qrc) + +IF(UNSUPPORTED_NONFREE_FIRMWARE) + LIST(APPEND UI_SOURCES firmwarepage.cc) +ENDIF(UNSUPPORTED_NONFREE_FIRMWARE) + add_executable(horizon-qt5 ${UI_SOURCES}) target_link_libraries(horizon-qt5 Qt5::Network Qt5::Widgets) diff --git a/ui/qt5/firmwarepage.cc b/ui/qt5/firmwarepage.cc new file mode 100644 index 0000000..235d9af --- /dev/null +++ b/ui/qt5/firmwarepage.cc @@ -0,0 +1,54 @@ +/* + * firmwarepage.cc - Implementation of the UI.Firmware page + * horizon-qt5, the Qt 5 user interface for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "firmwarepage.hh" + +#include +#include +#include + +FirmwarePage::FirmwarePage(QWidget *parent) : HorizonWizardPage(parent) { + setTitle(tr("Load Firmware")); + loadWatermark("intro"); + + QLabel *descLabel = new QLabel(tr( + "

Your computer may require the use of drivers which use proprietary, closed-source components (or firmware) in order to use certain hardware or functionality.

" + "

Most Wi-Fi network adaptors and 3D graphics cards require proprietary firmware.

" + "

Proprietary firmware cannot be audited for security or reliability issues due to its closed-source nature. Only install proprietary firmware if you require it.

" + "

If you intend to use this computer to perform security-sensitive tasks, we strongly recommend that you choose not to load firmware on this computer.

" + "

Do you want to load firmware on this computer?

")); + descLabel->setTextFormat(Qt::RichText); + descLabel->setWordWrap(true); + + noButton = new QRadioButton(tr("&No, do not load firmware on this computer.")); + noButton->setChecked(true); + yesButton = new QRadioButton(tr("&Yes, load firmware on this computer.")); + firmwareChoice = new QButtonGroup; + firmwareChoice->addButton(noButton); + firmwareChoice->addButton(yesButton); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(descLabel); + layout->addStretch(); + layout->addWidget(noButton); + layout->addWidget(yesButton); + layout->addStretch(); + + setField("firmware", QVariant(false)); + connect(firmwareChoice, static_cast(&QButtonGroup::buttonClicked), + [=](QAbstractButton *button) { + if(button == yesButton) setField("firmware", QVariant(true)); + else setField("firmware", QVariant(false)); + }); + + setLayout(layout); +} diff --git a/ui/qt5/firmwarepage.hh b/ui/qt5/firmwarepage.hh new file mode 100644 index 0000000..e283a25 --- /dev/null +++ b/ui/qt5/firmwarepage.hh @@ -0,0 +1,30 @@ +/* + * firmwarepage.hh - Definition of the UI.Firmware page + * horizon-qt5, the Qt 5 user interface for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#ifndef FIRMWAREPAGE_HH +#define FIRMWAREPAGE_HH + +#include "horizonwizardpage.hh" + +#include +#include + +class FirmwarePage : public HorizonWizardPage { +public: + FirmwarePage(QWidget *parent = nullptr); +private: + QButtonGroup *firmwareChoice; + QRadioButton *yesButton; + QRadioButton *noButton; +}; + +#endif /* !FIRMWAREPAGE_HH */ diff --git a/ui/qt5/horizon.qrc b/ui/qt5/horizon.qrc index 43e8475..9ef9255 100644 --- a/ui/qt5/horizon.qrc +++ b/ui/qt5/horizon.qrc @@ -17,6 +17,7 @@ resources/intro-help.txt resources/input-help.txt resources/partition-help.txt + resources/firmware-help.txt resources/network-start-help.txt resources/network-iface-help.txt resources/network-dhcp-help.txt diff --git a/ui/qt5/horizonwizard.cc b/ui/qt5/horizonwizard.cc index 7a64d2a..ba4b487 100644 --- a/ui/qt5/horizonwizard.cc +++ b/ui/qt5/horizonwizard.cc @@ -31,6 +31,9 @@ extern "C" { #include "intropage.hh" #include "inputpage.hh" +#ifdef NON_LIBRE_FIRMWARE +#include "firmwarepage.hh" +#endif /* NON_LIBRE_FIRMWARE */ #include "networkingpage.hh" #include "networkifacepage.hh" #include "netsimplewifipage.hh" @@ -173,6 +176,9 @@ HorizonWizard::HorizonWizard(QWidget *parent) : QWizard(parent) { setPage(Page_Intro, new IntroPage); setPage(Page_Input, new InputPage); +#ifdef NON_LIBRE_FIRMWARE + setPage(Page_Firmware, new FirmwarePage); +#endif /* NON_LIBRE_FIRMWARE */ setPage(Page_Network, new NetworkingPage); setPage(Page_Network_Iface, new NetworkIfacePage); setPage(Page_Network_Wireless, new NetworkSimpleWirelessPage); diff --git a/ui/qt5/resources/firmware-help.txt b/ui/qt5/resources/firmware-help.txt new file mode 100644 index 0000000..6456dc1 --- /dev/null +++ b/ui/qt5/resources/firmware-help.txt @@ -0,0 +1,49 @@ +

Firmware

+ +

This page allows you to decide whether or not to install proprietary +firmware on this computer.

+ +

What is firmware?

+ +

"Firmware" is a component of a hardware driver. This component is uploaded +to the hardware itself, which allows the hardware to perform operations or +control itself.

+ +

For example, network devices sometimes contain firmware that allows them to +perform checksum offloading.

+ +

What is proprietary firmware?

+ +

Proprietary firmware is firmware that is released by the hardware +manufacturer without source code. Usually, this proprietary firmware is +provided without warranty by the hardware manufacturer. Since it is closed +source and fully proprietary, it cannot be audited for security or reliability +issues.

+ +

This means that when you load proprietary firmware on to a computer, we +can no longer provide any assurances to its security or reliability.

+ +

Why would I want to load proprietary firmware?

+ +

Most wireless networking cards, and virtually all 3D graphics cards, utilise +proprietary firmware. You may be unable to connect to a wireless network, or +use certain radio frequencies (such as the 5 GHz band), without proprietary +firmware. You may also be unable to use the maximum resolution of your +graphics card, or utilise the 3D acceleration capabilities of it (including +OpenGL and Vulkan), without proprietary firmware.

+ +

What are the risks of using proprietary firmware?

+ +

Your system may be compromised by security issues in the firmware. Your +system may also become unstable due to improper programming of the +firmware.

+ +

Which option should I choose?

+ +

Adélie Linux allows you the freedom to choose whether or not you wish to +install proprietary firmware on your computer.

+ +

If you have an elevated threat profile, you should always choose No.

+ +

If you want to utilise hardware that requires proprietary firmware despite +the potential risk, you may choose Yes.

-- cgit v1.2.3-70-g09d2