MSVSphere changes

i10-beta changed/i10-beta/anaconda-40.22.3.12-1.el10.inferit
Sergey Cherevko 6 days ago
parent 74aaff0673
commit a6ae8b557f
Signed by: scherevko
GPG Key ID: D87CBBC16D2E4A72

@ -0,0 +1,27 @@
From 9c5bf55836e7f308d6ec86d97eb0668c1db91892 Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <eugene@zamriy.info>
Date: Fri, 14 Apr 2023 12:53:14 +0300
Subject: [PATCH 01/15] Disable subscription
---
pyanaconda/ui/gui/spokes/subscription.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/subscription.py b/pyanaconda/ui/gui/spokes/subscription.py
index e8cf442..5c5db81 100644
--- a/pyanaconda/ui/gui/spokes/subscription.py
+++ b/pyanaconda/ui/gui/spokes/subscription.py
@@ -540,6 +540,10 @@ class SubscriptionSpoke(NormalSpoke):
# also set the spoke warning banner
self.show_warning_message(error_message)
+ @property
+ def showable(self):
+ return False
+
def initialize(self):
NormalSpoke.initialize(self)
self.initialize_start()
--
2.43.5

@ -0,0 +1,25 @@
From 1b180235392825e31536fe58381c4183228309b6 Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <eugene@zamriy.info>
Date: Fri, 14 Apr 2023 12:54:58 +0300
Subject: [PATCH 02/15] Hide CDN source button
---
pyanaconda/ui/gui/spokes/installation_source.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/installation_source.py b/pyanaconda/ui/gui/spokes/installation_source.py
index 0c98e17..6fa4475 100644
--- a/pyanaconda/ui/gui/spokes/installation_source.py
+++ b/pyanaconda/ui/gui/spokes/installation_source.py
@@ -353,6 +353,8 @@ class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler, SourceSwitchHandler):
self._network_button = self.builder.get_object("networkRadioButton")
self._network_box = self.builder.get_object("networkBox")
+ really_hide(self._cdn_button)
+
self._url_entry = self.builder.get_object("urlEntry")
self._protocol_combo_box = self.builder.get_object("protocolComboBox")
self._iso_chooser_button = self.builder.get_object("isoChooserButton")
--
2.43.5

@ -0,0 +1,37 @@
From d9fe80cb2d797a077d604d8f9a69ceaf5167e51b Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <sergey.cherevko@softline.com>
Date: Thu, 19 Dec 2024 21:13:04 +0300
Subject: [PATCH 03/15] Set MSVSphere installer colors
---
data/anaconda-gtk.css | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/data/anaconda-gtk.css b/data/anaconda-gtk.css
index f83cf15..ef557ee 100644
--- a/data/anaconda-gtk.css
+++ b/data/anaconda-gtk.css
@@ -96,9 +96,10 @@ infobar.error box {
*/
@define-color anaconda_bg_color #2f4265;
+@define-color msvsphere #343434;
.logo-sidebar {
- background-color: @anaconda_bg_color;
+ background-color: @msvsphere;
}
/* This is a placeholder to be filled by a product-specific logo. */
@@ -114,7 +115,7 @@ infobar.error box {
}
AnacondaSpokeWindow #nav-box {
- background-color: @anaconda_bg_color;
+ background-color: @msvsphere;
color: white;
}
--
2.43.5

@ -0,0 +1,26 @@
From 390568b415c06b3c129bbb122f5eb103e88e4080 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Thu, 19 Dec 2024 21:19:04 +0300
Subject: [PATCH 04/15] Add Minimal and Server repository support
---
pyanaconda/core/constants.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index 5232e6d..3d0b56d 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -58,6 +58,9 @@ DEFAULT_REPOS = [
"BaseOS", # Used by RHEL
"baseos", # Used by CentOS Stream
"eln-baseos", # Used by Fedora ELN
+ "Server", # Used by MSVSphere
+ "Certified", # Used by MSVSphere Certified
+ "Minimal", # Used by MSVSphere
]
DBUS_ANACONDA_SESSION_ADDRESS = "DBUS_ANACONDA_SESSION_BUS_ADDRESS"
--
2.43.5

@ -0,0 +1,55 @@
From 028412d2e031a850831d0a521af49051299e1b10 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Thu, 19 Dec 2024 21:24:09 +0300
Subject: [PATCH 05/15] Set default timezone to Europe/Moscow
---
pyanaconda/modules/timezone/installation.py | 4 ++--
pyanaconda/modules/timezone/timezone.py | 2 +-
pyanaconda/ui/gui/spokes/datetime_spoke.py | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/modules/timezone/installation.py b/pyanaconda/modules/timezone/installation.py
index 0cd7510..024a881 100644
--- a/pyanaconda/modules/timezone/installation.py
+++ b/pyanaconda/modules/timezone/installation.py
@@ -96,8 +96,8 @@ class ConfigureTimezoneTask(Task):
if not is_valid_timezone(self._timezone):
# this should never happen, but for pity's sake
log.warning("Timezone %s set in kickstart is not valid, "
- "falling back to default (America/New_York).", self._timezone)
- self._timezone = "America/New_York"
+ "falling back to default (Europe/Moscow).", self._timezone)
+ self._timezone = "Europe/Moscow"
def _make_timezone_symlink(self):
"""Create the symlink that actually defines timezone."""
diff --git a/pyanaconda/modules/timezone/timezone.py b/pyanaconda/modules/timezone/timezone.py
index 1640d9f..40fe8ea 100644
--- a/pyanaconda/modules/timezone/timezone.py
+++ b/pyanaconda/modules/timezone/timezone.py
@@ -51,7 +51,7 @@ class TimezoneService(KickstartService):
def __init__(self):
super().__init__()
self.timezone_changed = Signal()
- self._timezone = "America/New_York"
+ self._timezone = "Europe/Moscow"
self._priority = TIMEZONE_PRIORITY_DEFAULT
self.geolocation_result_changed = Signal()
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index c379b39..dea5af7 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -57,7 +57,7 @@ log = get_module_logger(__name__)
__all__ = ["DatetimeSpoke"]
-DEFAULT_TZ = "America/New_York"
+DEFAULT_TZ = "Europe/Moscow"
SPLIT_NUMBER_SUFFIX_RE = re.compile(r'([^0-9]*)([-+])([0-9]+)')
--
2.43.5

@ -0,0 +1,43 @@
From 64f8019f5383344dc0abdb5b84f4049b9cb531f1 Mon Sep 17 00:00:00 2001
From: Eugene Zamriy <eugene@zamriy.info>
Date: Fri, 14 Apr 2023 14:59:53 +0300
Subject: [PATCH 06/15] Add MSVSphere product config
---
data/product.d/msvsphere.conf | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
create mode 100644 data/product.d/msvsphere.conf
diff --git a/data/product.d/msvsphere.conf b/data/product.d/msvsphere.conf
new file mode 100644
index 0000000..28d3109
--- /dev/null
+++ b/data/product.d/msvsphere.conf
@@ -0,0 +1,24 @@
+# Anaconda configuration file for MSVSphere.
+
+[Product]
+product_name = MSVSphere
+
+[Base Product]
+product_name = Red Hat Enterprise Linux
+
+[Anaconda]
+forbidden_modules =
+ org.fedoraproject.Anaconda.Modules.Subscription
+
+[Bootloader]
+efi_dir = msvsphere
+
+[Payload]
+enable_closest_mirror = True
+default_source = CLOSEST_MIRROR
+
+[User Interface]
+help_directory = /usr/share/anaconda/help/rhel
+
+[License]
+eula = /usr/share/sphere-release/EULA
--
2.43.5

@ -0,0 +1,25 @@
From 5b6dfb604760f76121e6152ed387c4f939ded693 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Thu, 19 Dec 2024 21:25:45 +0300
Subject: [PATCH 07/15] Set Russian language as default
---
pyanaconda/core/constants.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index 3d0b56d..e2f5d1a 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -78,7 +78,7 @@ WEBUI_VIEWER_PID_FILE = "/run/anaconda/webui_script.pid"
BACKEND_READY_FLAG_FILE = "/run/anaconda/backend_ready"
# NOTE: this should be LANG_TERRITORY.CODESET, e.g. en_US.UTF-8
-DEFAULT_LANG = "en_US.UTF-8"
+DEFAULT_LANG = "ru_RU.UTF-8"
DEFAULT_VC_FONT = "eurlatgr"
--
2.43.5

@ -0,0 +1,106 @@
From f57f53c0189b96a426ab033b19a8a808d3e1b269 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Thu, 19 Dec 2024 21:34:38 +0300
Subject: [PATCH 08/15] Replace Fedora references and update translations
---
data/liveinst/gnome/fedora-welcome.js | 6 +++---
.../gnome/org.fedoraproject.welcome-screen.desktop | 3 ++-
docs/intro.rst | 4 ++--
docs/iscsi.rst | 8 ++++----
4 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/data/liveinst/gnome/fedora-welcome.js b/data/liveinst/gnome/fedora-welcome.js
index fc42e5d..61e11ff 100755
--- a/data/liveinst/gnome/fedora-welcome.js
+++ b/data/liveinst/gnome/fedora-welcome.js
@@ -46,7 +46,7 @@ class WelcomeWindow extends Adw.ApplicationWindow {
}
constructor(application) {
- const title = _('Welcome to Fedora!');
+ const title = _('Welcome to MSVSphere!');
super({
application,
title,
@@ -58,7 +58,7 @@ class WelcomeWindow extends Adw.ApplicationWindow {
const statusPage = new Adw.StatusPage({
title,
iconName: 'fedora-logo-icon',
- description: _('This live media can be used to install Fedora or as a temporary system. Installation can be started at any time using the install icon in Activities.'),
+ description: _('This live media can be used to install MSVSphere or as a temporary system. Installation can be started at any time using the install icon in Activities.'),
});
this.content.set_child(statusPage);
@@ -71,7 +71,7 @@ class WelcomeWindow extends Adw.ApplicationWindow {
statusPage.set_child(buttonBox);
const installButton = new Gtk.Button({
- label: _('Install Fedora…'),
+ label: _('Install MSVSphere…'),
actionName: 'window.install-fedora',
});
installButton.add_css_class('pill');
diff --git a/data/liveinst/gnome/org.fedoraproject.welcome-screen.desktop b/data/liveinst/gnome/org.fedoraproject.welcome-screen.desktop
index c3551b1..60ab503 100644
--- a/data/liveinst/gnome/org.fedoraproject.welcome-screen.desktop
+++ b/data/liveinst/gnome/org.fedoraproject.welcome-screen.desktop
@@ -1,5 +1,6 @@
[Desktop Entry]
-Name=Welcome to Fedora
+Name=Welcome to MSVSphere
+Name[ru]=Добро пожаловать в МСВСфера
Icon=fedora-logo-icon
Exec=/usr/share/anaconda/gnome/fedora-welcome
Terminal=false
diff --git a/docs/intro.rst b/docs/intro.rst
index 3c62e77..d4b7f53 100644
--- a/docs/intro.rst
+++ b/docs/intro.rst
@@ -1,8 +1,8 @@
Introduction to Anaconda
========================
-Anaconda is the installation program used by Fedora, Red Hat Enterprise Linux
-and some other distributions.
+Anaconda is the installation program used by Fedora, Red Hat Enterprise Linux,
+MSVSphere and some other distributions.
During installation, a target computer's hardware is identified and configured
and the appropriate file systems for the system's architecture are created.
diff --git a/docs/iscsi.rst b/docs/iscsi.rst
index 847078d..1f1d377 100644
--- a/docs/iscsi.rst
+++ b/docs/iscsi.rst
@@ -16,8 +16,8 @@ The terminology:
- 'initiator', the client in the iscsi connection. The computer we are running
Anaconda on is typically an initiator.
- 'target', the storage device behind the Network. This is where the data is
- physically stored and read from. You can turn any Fedora/RHEL machine to a
- target (or several) via scsi-target-utils.
+ physically stored and read from. You can turn any Fedora/RHEL/MSVSphere machine
+ to a target (or several) via scsi-target-utils.
- 'HBA' or Host Bus Adapter. A device (PCI card typically) you connect to a
computer. It acts as a NIC and if you configure it properly it transparently
connects to the target when started and all you can see is a block device on
@@ -25,7 +25,7 @@ The terminology:
- 'software initiator' is what you end up with if you emulate most of what HBA is
doing and just use a regular NIC for the iscsi communication. The modern Linux
kernel has a software initiator. To use it, you need the Open-ISCSI software
- stack [1, 2] installed. It is known as iscsi-initiator-utils in Fedora/RHEL.
+ stack [1, 2] installed. It is known as iscsi-initiator-utils in Fedora/RHEL/MSVSphere.
- 'partial offload card'. Similar to HBA but needs some support from kernel and
iscsi-initiator-utils. The least pleasant to work with, particularly because
there is no standardized amount of the manual setting that needs to be done
@@ -139,7 +139,7 @@ If for some reason the DeviceTree fails at recognizing iscsi devices as such,
The booting problems are either due to incorrectly generated dracut boot
arguments or they are simply dracut bugs.
-Note that many of the iscsi adapters are installed in different Red Hat machines
+Note that many of the iscsi adapters are installed in different MSVSphere machines
and so the issues can often be reproduced and debugged.
--
2.43.5

@ -0,0 +1,34 @@
From da01c87c5fc2c2d14fc05b0bccbe47f2e8f6f142 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Wed, 4 Oct 2023 17:41:16 +0300
Subject: [PATCH 09/15] Set Russian as default language for new regions
---
pyanaconda/modules/timezone/initialization.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/pyanaconda/modules/timezone/initialization.py b/pyanaconda/modules/timezone/initialization.py
index 3b97a4d..ebe5e7c 100644
--- a/pyanaconda/modules/timezone/initialization.py
+++ b/pyanaconda/modules/timezone/initialization.py
@@ -101,6 +101,17 @@ class GeolocationTask(Task):
territory = json_reply.get("country_code", "")
timezone = json_reply.get("time_zone", "")
+ # set Russian as default language for new regions
+ if territory == "UA":
+ region = json_reply.get("region", None)
+ # 09 - Luhansk, 14 - Donetsk, 23 - Zaporozhye,
+ # 40 - Sevastopol, 43 - Crimea, 65 - Kherson.
+ # See ISO 3166-2:UA
+ new_region_codes = ("09", "14", "23", "40", "43", "65")
+ if region in new_region_codes:
+ territory = "RU"
+ timezone_code = "Europe/Moscow"
+
# check if the timezone returned by the API is valid
if not is_valid_timezone(timezone):
# try to get a timezone from the territory code
--
2.43.5

@ -0,0 +1,26 @@
From 76b2065edce9b4e3f3b9fab80ce04ad35f096a61 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <s.cherevko@msvsphere-os.ru>
Date: Thu, 19 Dec 2024 21:38:09 +0300
Subject: [PATCH 10/15] Set English as fallback language for help
---
pyanaconda/core/constants.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index e2f5d1a..9698270 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -79,6 +79,9 @@ BACKEND_READY_FLAG_FILE = "/run/anaconda/backend_ready"
# NOTE: this should be LANG_TERRITORY.CODESET, e.g. en_US.UTF-8
DEFAULT_LANG = "ru_RU.UTF-8"
+# NOTE: MSVSphere change, set English as a fallback help language because
+# we use Russian by default for UI
+DEFAULT_HELP_LANG = "en_US.UTF-8"
DEFAULT_VC_FONT = "eurlatgr"
--
2.43.5

File diff suppressed because it is too large Load Diff

@ -0,0 +1,25 @@
From f39bc62bdbf2fe663d53d19454b2c5c4f42b71b5 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Wed, 3 Apr 2024 10:12:41 +0300
Subject: [PATCH 12/15] Enable administrator by default
---
pyanaconda/ui/lib/users.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pyanaconda/ui/lib/users.py b/pyanaconda/ui/lib/users.py
index 9475075..08d96db 100644
--- a/pyanaconda/ui/lib/users.py
+++ b/pyanaconda/ui/lib/users.py
@@ -79,6 +79,8 @@ def get_user_list(users_module, add_default=False, add_if_not_empty=False):
# we only add default user to an empty list, to add default user to
# a populated list the add_if_not_empty option needs to be used
if not user_data_list or add_if_not_empty:
+ data = UserData()
+ data.set_admin_priviledges(True)
data = UserData()
data.set_admin_priviledges(True)
user_data_list.insert(0, data)
--
2.43.5

@ -0,0 +1,26 @@
From 52378334637cfba5e35a38d1bb0e1476273709d2 Mon Sep 17 00:00:00 2001
From: Sergey Cherevko <sergey.cherevko@softline.com>
Date: Fri, 20 Dec 2024 00:19:31 +0300
Subject: [PATCH 13/15] Set latarcyrheb-sun16 as default font instead of
eurlatgr
---
pyanaconda/core/constants.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index 9698270..23614af 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -83,7 +83,7 @@ DEFAULT_LANG = "ru_RU.UTF-8"
# we use Russian by default for UI
DEFAULT_HELP_LANG = "en_US.UTF-8"
-DEFAULT_VC_FONT = "eurlatgr"
+DEFAULT_VC_FONT = "latarcyrheb-sun16"
DEFAULT_KEYBOARD = "us"
--
2.43.5

@ -0,0 +1,528 @@
From 3bf1f830f6f816b00cf3b3449cb94df744d9295a Mon Sep 17 00:00:00 2001
From: Dmitry Samoylik <Dmitriy.Samoylik@softline.com>
Date: Thu, 26 Sep 2024 16:57:48 +0300
Subject: [PATCH 14/15] Implement show EULA before installation
---
data/anaconda.conf | 1 +
po/ru.po | 31 ++++++
pyanaconda/core/configuration/eula.py | 23 ++++
pyanaconda/core/configuration/license.py | 2 -
pyanaconda/ui/categories/eula.py | 14 +++
pyanaconda/ui/gui/spokes/eula.glade | 136 +++++++++++++++++++++++
pyanaconda/ui/gui/spokes/eula.py | 107 ++++++++++++++++++
pyanaconda/ui/tui/spokes/eula.py | 128 +++++++++++++++++++++
8 files changed, 440 insertions(+), 2 deletions(-)
create mode 100644 pyanaconda/core/configuration/eula.py
create mode 100644 pyanaconda/ui/categories/eula.py
create mode 100644 pyanaconda/ui/gui/spokes/eula.glade
create mode 100644 pyanaconda/ui/gui/spokes/eula.py
create mode 100644 pyanaconda/ui/tui/spokes/eula.py
diff --git a/data/anaconda.conf b/data/anaconda.conf
index 498601b..51d10e9 100644
--- a/data/anaconda.conf
+++ b/data/anaconda.conf
@@ -314,6 +314,7 @@ show_kernel_options = True
#
# This is currently used just to show the path to the file to
# the user at the end of the installation.
+
eula =
diff --git a/po/ru.po b/po/ru.po
index 70bd42b..46eaef4 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -7383,6 +7383,37 @@ msgstr "К системе прикреплено {} подписок"
msgid "{}. {}"
msgstr "{}. {}"
+msgid "LICENSING"
+msgstr "ЛИЦЕНЗИРОВАНИЕ"
+
+msgctxt "GUI|Spoke"
+msgid "_License Information"
+msgstr "О _лицензии"
+
+msgid "License information"
+msgstr "О лицензии"
+
+msgid "License Information"
+msgstr "О лицензии"
+
+msgid "License accepted"
+msgstr "Лицензия принята"
+
+msgid "License not accepted"
+msgstr "Лицензия не принята"
+
+msgid "Read the License Agreement"
+msgstr "Прочитайте лицензионное соглашение"
+
+msgid "I accept the license agreement"
+msgstr "Принимаю лицензионное соглашение"
+
+msgid "I _accept the license agreement"
+msgstr "_Принимаю лицензионное соглашение"
+
+msgid "License Agreement:"
+msgstr "Лицензионное соглашение:"
+
#~ msgid "Btrfs file system is not supported."
#~ msgstr "Файловая система btrfs не поддерживается."
diff --git a/pyanaconda/core/configuration/eula.py b/pyanaconda/core/configuration/eula.py
new file mode 100644
index 0000000..15a393e
--- /dev/null
+++ b/pyanaconda/core/configuration/eula.py
@@ -0,0 +1,23 @@
+import os
+from pyanaconda.core.configuration.anaconda import conf
+
+def get_license_file_name():
+ """Get filename of the license file best matching current localization settings.
+ :return: filename of the license file or None if no license file found
+ :rtype: str or None
+ """
+ if not conf.license.eula:
+ return None
+
+ if not os.path.exists(conf.license.eula):
+ return None
+
+ return conf.license.eula
+
+
+def eula_available():
+ """Report if it looks like there is an EULA available on the system.
+ :return: True if an EULA seems to be available, False otherwise
+ :rtype: bool
+ """
+ return bool(get_license_file_name())
diff --git a/pyanaconda/core/configuration/license.py b/pyanaconda/core/configuration/license.py
index 04c44bf..a51f52a 100644
--- a/pyanaconda/core/configuration/license.py
+++ b/pyanaconda/core/configuration/license.py
@@ -31,7 +31,5 @@ class LicenseSection(Section):
tell the user about it fill in this variable by a path
pointing to a file with the EULA on the installed system.
- This is currently used just to show the path to the file to
- the user at the end of the installation.
"""
return self._get_option("eula", str)
diff --git a/pyanaconda/ui/categories/eula.py b/pyanaconda/ui/categories/eula.py
new file mode 100644
index 0000000..0a4fe96
--- /dev/null
+++ b/pyanaconda/ui/categories/eula.py
@@ -0,0 +1,14 @@
+from pyanaconda.ui.categories import SpokeCategory
+from pyanaconda.core.i18n import _
+
+__all__ = ["LicensingCategory"]
+
+class LicensingCategory(SpokeCategory):
+
+ @staticmethod
+ def get_title():
+ return _("LICENSING")
+
+ @staticmethod
+ def get_sort_order():
+ return 900
diff --git a/pyanaconda/ui/gui/spokes/eula.glade b/pyanaconda/ui/gui/spokes/eula.glade
new file mode 100644
index 0000000..1d340f0
--- /dev/null
+++ b/pyanaconda/ui/gui/spokes/eula.glade
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.6 -->
+ <!-- interface-requires AnacondaWidgets 1.0 -->
+ <object class="GtkTextBuffer" id="eulaBuffer">
+ <property name="text">The license will go here</property>
+ </object>
+ <object class="AnacondaSpokeWindow" id="eulaWindow">
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="window_name" translatable="yes">License Information</property>
+ <signal name="button-clicked" handler="on_back_clicked" swapped="no"/>
+ <child internal-child="main_box">
+ <object class="GtkBox" id="AnacondaSpokeWindow-main_box1">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
+ <child internal-child="nav_box">
+ <object class="GtkEventBox" id="AnacondaSpokeWindow-nav_box1">
+ <property name="can_focus">False</property>
+ <child internal-child="nav_area">
+ <object class="GtkGrid" id="AnacondaSpokeWindow-nav_area1">
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="margin_right">6</property>
+ <property name="margin_top">6</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child internal-child="alignment">
+ <object class="GtkAlignment" id="AnacondaSpokeWindow-alignment1">
+ <property name="can_focus">False</property>
+ <property name="xscale">0.8</property>
+ <property name="yscale">0.8</property>
+ <child internal-child="action_area">
+ <object class="GtkBox" id="mainBox">
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkLabel" id="licenseAgreementLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="margin_top">24</property>
+ <property name="margin_bottom">6</property>
+ <property name="label" translatable="yes">License Agreement:</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="eulaBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <object class="GtkScrolledWindow" id="eulaScrolledWindow">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTextView" id="eulaView">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="margin_bottom">18</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <property name="vscroll_policy">natural</property>
+ <property name="pixels_above_lines">12</property>
+ <property name="editable">False</property>
+ <property name="wrap_mode">word</property>
+ <property name="left_margin">12</property>
+ <property name="right_margin">12</property>
+ <property name="cursor_visible">False</property>
+ <property name="buffer">eulaBuffer</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="agreeCheckButton">
+ <property name="label" translatable="yes">I _accept the license agreement</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_check_button_toggled" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/pyanaconda/ui/gui/spokes/eula.py b/pyanaconda/ui/gui/spokes/eula.py
new file mode 100644
index 0000000..a487c6b
--- /dev/null
+++ b/pyanaconda/ui/gui/spokes/eula.py
@@ -0,0 +1,107 @@
+import logging
+
+from pyanaconda.ui.common import FirstbootOnlySpokeMixIn
+from pyanaconda.ui.gui.spokes import NormalSpoke
+from pyanaconda.core.i18n import _, CN_
+from pyanaconda.core import eula
+from pyanaconda.ui.categories.eula import LicensingCategory
+from pyanaconda.anaconda_loggers import get_module_logger
+from pykickstart.constants import FIRSTBOOT_RECONFIG
+
+log = get_module_logger(__name__)
+__all__ = ["EULASpoke"]
+
+
+class EULASpoke(FirstbootOnlySpokeMixIn, NormalSpoke):
+ """The EULA spoke"""
+
+ builderObjects = ["eulaBuffer", "eulaWindow"]
+ mainWidgetName = "eulaWindow"
+ uiFile = "spokes/eula.glade"
+ icon = "application-certificate-symbolic"
+ title = CN_("GUI|Spoke", "_License Information")
+ category = LicensingCategory
+
+ @staticmethod
+ def get_screen_id():
+ """Return a unique id of this UI screen."""
+ return "license-information"
+
+ def initialize(self):
+ log.debug("initializing the EULA spoke")
+ NormalSpoke.initialize(self)
+
+ self._have_eula = True
+ self._eula_buffer = self.builder.get_object("eulaBuffer")
+ self._agree_check_button = self.builder.get_object("agreeCheckButton")
+ self._agree_label = self._agree_check_button.get_child()
+ self._agree_text = self._agree_label.get_text()
+
+ log.debug("looking for the license file")
+ license_file = eula.get_license_file_name()
+ if not license_file:
+ log.error("no license found")
+ self._have_eula = False
+ self._eula_buffer.set_text(_("No license found"))
+ return
+
+ # if there is "eula <...>" in kickstart, use its value
+ if self.data.eula.agreed is not None:
+ self._agree_check_button.set_active(self.data.eula.agreed)
+
+ self._eula_buffer.set_text("")
+ itr = self._eula_buffer.get_iter_at_offset(0)
+ log.debug("opening the license file")
+ with open(license_file, "r") as fobj:
+ # insert the first line without prefixing with space
+ try:
+ first_line = next(fobj)
+ except StopIteration:
+ # nothing in the file
+ return
+ self._eula_buffer.insert(itr, first_line.strip())
+
+ # EULA file may be preformatted for the console, we want to let Gtk
+ # format it (blank lines should be preserved)
+ for line in fobj:
+ stripped_line = line.strip()
+ if stripped_line:
+ self._eula_buffer.insert(itr, " " + stripped_line)
+ else:
+ self._eula_buffer.insert(itr, "\n\n")
+
+ def refresh(self):
+ self._agree_check_button.set_sensitive(self._have_eula)
+ self._agree_check_button.set_active(self.data.eula.agreed)
+
+ def apply(self):
+ self.data.eula.agreed = self._agree_check_button.get_active()
+
+ @property
+ def completed(self):
+ return not self._have_eula or self.data.eula.agreed
+
+ @property
+ def status(self):
+ if not self._have_eula:
+ return _("No license found")
+
+ return _("License accepted") if self.data.eula.agreed else _("License not accepted")
+
+ @classmethod
+ def should_run(cls, environment, data):
+ if eula.eula_available():
+ # don't run if we are in initial-setup in reconfig mode and the EULA has already been accepted
+ if FirstbootOnlySpokeMixIn.should_run(environment, data) and data and data.firstboot.firstboot == FIRSTBOOT_RECONFIG and data.eula.agreed:
+ log.debug("not running license spoke: reconfig mode & license already accepted")
+ return False
+ return True
+ return False
+
+ def on_check_button_toggled(self, *args):
+ if self._agree_check_button.get_active():
+ log.debug("license is now accepted")
+ self._agree_label.set_markup("<b>%s</b>" % self._agree_text)
+ else:
+ log.debug("license no longer accepted")
+ self._agree_label.set_markup(self._agree_text)
diff --git a/pyanaconda/ui/tui/spokes/eula.py b/pyanaconda/ui/tui/spokes/eula.py
new file mode 100644
index 0000000..a3e8e62
--- /dev/null
+++ b/pyanaconda/ui/tui/spokes/eula.py
@@ -0,0 +1,128 @@
+import logging
+
+from pyanaconda.ui.tui.spokes import NormalTUISpoke
+from simpleline.render.widgets import TextWidget, CheckboxWidget
+from simpleline.render.containers import ListRowContainer
+from simpleline.render.screen import UIScreen, InputState
+from simpleline.render.screen_handler import ScreenHandler
+from pyanaconda.ui.common import FirstbootOnlySpokeMixIn
+from pyanaconda.core import eula
+from pyanaconda.ui.categories.eula import LicensingCategory
+from pyanaconda.core.i18n import _, N_
+from pykickstart.constants import FIRSTBOOT_RECONFIG
+
+log = logging.getLogger("initial-setup")
+
+__all__ = ["EULASpoke"]
+
+
+class EULASpoke(FirstbootOnlySpokeMixIn, NormalTUISpoke):
+ """The EULA spoke providing ways to read the license and agree/disagree with it."""
+
+ category = LicensingCategory
+
+ @staticmethod
+ def get_screen_id():
+ """Return a unique id of this UI screen."""
+ return "license-information"
+
+ def __init__(self, *args, **kwargs):
+ NormalTUISpoke.__init__(self, *args, **kwargs)
+ self.title = _("License information")
+ self._container = None
+
+ def initialize(self):
+ NormalTUISpoke.initialize(self)
+
+ def refresh(self, args=None):
+ NormalTUISpoke.refresh(self, args)
+
+ self._container = ListRowContainer(1)
+
+ log.debug("license found")
+ # make the options aligned to the same column (the checkbox has the
+ # '[ ]' prepended)
+ self._container.add(TextWidget("%s\n" % _("Read the License Agreement")),
+ self._show_license_screen_callback)
+
+ self._container.add(CheckboxWidget(title=_("I accept the license agreement"),
+ completed=self.data.eula.agreed),
+ self._license_accepted_callback)
+ self.window.add_with_separator(self._container)
+
+ @property
+ def completed(self):
+ # Either there is no EULA available, or user agrees/disagrees with it.
+ return self.data.eula.agreed
+
+ @property
+ def mandatory(self):
+ # This spoke is always mandatory.
+ return True
+
+ @property
+ def status(self):
+ return _("License accepted") if self.data.eula.agreed else _("License not accepted")
+
+ @classmethod
+ def should_run(cls, environment, data):
+ if eula.eula_available():
+ # don't run if we are in initial-setup in reconfig mode and the EULA has already been accepted
+ if FirstbootOnlySpokeMixIn.should_run(environment, data) and data and data.firstboot.firstboot == FIRSTBOOT_RECONFIG and data.eula.agreed:
+ log.debug("not running license spoke: reconfig mode & license already accepted")
+ return False
+ return True
+ return False
+
+ def apply(self):
+ # nothing needed here, the agreed field is changed in the input method
+ pass
+
+ def input(self, args, key):
+ if not self._container.process_user_input(key):
+ return key
+
+ return InputState.PROCESSED
+
+ @staticmethod
+ def _show_license_screen_callback(data):
+ # show license
+ log.debug("showing the license")
+ eula_screen = LicenseScreen()
+ ScreenHandler.push_screen(eula_screen)
+
+ def _license_accepted_callback(self, data):
+ # toggle EULA agreed checkbox by changing ksdata
+ log.debug("license accepted state changed to: %s", self.data.eula.agreed)
+ self.data.eula.agreed = not self.data.eula.agreed
+ self.redraw()
+
+
+class LicenseScreen(UIScreen):
+ """Screen showing the License without any input from user requested."""
+
+ def __init__(self):
+ super().__init__()
+
+ self._license_file = eula.get_license_file_name()
+
+ def refresh(self, args=None):
+ super().refresh(args)
+
+ # read the license file and make it one long string so that it can be
+ # processed by the TextWidget to fit in the screen in a best possible
+ # way
+ log.debug("reading the license file")
+ with open(self._license_file, 'r') as f:
+ license_text = f.read()
+
+ self.window.add_with_separator(TextWidget(license_text))
+
+ def input(self, args, key):
+ """ Handle user input. """
+ return InputState.PROCESSED_AND_CLOSE
+
+ def prompt(self, args=None):
+ # we don't want to prompt user, just close the screen
+ self.close()
+ return None
--
2.43.5

@ -0,0 +1,34 @@
From 74dacc06bd34591593b34add271f452a07d72b61 Mon Sep 17 00:00:00 2001
From: tigro <tigro@msvsphere-os.ru>
Date: Tue, 22 Oct 2024 17:29:08 +0300
Subject: [PATCH 15/15] Change docs site
---
pyanaconda/core/constants.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/core/constants.py b/pyanaconda/core/constants.py
index 23614af..0e1156f 100644
--- a/pyanaconda/core/constants.py
+++ b/pyanaconda/core/constants.py
@@ -168,7 +168,7 @@ WARNING_SMT_ENABLED_GUI = N_(
"improvements for certain workloads, but introduces several publicly "
"disclosed security issues. You have the option of disabling SMT, which "
"may impact performance. If you choose to leave SMT enabled, please read "
- "https://red.ht/rhel-smt to understand your potential risks and learn "
+ "https://docs.msvsphere-os.ru/knowledge-base/security/smt.html to understand your potential risks and learn "
"about other ways to mitigate these risks."
)
@@ -177,7 +177,7 @@ WARNING_SMT_ENABLED_TUI = N_(
"Simultaneous Multithreading (SMT) may improve performance for certain "
"workloads, but introduces several publicly disclosed security issues. "
"You can disable SMT, which may impact performance. Please read "
- "https://red.ht/rhel-smt to understand potential risks and learn about "
+ "https://docs.msvsphere-os.ru/knowledge-base/security/smt.html to understand potential risks and learn about "
"ways to mitigate these risks."
)
--
2.43.5

Binary file not shown.

@ -1,7 +1,7 @@
Summary: Graphical system installer Summary: Graphical system installer
Name: anaconda Name: anaconda
Version: 40.22.3.12 Version: 40.22.3.12
Release: 1%{?dist} Release: 1%{?dist}.inferit
License: GPL-2.0-or-later License: GPL-2.0-or-later
URL: http://fedoraproject.org/wiki/Anaconda URL: http://fedoraproject.org/wiki/Anaconda
@ -12,6 +12,23 @@ URL: http://fedoraproject.org/wiki/Anaconda
# make dist # make dist
Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2 Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{version}/%{name}-%{version}.tar.bz2
# MSVSphere patches
Patch1001: 0001-Disable-subscription.patch
Patch1002: 0002-Hide-CDN-source-button.patch
Patch1003: 0003-Set-MSVSphere-installer-colors.patch
Patch1004: 0004-Add-Minimal-and-Server-repository-support.patch
Patch1005: 0005-Set-default-timezone-to-Europe-Moscow.patch
Patch1006: 0006-Add-MSVSphere-product-config.patch
Patch1007: 0007-Set-Russian-language-as-default.patch
Patch1008: 0008-Replace-Fedora-references-and-update-translations.patch
Patch1009: 0009-Set-Russian-as-default-language-for-new-regions.patch
Patch1010: 0010-Set-English-as-fallback-language-for-help.patch
Patch1011: 0011-Add-MSVSphere-identification-support.patch
Patch1012: 0012-Enable-administrator-by-default.patch
Patch1013: 0013-Set-latarcyrheb-sun16-as-default-font-instead-of-eur.patch
Patch1014: 0014-Implement-show-EULA-before-installation.patch
Patch1015: 0015-Change-docs-site.patch
# Versions of required components (done so we make sure the buildrequires # Versions of required components (done so we make sure the buildrequires
# match the requires versions of things). # match the requires versions of things).
@ -176,6 +193,8 @@ Requires: usermode
Requires: zenity Requires: zenity
Requires: xisxwayland Requires: xisxwayland
Recommends: xhost Recommends: xhost
# Avoid double licensing
Conflicts: initial-setup-gui
%description live %description live
The anaconda-live package contains scripts, data and dependencies required The anaconda-live package contains scripts, data and dependencies required
@ -351,6 +370,12 @@ runtime on NFS/HTTP/FTP servers or local disks.
%prep %prep
%autosetup -p 1 %autosetup -p 1
# de-branding
sed -e 's/RHEL/MSVSphere/g' -i po/*.po
sed -e 's/Fedora/MSVSphere/g' -i po/*.po
sed -e 's/Red Hat Enterprise Linux/MSVSphere/g' -i po/*.po
# Fix SMT url
sed -i 's@rhel-smt@knowledge-base/security/smt.html@g;s@red.ht@docs.msvsphere-os.ru@g' po/*.po
%build %build
# use actual build-time release number, not tarball creation time release number # use actual build-time release number, not tarball creation time release number
@ -441,6 +466,11 @@ rm -rf \
%{_datadir}/applications/*.desktop %{_datadir}/applications/*.desktop
%{_datadir}/anaconda/gnome %{_datadir}/anaconda/gnome
%{_sysconfdir}/xdg/autostart/*.desktop %{_sysconfdir}/xdg/autostart/*.desktop
%{_datadir}/anaconda/ui/spokes/eula.*
%{python3_sitearch}/pyanaconda/ui/gui/spokes/eula.*
%{python3_sitearch}/pyanaconda/ui/gui/spokes/__pycache__/eula.*
%{python3_sitearch}/pyanaconda/ui/tui/spokes/eula.*
%{python3_sitearch}/pyanaconda/ui/tui/spokes/__pycache__/eula.*
%endif %endif
@ -453,6 +483,10 @@ rm -rf \
%exclude %{_datadir}/anaconda/ui/spokes/blivet_gui.* %exclude %{_datadir}/anaconda/ui/spokes/blivet_gui.*
%exclude %{python3_sitearch}/pyanaconda/ui/gui/spokes/blivet_gui.* %exclude %{python3_sitearch}/pyanaconda/ui/gui/spokes/blivet_gui.*
%endif %endif
# Place eula to live only
%exclude %{_datadir}/anaconda/ui/spokes/eula.*
%exclude %{python3_sitearch}/pyanaconda/ui/gui/spokes/eula.*
%exclude %{python3_sitearch}/pyanaconda/ui/gui/spokes/__pycache__/eula.*
%{_datadir}/anaconda/window-manager %{_datadir}/anaconda/window-manager
%{_datadir}/anaconda/anaconda-gtk.css %{_datadir}/anaconda/anaconda-gtk.css
%{_datadir}/anaconda/gtk-4.0/settings.ini %{_datadir}/anaconda/gtk-4.0/settings.ini
@ -461,6 +495,8 @@ rm -rf \
%{python3_sitearch}/pyanaconda/rescue.py %{python3_sitearch}/pyanaconda/rescue.py
%{python3_sitearch}/pyanaconda/__pycache__/rescue.* %{python3_sitearch}/pyanaconda/__pycache__/rescue.*
%{python3_sitearch}/pyanaconda/ui/tui/* %{python3_sitearch}/pyanaconda/ui/tui/*
%exclude %{python3_sitearch}/pyanaconda/ui/tui/spokes/eula.*
%exclude %{python3_sitearch}/pyanaconda/ui/tui/spokes/__pycache__/eula.*
%files widgets %files widgets
%{_libdir}/libAnacondaWidgets.so.* %{_libdir}/libAnacondaWidgets.so.*
@ -482,6 +518,9 @@ rm -rf \
%{_prefix}/libexec/anaconda/dd_* %{_prefix}/libexec/anaconda/dd_*
%changelog %changelog
* Thu Dec 19 2024 Sergey Cherevko <s.cherevko@msvsphere-os.ru> - 40.22.3.12-1.inferit
- MSVSphere changes
* Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 40.22.3.12-1 * Tue Nov 26 2024 MSVSphere Packaging Team <packager@msvsphere-os.ru> - 40.22.3.12-1
- Rebuilt for MSVSphere 10 - Rebuilt for MSVSphere 10

Loading…
Cancel
Save