Compare commits

...
Sign in to create a new pull request.

10 commits

Author SHA1 Message Date
Adam Williamson
f9ee78e7d4 Backport PR #4125 to fix icon theme problems on KDE 2022-05-19 12:59:34 -07:00
Martin Kolman
206192c576 Fix Packit induced breakage
Looks like the issue plaguing our previous release attempt has not yet
been fixed.
2022-04-12 03:42:23 +02:00
Packit
13da1dcc95 [packit] 36.16.5 upstream release
Upstream tag: anaconda-36.16.5-1
Upstream commit: 9d19c0f0

Signed-off-by: Packit <hello@packit.dev>
2022-04-12 00:45:41 +00:00
Martin Kolman
c825f7c499 36.16.4 upstream release
Upstream tag: anaconda-36.16.4-1
Upstream commit: a760a706

Signed-off-by: Packit <hello@packit.dev>
2022-03-31 14:16:24 +02:00
Martin Kolman
ffe86346f5 36.16.3 upstream release
Upstream tag: anaconda-36.16.3-1
Upstream commit: 56a10d48

Signed-off-by: Packit <hello@packit.dev>
2022-03-30 13:24:09 +02:00
Adam Williamson
72193ddcc0 Add xisxwayland dependency required for keyboard changes 2022-03-16 14:54:51 -07:00
Martin Kolman
9e2a93b5d3 [mkolman] 36.16.2-3 bugfix release
- network: Handle network configuration paths not existing (adamw)
- Don't configure the keyboard in Live environments with XWayland (jkonecny)
- Disable layout_indicator in Anaconda (jkonecny)
- Increase version of the anaconda-widgets (jkonecny)
2022-03-15 17:48:10 +01:00
Martin Kolman
c1f8d22416 [mkolman] 36.16.2-2 bugfix release
- Do not copy resolv.conf to target system at the end of installation (rvykydal)
- Do not copy /etc/resolv.conf to chroot before installation (rvykydal)
2022-03-03 03:16:02 +01:00
Packit Service
c9fa4e0fb2 [packit] 36.16.2 upstream release
Upstream tag: anaconda-36.16.2-1
Upstream commit: de211be8

Signed-off-by: Packit Service <user-cont-team+packit-service@redhat.com>
2022-02-21 20:30:53 +00:00
Packit Service
8687390ab3 [packit] 36.16.1 upstream release
Upstream tag: anaconda-36.16.1-1
Upstream commit: c6e3ba69

Signed-off-by: Packit Service <user-cont-team+packit-service@redhat.com>
2022-02-16 17:12:17 +00:00
12 changed files with 889 additions and 10 deletions

5
.gitignore vendored
View file

@ -311,3 +311,8 @@
/anaconda-36.14.tar.bz2
/anaconda-36.15.tar.bz2
/anaconda-36.16.tar.bz2
/anaconda-36.16.1.tar.bz2
/anaconda-36.16.2.tar.bz2
/anaconda-36.16.3.tar.bz2
/anaconda-36.16.4.tar.bz2
/anaconda-36.16.5.tar.bz2

View file

@ -2,6 +2,21 @@ specfile_path: anaconda.spec
upstream_package_name: anaconda
upstream_tag_template: anaconda-{version}-1
copy_upstream_release_description: true
srpm_build_deps:
- automake
- autoconf
- autogen
- glib2-devel
- gettext-devel
- python3-polib
- gobject-introspection-devel
- glade-devel
- libxklavier-devel
- libarchive-devel
- rpm-devel
- audit-libs-devel
- nss_wrapper
- npm
actions:
post-upstream-clone:
- ./autogen.sh
@ -14,26 +29,26 @@ jobs:
- job: propose_downstream
trigger: release
metadata:
dist_git_branches: fedora-development
dist_git_branches: f36
- job: tests
trigger: pull_request
metadata:
targets:
- fedora-rawhide
- f36
- job: copr_build
trigger: pull_request
metadata:
targets:
- fedora-rawhide
- f36
- job: copr_build
trigger: commit
metadata:
targets:
- fedora-rawhide
branch: master
- f36
branch: f36-devel
owner: "@rhinstaller"
project: Anaconda
preserve_project: True
@ -43,7 +58,7 @@ jobs:
metadata:
targets:
- fedora-latest
branch: f35-devel
branch: f36-devel
owner: "@rhinstaller"
project: Anaconda-devel
preserve_project: True

View file

@ -0,0 +1,57 @@
From 10e197fb5e7db7160b0837eda63b420b523755da Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Thu, 3 Feb 2022 12:13:51 +0100
Subject: [PATCH 1/2] Do not copy resolv.conf to target system at the end of
installation
An /etc/resolv.conf symlink is created on target system by
systemd-resolved in postin rpm script. And if it is not (bug #2018913)
it would be crated during boot of installed system (by systemd-resolved).
The only case where anaconda copying the resolv.conf could have actually
effect would be overwriting /etc/resolv.conf on target system in non-rpm
payload installations (image installations). But even in this case
Anaconda should not interfere into management of /etc/resolv.conf on the
target system. It is a business of either the image creator or a service
on starting installed system (systemd-resolved or NM).
---
pyanaconda/modules/network/installation.py | 12 ------
.../modules/network/test_module_network.py | 37 -------------------
2 files changed, 49 deletions(-)
diff --git a/pyanaconda/modules/network/installation.py b/pyanaconda/modules/network/installation.py
index defd91327c..f46574e6f6 100644
--- a/pyanaconda/modules/network/installation.py
+++ b/pyanaconda/modules/network/installation.py
@@ -98,7 +98,6 @@ class NetworkInstallationTask(Task):
SYSCONF_NETWORK_FILE_PATH = "/etc/sysconfig/network"
ANACONDA_SYSCTL_FILE_PATH = "/etc/sysctl.d/anaconda.conf"
- RESOLV_CONF_FILE_PATH = "/etc/resolv.conf"
NETWORK_SCRIPTS_DIR_PATH = IFCFG_DIR
PREFIXDEVNAME_CONFIG_FILE_PREFIX = "71-net-ifnames-prefix-"
NETWORK_SCRIPTS_CONFIG_FILE_PREFIXES = ("ifcfg-", "keys-", "route-")
@@ -154,7 +153,6 @@ Name={}
self._disable_ipv6_on_system(self._sysroot)
self._copy_device_config_files(self._sysroot)
self._copy_dhclient_config_files(self._sysroot, self._network_ifaces)
- self._copy_resolv_conf(self._sysroot, self._overwrite)
if self._configure_persistent_device_names:
self._copy_prefixdevname_files(self._sysroot)
@@ -217,16 +215,6 @@ Name={}
msg = "Cannot disable ipv6 on the system: {}".format(e.strerror)
raise NetworkInstallationError(msg) from e
- def _copy_resolv_conf(self, root, overwrite):
- """Copy resolf.conf file to target system.
-
- :param root: path to the root of the target system
- :type root: str
- :param overwrite: overwrite existing configuration file
- :type overwrite: bool
- """
- self._copy_file_to_root(root, self.RESOLV_CONF_FILE_PATH, follow_symlinks=False)
-
def _copy_file_to_root(self, root, config_file, overwrite=False, follow_symlinks=True):
"""Copy the file to target system.

View file

@ -0,0 +1,46 @@
From 427f98963643e7f823f650dab015c80d854aa2d1 Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Thu, 19 May 2022 09:50:17 -0700
Subject: [PATCH] Specify that we want the Adwaita icon theme
Back in 38556e7e in 2016 when anaconda switched from 'gnome'
icon theme, intending to use 'Adwaita' instead, we dropped the
line that specifically declares what theme anaconda wants to
use. Presumably we expected GTK would always pick Adwaita for
us. However, with GTK 3.24.34, this seems to not reliably happen
on KDE. On KDE images, the breeze icon theme is installed, and
it also provides many of the icons anaconda uses. When running
anaconda on a KDE live image with GTK 3.24.34, we're often seeing
the icons from the breeze theme used instead of the icons from
the Adwaita theme. This happened in 4 out of 4 tests on openQA
prod, 3 out of 4 tests on openQA stg, and 5 out of 5 tests I
ran in a VM myself. I then applied this change directly to the
file in the VM and re-tested another 5 times; all 5 times the
right icons were shown.
I'm not sure why this is suddenly a problem with GTK 3.24.34
when it never was before even though both icon themes have been
in KDE for years, but this seems correct anyway. We definitely
want anaconda to use the Adwaita icons, not ones from any other
theme.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
pyanaconda/ui/gui/__init__.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index d458b66f14..428f30e744 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -754,6 +754,7 @@ class GraphicalUserInterface(UserInterface):
# Set some program-wide settings.
settings = Gtk.Settings.get_default()
settings.set_property("gtk-font-name", "Cantarell")
+ settings.set_property("gtk-icon-theme-name", "Adwaita")
# Get the path to the application data
data_path = os.environ.get("ANACONDA_DATA", "/usr/share/anaconda")
--
2.36.1

View file

@ -0,0 +1,133 @@
From 279328cd3231b972cc32c241aa45e5df20b0e947 Mon Sep 17 00:00:00 2001
From: Radek Vykydal <rvykydal@redhat.com>
Date: Tue, 22 Feb 2022 11:55:16 +0100
Subject: [PATCH 2/2] Do not copy /etc/resolv.conf to chroot before
installation
It does not seem to make sense anymore given systemd-resolved is
creating its own symlink in rpm postin script that rewrites the file.
(see rhbz#2018913, rhbz#2032085)
---
pyanaconda/core/configuration/system.py | 5 -----
pyanaconda/installation.py | 25 -------------------------
pyanaconda/network.py | 24 ++----------------------
3 files changed, 2 insertions(+), 52 deletions(-)
diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py
index 85560280b9..9ff8b77ba4 100644
--- a/pyanaconda/core/configuration/system.py
+++ b/pyanaconda/core/configuration/system.py
@@ -171,8 +171,3 @@ class SystemSection(Section):
def provides_system_bus(self):
"""Can we access the system DBus?"""
return self._is_boot_iso or self._is_live_os or self._is_booted_os
-
- @property
- def provides_resolver_config(self):
- """Can we copy /etc/resolv.conf to the target system?"""
- return self._is_boot_iso
diff --git a/pyanaconda/installation.py b/pyanaconda/installation.py
index 95b63c1c8c..bcd201188f 100644
--- a/pyanaconda/installation.py
+++ b/pyanaconda/installation.py
@@ -45,25 +45,6 @@ log = get_module_logger(__name__)
__all__ = ["run_installation"]
-class WriteResolvConfTask(Task):
- """Custom task subclass for handling the resolv.conf copy task.
-
- The main reason is to resolve the sysroot path right before the
- copy operation, not at task & task queue creation time.
-
- Secondary reason is to demonstrate how a lightweight Task subclass can be used.
- """
-
- def run_task(self):
- """Resolve the sysroot path only right before doing the copy operation.
-
- If we just added the sysroot path as an argument, it would be resolved when the
- task queue was created, not when the task is actually executed, which could
- theoretically result in an incorrect path.
- """
- network.copy_resolv_conf_to_root(conf.target.system_root)
-
-
def _writeKS(ksdata):
path = conf.target.system_root + "/root/anaconda-ks.cfg"
@@ -309,12 +290,6 @@ def _prepare_installation(payload, ksdata):
# - check for possibly needed additional packages.
pre_install = TaskQueue("Pre install tasks", N_("Running pre-installation tasks"))
- # make name resolution work for rpm scripts in chroot
- if conf.system.provides_resolver_config:
- # we use a custom Task subclass as the sysroot path has to be resolved
- # only when the task is actually started, not at task creation time
- pre_install.append(WriteResolvConfTask("Copy resolv.conf to sysroot"))
-
if is_module_available(SECURITY):
security_proxy = SECURITY.get_proxy()
diff --git a/pyanaconda/network.py b/pyanaconda/network.py
index d5fd6e2add..38fe957104 100644
--- a/pyanaconda/network.py
+++ b/pyanaconda/network.py
@@ -16,10 +16,8 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import shutil
import socket
import itertools
-import os
import time
import threading
import re
@@ -31,7 +29,6 @@ from pyanaconda.anaconda_loggers import get_module_logger
from pyanaconda.core import util, constants
from pyanaconda.core.i18n import _
from pyanaconda.core.kernel import kernel_arguments
-from pyanaconda.core.path import make_directories
from pyanaconda.core.regexes import HOSTNAME_PATTERN_WITHOUT_ANCHORS, \
IPV6_ADDRESS_IN_DRACUT_IP_OPTION, MAC_OCTET
from pyanaconda.core.configuration.anaconda import conf
@@ -56,9 +53,8 @@ _nm_client = None
__all__ = ["get_supported_devices", "status_message", "wait_for_connectivity",
"wait_for_connecting_NM_thread", "wait_for_network_devices", "wait_for_connected_NM",
- "initialize_network", "copy_resolv_conf_to_root", "prefix_to_netmask",
- "netmask_to_prefix", "get_first_ip_address", "is_valid_hostname", "check_ip_address",
- "get_nm_client", "write_configuration"]
+ "initialize_network", "prefix_to_netmask", "netmask_to_prefix", "get_first_ip_address",
+ "is_valid_hostname", "check_ip_address", "get_nm_client", "write_configuration"]
def get_nm_client():
@@ -218,22 +214,6 @@ def iface_for_host_ip(host_ip):
return route_info[route_info.index("dev") + 1]
-def copy_resolv_conf_to_root(root="/"):
- """Copy resolv.conf to a system root."""
- src = "/etc/resolv.conf"
- dst = os.path.join(root, src.lstrip('/'))
- if not os.path.isfile(src):
- log.debug("%s does not exist", src)
- return
- if os.path.isfile(dst):
- log.debug("%s already exists", dst)
- return
- dst_dir = os.path.dirname(dst)
- if not os.path.isdir(dst_dir):
- make_directories(dst_dir)
- shutil.copyfile(src, dst)
-
-
def run_network_initialization_task(task_path):
"""Run network initialization task and log the result."""
task_proxy = NETWORK.get_proxy(task_path)
--
2.35.1

View file

@ -0,0 +1,50 @@
From 5e380c4f30b4a8dc0e4670ff029180128d6a5acd Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Tue, 8 Mar 2022 16:10:30 -0800
Subject: [PATCH 3/6] network: Handle network configuration paths not existing
When installing network configuration files, we shouldn't assume
that the relevant paths (network-scripts and system-connections)
actually exist, they don't have to. NetworkManager has split
/etc/sysconfig/network-scripts off into a subpackage that is
no longer installed by default. We guarded against this in
`get_config_files_paths` already, but not in
`_copy_device_config_files`.
(cherry picked from commit dfdc075052b06437b261dc3d5e3ceb4265a28ded)
---
pyanaconda/modules/network/installation.py | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/pyanaconda/modules/network/installation.py b/pyanaconda/modules/network/installation.py
index f46574e6f6..3ac65e0df0 100644
--- a/pyanaconda/modules/network/installation.py
+++ b/pyanaconda/modules/network/installation.py
@@ -240,15 +240,17 @@ Name={}
:param root: path to the root of the target system
:type root: str
"""
- for config_file in os.listdir(self.NETWORK_SCRIPTS_DIR_PATH):
- if config_file.startswith(self.NETWORK_SCRIPTS_CONFIG_FILE_PREFIXES):
- config_file_path = os.path.join(self.NETWORK_SCRIPTS_DIR_PATH,
+ if os.path.exists(self.NETWORK_SCRIPTS_DIR_PATH):
+ for config_file in os.listdir(self.NETWORK_SCRIPTS_DIR_PATH):
+ if config_file.startswith(self.NETWORK_SCRIPTS_CONFIG_FILE_PREFIXES):
+ config_file_path = os.path.join(self.NETWORK_SCRIPTS_DIR_PATH,
+ config_file)
+ self._copy_file_to_root(root, config_file_path)
+ if os.path.exists(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
+ for config_file in os.listdir(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
+ config_file_path = os.path.join(self.NM_SYSTEM_CONNECTIONS_DIR_PATH,
config_file)
self._copy_file_to_root(root, config_file_path)
- for config_file in os.listdir(self.NM_SYSTEM_CONNECTIONS_DIR_PATH):
- config_file_path = os.path.join(self.NM_SYSTEM_CONNECTIONS_DIR_PATH,
- config_file)
- self._copy_file_to_root(root, config_file_path)
def _copy_dhclient_config_files(self, root, network_ifaces):
"""Copy dhclient configuration files to target system.
--
2.35.1

View file

@ -0,0 +1,282 @@
From 572606437f9eebe9640acc3396a0e8eaf74869c7 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Mon, 14 Mar 2022 13:31:55 +0100
Subject: [PATCH 4/6] Don't configure the keyboard in Live environments with
XWayland
Call the can_configure_keyboard function to check if we can configure the
keyboard. The function doesn't allow the configuration in Live environments
that run Anaconda on XWayland. Use the xisxwayland tool for detection.
Related: rhbz#2016613
(cherry picked from commit e24a1ba6d97481ac81fbfa492f58d9d7e74355b9)
---
anaconda.spec.in | 1 +
pyanaconda/core/configuration/system.py | 5 ++
pyanaconda/keyboard.py | 48 +++++++++++++++-
pyanaconda/ui/gui/__init__.py | 1 +
pyanaconda/ui/gui/spokes/keyboard.py | 13 ++---
.../pyanaconda_tests/test_keyboard.py | 56 ++++++++++++++++++-
6 files changed, 114 insertions(+), 10 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index 57f216f14c..fadc83d858 100644
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -157,6 +157,7 @@ BuildRequires: desktop-file-utils
Requires: anaconda-gui = %{version}-%{release}
Requires: usermode
Requires: zenity
+Requires: xisxwayland
Recommends: xhost
%description live
diff --git a/pyanaconda/core/configuration/system.py b/pyanaconda/core/configuration/system.py
index 9ff8b77ba4..37fd50ce91 100644
--- a/pyanaconda/core/configuration/system.py
+++ b/pyanaconda/core/configuration/system.py
@@ -127,6 +127,11 @@ class SystemSection(Section):
"""Can we configure the keyboard?"""
return self._is_boot_iso or self._is_live_os or self._is_booted_os
+ @property
+ def can_run_on_xwayland(self):
+ """Could we run on XWayland?"""
+ return self._is_live_os
+
@property
def can_modify_syslog(self):
"""Can we modify syslog?"""
diff --git a/pyanaconda/keyboard.py b/pyanaconda/keyboard.py
index 3ab47bc420..10b7e56920 100644
--- a/pyanaconda/keyboard.py
+++ b/pyanaconda/keyboard.py
@@ -26,6 +26,7 @@ import langtable
from pyanaconda.core.configuration.anaconda import conf
from pyanaconda import localization
from pyanaconda.core.constants import DEFAULT_KEYBOARD
+from pyanaconda.core.util import execWithRedirect
from pyanaconda.modules.common.task import sync_run_task
from pyanaconda.modules.common.constants.services import LOCALIZATION
@@ -55,6 +56,49 @@ class InvalidLayoutVariantSpec(Exception):
pass
+def _is_xwayland():
+ """Is Anaconda running in XWayland environment?
+
+ This can't be easily detected from the Anaconda because Anaconda
+ is running as XWayland app. Use xisxwayland tool for the detection.
+ """
+ try:
+ rc = execWithRedirect('xisxwayland', [])
+
+ if rc == 0:
+ return True
+
+ log.debug(
+ "Anaconda doesn't run on XWayland. "
+ "See xisxwayland --help for more info."
+ )
+ except FileNotFoundError:
+ log.warning(
+ "The xisxwayland tool is not available! "
+ "Taking the environment as not Wayland."
+ )
+
+ return False
+
+
+def can_configure_keyboard():
+ """Can we configure the keyboard?
+
+ FIXME: This is a temporary solution.
+
+ The is_wayland logic is not part of the configuration so we would
+ have to add it to the configuration otherwise it won't be accessible
+ in the Anaconda modules.
+ """
+ if not conf.system.can_configure_keyboard:
+ return False
+
+ if conf.system.can_run_on_xwayland and _is_xwayland():
+ return False
+
+ return True
+
+
def parse_layout_variant(layout_variant_str):
"""
Parse layout and variant from the string that may look like 'layout' or
@@ -180,7 +224,7 @@ def set_x_keyboard_defaults(localization_proxy, xkl_wrapper):
new_layouts = [DEFAULT_KEYBOARD]
localization_proxy.SetXLayouts(new_layouts)
- if conf.system.can_configure_keyboard:
+ if can_configure_keyboard():
xkl_wrapper.replace_layouts(new_layouts)
# the console layout configured should be "native" by default,
@@ -193,7 +237,7 @@ def set_x_keyboard_defaults(localization_proxy, xkl_wrapper):
# initialize layout switching if needed
localization_proxy.SetLayoutSwitchOptions(["grp:alt_shift_toggle"])
- if conf.system.can_configure_keyboard:
+ if can_configure_keyboard():
xkl_wrapper.set_switching_options(["grp:alt_shift_toggle"])
# activate the language-default layout instead of the additional
# one
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index fc95721f97..5b95ee99ac 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -41,6 +41,7 @@ from pyanaconda.core.path import make_directories
from pyanaconda import threading as anaconda_threading
from pyanaconda.core.glib import Bytes, GError
+from pyanaconda.keyboard import can_configure_keyboard
from pyanaconda.ui import UserInterface, common
from pyanaconda.ui.gui.utils import unbusyCursor
from pyanaconda.core.async_utils import async_action_wait
diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py
index fe7c225719..a32dab0696 100644
--- a/pyanaconda/ui/gui/spokes/keyboard.py
+++ b/pyanaconda/ui/gui/spokes/keyboard.py
@@ -33,7 +33,6 @@ from pyanaconda.ui.gui.xkl_wrapper import XklWrapper, XklWrapperError
from pyanaconda import keyboard
from pyanaconda import flags
from pyanaconda.core.i18n import _, N_, CN_
-from pyanaconda.core.configuration.anaconda import conf
from pyanaconda.core.constants import DEFAULT_KEYBOARD, THREAD_KEYBOARD_INIT, THREAD_ADD_LAYOUTS_INIT
from pyanaconda.ui.communication import hubQ
from pyanaconda.core.string import strip_accents, have_word_match
@@ -381,7 +380,7 @@ class KeyboardSpoke(NormalSpoke):
self._add_dialog = AddLayoutDialog(self.data)
self._add_dialog.initialize()
- if conf.system.can_configure_keyboard:
+ if keyboard.can_configure_keyboard():
self.builder.get_object("warningBox").hide()
# We want to store layouts' names but show layouts as
@@ -401,7 +400,7 @@ class KeyboardSpoke(NormalSpoke):
self._layoutSwitchLabel = self.builder.get_object("layoutSwitchLabel")
- if not conf.system.can_configure_keyboard:
+ if not keyboard.can_configure_keyboard():
# Disable area for testing layouts as we cannot make
# it work without modifying runtime system
@@ -453,7 +452,7 @@ class KeyboardSpoke(NormalSpoke):
def _addLayout(self, store, name):
# first try to add the layout
- if conf.system.can_configure_keyboard:
+ if keyboard.can_configure_keyboard():
self._xkl_wrapper.add_layout(name)
# valid layout, append it to the store
@@ -466,7 +465,7 @@ class KeyboardSpoke(NormalSpoke):
"""
- if conf.system.can_configure_keyboard:
+ if keyboard.can_configure_keyboard():
self._xkl_wrapper.remove_layout(store[itr][0])
store.remove(itr)
@@ -558,7 +557,7 @@ class KeyboardSpoke(NormalSpoke):
return
store.swap(cur, prev)
- if conf.system.can_configure_keyboard:
+ if keyboard.can_configure_keyboard():
self._flush_layouts_to_X()
if not store.iter_previous(cur):
@@ -581,7 +580,7 @@ class KeyboardSpoke(NormalSpoke):
return
store.swap(cur, nxt)
- if conf.system.can_configure_keyboard:
+ if keyboard.can_configure_keyboard():
self._flush_layouts_to_X()
if activate_default:
diff --git a/tests/unit_tests/pyanaconda_tests/test_keyboard.py b/tests/unit_tests/pyanaconda_tests/test_keyboard.py
index 5f632ceb5c..b97aef0664 100644
--- a/tests/unit_tests/pyanaconda_tests/test_keyboard.py
+++ b/tests/unit_tests/pyanaconda_tests/test_keyboard.py
@@ -15,12 +15,66 @@
# License and may only be used or replicated with the express permission of
# Red Hat, Inc.
#
-
from pyanaconda import keyboard
import unittest
import pytest
+from unittest.mock import patch
+
+
+class KeyboardUtilsTestCase(unittest.TestCase):
+ """Test the keyboard utils."""
+
+ @patch("pyanaconda.keyboard.conf")
+ @patch("pyanaconda.keyboard.execWithRedirect")
+ def test_can_configure_keyboard(self, exec_mock, conf_mock):
+ """Check if the keyboard configuration is enabled or disabled."""
+ # It's a dir installation.
+ conf_mock.system.can_configure_keyboard = False
+ conf_mock.system.can_run_on_xwayland = False
+ assert keyboard.can_configure_keyboard() is False
+ exec_mock.assert_not_called()
+
+ # It's a boot.iso.
+ conf_mock.system.can_configure_keyboard = True
+ conf_mock.system.can_run_on_xwayland = False
+ assert keyboard.can_configure_keyboard() is True
+ exec_mock.assert_not_called()
+
+ # It's a Live installation on Wayland.
+ conf_mock.system.can_configure_keyboard = True
+ conf_mock.system.can_run_on_xwayland = True
+ exec_mock.return_value = 0
+ assert keyboard.can_configure_keyboard() is False
+ exec_mock.assert_called_once_with('xisxwayland', [])
+ exec_mock.reset_mock()
+
+ # It's a Live installation and not on Wayland.
+ conf_mock.system.can_configure_keyboard = True
+ conf_mock.system.can_run_on_xwayland = True
+ exec_mock.return_value = 1 # xisxwayland returns 1 if it is not XWayland
+ assert keyboard.can_configure_keyboard() is True
+ exec_mock.assert_called_once_with('xisxwayland', [])
+ exec_mock.reset_mock()
+
+ # It's a Live installation and probably not on Wayland,
+ # because the xisxwayland tooling is not present.
+ conf_mock.system.can_configure_keyboard = True
+ conf_mock.system.can_run_on_xwayland = True
+ exec_mock.side_effect = FileNotFoundError()
+
+ with self.assertLogs(level="WARNING") as cm:
+ keyboard.can_configure_keyboard()
+
+ msg = "The xisxwayland tool is not available!"
+ assert any(map(lambda x: msg in x, cm.output))
+
+ exec_mock.assert_called_once_with('xisxwayland', [])
+ exec_mock.reset_mock()
+
+
class ParsingAndJoiningTests(unittest.TestCase):
+
def test_layout_variant_parsing(self):
"""Should correctly parse keyboard layout and variant string specs."""
--
2.35.1

View file

@ -0,0 +1,86 @@
From e786f58127bed4fc980a6f9cf2796947942066c2 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Thu, 17 Feb 2022 21:12:14 +0100
Subject: [PATCH 5/6] Disable layout_indicator in Anaconda
Let's remove the layout indicator in if we can't change the keyboard. It's only
confusing because the value may not be correct.
Resolves: rhbz#2016613
(cherry picked from commit 3c0849c2ed92cf6885e4de2315573120a8e1c555)
---
pyanaconda/ui/gui/__init__.py | 12 +++++++++++-
widgets/src/BaseWindow.c | 14 ++++++++++++++
widgets/src/BaseWindow.h | 1 +
3 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index 5b95ee99ac..bcd70335ad 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -43,7 +43,7 @@ from pyanaconda import threading as anaconda_threading
from pyanaconda.core.glib import Bytes, GError
from pyanaconda.keyboard import can_configure_keyboard
from pyanaconda.ui import UserInterface, common
-from pyanaconda.ui.gui.utils import unbusyCursor
+from pyanaconda.ui.gui.utils import unbusyCursor, really_hide
from pyanaconda.core.async_utils import async_action_wait
from pyanaconda.ui.gui.utils import watch_children, unwatch_children
from pyanaconda.ui.gui.helpers import autoinstall_stopped
@@ -160,6 +160,16 @@ class GUIObject(common.UIObject):
self.builder.connect_signals(self)
+ # Hide keyboard indicator if we can't configure the keyboard
+ # It doesn't really give you any benefit of seeing something which could
+ # give you wrong values.
+ # This has to be applied to every spoke and hub - we have to ignore dialog and other
+ # non full screen parts.
+ if not can_configure_keyboard() and isinstance(self.window, AnacondaWidgets.BaseWindow):
+ layout_indicator = self.window.get_layout_indicator_box()
+ really_hide(layout_indicator)
+ layout_indicator.set_sensitive(False)
+
def _findUIFile(self):
path = os.environ.get("UIPATH", "./:/usr/share/anaconda/ui/")
dirs = path.split(":")
diff --git a/widgets/src/BaseWindow.c b/widgets/src/BaseWindow.c
index 629bcfc1d0..669c046530 100644
--- a/widgets/src/BaseWindow.c
+++ b/widgets/src/BaseWindow.c
@@ -557,6 +557,20 @@ GtkWidget *anaconda_base_window_get_help_button(AnacondaBaseWindow *win) {
return win->priv->help_button;
}
+/**
+ * anaconda_base_window_get_layout_indicator_box:
+ * @win: a #AnacondaBaseWindow
+ *
+ * Returns the AnacondaLayoutIndicator.
+ *
+ * Returns: (transfer none): the layout indicator box
+ *
+ * Since: 3.4
+ */
+GtkWidget *anaconda_base_window_get_layout_indicator_box(AnacondaBaseWindow *win) {
+ return win->priv->layout_indicator;
+}
+
/**
* anaconda_base_window_get_nav_area_background_window:
* @win: a #AnacondaBaseWindow
diff --git a/widgets/src/BaseWindow.h b/widgets/src/BaseWindow.h
index f9db2537ee..43eef0811d 100644
--- a/widgets/src/BaseWindow.h
+++ b/widgets/src/BaseWindow.h
@@ -83,6 +83,7 @@ GtkWidget *anaconda_base_window_get_main_box (AnacondaBaseWindow *win);
GtkWidget *anaconda_base_window_get_nav_area (AnacondaBaseWindow *win);
GtkWidget *anaconda_base_window_get_nav_area_background_window (AnacondaBaseWindow *win);
GtkWidget *anaconda_base_window_get_help_button (AnacondaBaseWindow *win);
+GtkWidget *anaconda_base_window_get_layout_indicator_box (AnacondaBaseWindow *win);
G_END_DECLS
--
2.35.1

View file

@ -0,0 +1,131 @@
From 6b614bb89b5517daeed25904efc2558ab1f8c973 Mon Sep 17 00:00:00 2001
From: Jiri Konecny <jkonecny@redhat.com>
Date: Tue, 15 Feb 2022 21:48:47 +0100
Subject: [PATCH 6/6] Increase version of the anaconda-widgets
We changed the layout indicator related code so we need to increase version here.
Related: rhbz#2016613
(cherry picked from commit 488dffbe90a5a984a088b2e0c02ddc0f5972e8cf)
---
pyanaconda/ui/gui/__init__.py | 2 +-
pyanaconda/ui/gui/hubs/__init__.py | 2 +-
pyanaconda/ui/gui/spokes/lib/accordion.py | 2 +-
pyanaconda/ui/gui/spokes/storage.py | 2 +-
widgets/configure.ac | 2 +-
widgets/glade/AnacondaWidgets.xml | 4 ++--
widgets/src/Makefile.am | 14 +++++++-------
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index bcd70335ad..d458b66f14 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -24,7 +24,7 @@ from contextlib import contextmanager
import gi
gi.require_version("Gdk", "3.0")
gi.require_version("Gtk", "3.0")
-gi.require_version("AnacondaWidgets", "3.3")
+gi.require_version("AnacondaWidgets", "3.4")
gi.require_version("Keybinder", "3.0")
gi.require_version("GdkPixbuf", "2.0")
gi.require_version("GObject", "2.0")
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index f6f592f5d5..068d7c717d 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -115,7 +115,7 @@ class Hub(GUIObject, common.Hub):
import gi
gi.require_version("Gtk", "3.0")
- gi.require_version("AnacondaWidgets", "3.3")
+ gi.require_version("AnacondaWidgets", "3.4")
from gi.repository import Gtk, AnacondaWidgets
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index 5bd1ec3eba..3a75565225 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -24,7 +24,7 @@ from pyanaconda.core.storage import get_supported_autopart_choices
from pyanaconda.ui.gui.utils import escape_markup, really_hide, really_show
import gi
-gi.require_version("AnacondaWidgets", "3.3")
+gi.require_version("AnacondaWidgets", "3.4")
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk, AnacondaWidgets
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index fa8224c86a..f861dcba78 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -58,7 +58,7 @@ from pyanaconda.ui.gui.spokes.lib.storage_dialogs import NeedSpaceDialog, NoSpac
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("Gdk", "3.0")
-gi.require_version("AnacondaWidgets", "3.3")
+gi.require_version("AnacondaWidgets", "3.4")
from gi.repository import Gdk, AnacondaWidgets, Gtk
log = get_module_logger(__name__)
diff --git a/widgets/configure.ac b/widgets/configure.ac
index 56e712b189..ba666008a7 100644
--- a/widgets/configure.ac
+++ b/widgets/configure.ac
@@ -20,7 +20,7 @@
m4_define(python_required_version, 3.4)
AC_PREREQ([2.63])
-AC_INIT([AnacondaWidgets], [3.3], [clumens@redhat.com])
+AC_INIT([AnacondaWidgets], [3.4], [clumens@redhat.com])
# Disable building static libraries.
# This needs to be set before initializing automake
diff --git a/widgets/glade/AnacondaWidgets.xml b/widgets/glade/AnacondaWidgets.xml
index c797bb049b..f166052625 100644
--- a/widgets/glade/AnacondaWidgets.xml
+++ b/widgets/glade/AnacondaWidgets.xml
@@ -1,7 +1,7 @@
<glade-catalog
name="AnacondaWidgets"
- version="3.3"
- targetable="3.2,3.1,3.0,2.0,1.0"
+ version="3.4"
+ targetable="3.3,3.2,3.1,3.0,2.0,1.0"
library="AnacondaWidgets"
domain="glade-3"
depends="gtk+">
diff --git a/widgets/src/Makefile.am b/widgets/src/Makefile.am
index 75c37155c1..d5af7f7448 100644
--- a/widgets/src/Makefile.am
+++ b/widgets/src/Makefile.am
@@ -110,18 +110,18 @@ CLEANFILES = resources.c resources.h $(RESOURCE_XML)
MAINTAINERCLEANFILES = gettext.h
if HAVE_INTROSPECTION
-AnacondaWidgets-3.3.gir: libAnacondaWidgets.la
+AnacondaWidgets-3.4.gir: libAnacondaWidgets.la
-AnacondaWidgets_3_3_gir_FILES = $(GISOURCES) $(GIHDRS)
-AnacondaWidgets_3_3_gir_LIBS = libAnacondaWidgets.la
-AnacondaWidgets_3_3_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Anaconda --symbol-prefix=anaconda
-AnacondaWidgets_3_3_gir_INCLUDES = Gtk-3.0 Xkl-1.0
+AnacondaWidgets_3_4_gir_FILES = $(GISOURCES) $(GIHDRS)
+AnacondaWidgets_3_4_gir_LIBS = libAnacondaWidgets.la
+AnacondaWidgets_3_4_gir_SCANNERFLAGS = --warn-all --identifier-prefix=Anaconda --symbol-prefix=anaconda
+AnacondaWidgets_3_4_gir_INCLUDES = Gtk-3.0 Xkl-1.0
-INTROSPECTION_GIRS = AnacondaWidgets-3.3.gir
+INTROSPECTION_GIRS = AnacondaWidgets-3.4.gir
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-CLEANFILES += AnacondaWidgets-3.3.gir $(typelib_DATA)
+CLEANFILES += AnacondaWidgets-3.4.gir $(typelib_DATA)
MAINTAINERCLEANFILES += Makefile.in
endif
--
2.35.1

View file

@ -1,3 +1,3 @@
This repository is maintained by packit.
https://packit.dev/
The file was generated using packit 0.44.1.dev4+g5ec2bd1.
The file was generated using packit 0.48.1.dev7+g623077c.

View file

@ -1,7 +1,7 @@
Summary: Graphical system installer
Name: anaconda
Version: 36.16
Release: 1%{?dist}
Version: 36.16.5
Release: 2%{?dist}
License: GPLv2+ and MIT
URL: http://fedoraproject.org/wiki/Anaconda
@ -15,6 +15,10 @@ URL: http://fedoraproject.org/wiki/Anaconda
# make dist
Source0: https://github.com/rhinstaller/%{name}/releases/download/%{name}-%{version}-1/%{name}-%{version}.tar.bz2
# https://github.com/rhinstaller/anaconda/pull/4125
# Specify the GTK icon theme to use to make sure we get the right ones
Patch0: 0001-Specify-that-we-want-the-Adwaita-icon-theme.patch
# Versions of required components (done so we make sure the buildrequires
# match the requires versions of things).
@ -166,6 +170,7 @@ Requires: anaconda-webui = %{version}-%{release}
Requires: anaconda-gui = %{version}-%{release}
Requires: usermode
Requires: zenity
Requires: xisxwayland
Recommends: xhost
%description live
@ -176,6 +181,9 @@ for live installations.
Summary: Installation environment specific dependencies
Requires: udisks2-iscsi
Requires: libblockdev-plugins-all >= %{libblockdevver}
%if ! 0%{?rhel}
Requires: libblockdev-lvm-dbus
%endif
# active directory/freeipa join support
Requires: realmd
Requires: isomd5sum >= %{isomd5sumver}
@ -411,6 +419,7 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d
%{_datadir}/cockpit/anaconda-webui/index.css.gz
%{_datadir}/cockpit/anaconda-webui/manifest.json
%{_datadir}/metainfo/org.cockpit-project.anaconda-webui.metainfo.xml
%{_datadir}/cockpit/anaconda-webui/po.*.js.gz
%endif
@ -449,6 +458,71 @@ desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{buildroot}%{_d
%{_prefix}/libexec/anaconda/dd_*
%changelog
* Thu May 19 2022 Adam Williamson <awilliam@redhat.com> - 36.16.5-2
- Backport PR #4125 to fix icon theme problems on KDE
* Tue Apr 12 2022 Packit <hello@packit.dev> - 36.16.5-1
- Fix keyboard spoke issue if Live system changed keyboard layouts (#2072941) (jkonecny)
- Fix translations in DBus modules (#2071098) (vponcova)
- Add Release Notes for keyboard configuration split on Live (#2016613) (jkonecny)
* Thu Mar 31 2022 Packit <hello@packit.dev> - 36.16.4-1
- Enable fingerprint authentication using enable-feature (#2069899) (vponcova)
* Tue Mar 29 2022 Packit <hello@packit.dev> - 36.16.3-1
- Fix failing pylint check. (rvykydal)
- gui: update network spoke for symbolic icons (#2055883) (rvykydal)
- gui: update beta-nag dialog for symbolic icons (#2055883) (rvykydal)
- gui: update Quit dialog for symbolic icons (#2055883) (rvykydal)
- Increase version of the anaconda-widgets (jkonecny)
- Disable layout_indicator in Anaconda (jkonecny)
- Don't configure the keyboard in Live environments with XWayland (jkonecny)
- network: Handle network configuration paths not existing (awilliam)
- Change pylint ignore from number to name (vslavik)
- Remove RpmDb-related setup in OSTree payloads (vslavik)
- packit: build SRPM in Copr (ttomecek)
- Replace one more icon after removal from adwaita (#2055883) (jkonecny)
- Replace legacy adwaita icons removed in adwaita-icon-theme 42 (awilliam)
- Do not copy resolv.conf to target system at the end of installation (rvykydal)
- Do not copy /etc/resolv.conf to chroot before installation (rvykydal)
* Wed Mar 16 2022 Adam Williamson <awilliam@redhat.com> - 36.16.2-4
- Add xisxwayland dependency required for keyboard changes
* Tue Mar 15 2022 Martin Kolman <mkolman@redhat.com> - 36.16.2-3
- network: Handle network configuration paths not existing (adamw)
- Don't configure the keyboard in Live environments with XWayland (jkonecny)
- Disable layout_indicator in Anaconda (jkonecny)
- Increase version of the anaconda-widgets (jkonecny)
* Mon Feb 21 2022 Martin Kolman <mkolman@redhat.com> - 36.16.2-2
- Do not copy resolv.conf to target system at the end of installation (rvykydal)
- Do not copy /etc/resolv.conf to chroot before installation (rvykydal)
* Mon Feb 21 2022 Packit Service <user-cont-team+packit-service@redhat.com> - 36.16.2-1
- Do not modify boot order on UEFI if asked (vslavik)
- Remove RPM database cleanup (vslavik)
- Add all fields to PartSpec's string representation (vslavik)
- Add __repr__ to PartSpec (vslavik)
- Create /var subvolume on Fedora Kinoite and Silverblue (cmurf)
- Remove misleading warning about inst.ks.device replacing ksdevice (rvykydal)
* Wed Feb 16 2022 Packit Service <user-cont-team+packit-service@redhat.com> - 36.16.1-1
- Remove webui kernel boot argument support (jkonecny)
- Remove web UI from spec file on Fedora 36 (jkonecny)
- Remove npm dependencies from the containers (jkonecny)
- Remove webui code from the Fedora 36 (jkonecny)
- Restore contexts also in /usr/lib (vslavik)
- Reset the password if the root account is disabled (vponcova)
- Fix the status of the root configuration screen (vponcova)
- Fix the condition for entering the root configuration (vponcova)
- Move tests for pyanaconda.ui.lib.users to a new file (vponcova)
- Revert "Show correctly that no admin user is set up" (vponcova)
- Do not fail on nonexistent fs nodes in pstore (vslavik)
- Support Btrfs-only mount points in the default partitioning (vponcova)
- Adjust configuration options for Fedora 36 (mkolman)
- Adjust configuration options for Fedora 36 (mkolman)
* Wed Jan 26 2022 Packit Service <user-cont-team+packit-service@redhat.com> - 36.16-1
- packit: release: unset use_cockpit by sedding the specfile in packit script (kkoukiou)
- webui: parameterize ports for ssh, cockpit connection and http server (kkoukiou)

View file

@ -1 +1 @@
SHA512 (anaconda-36.16.tar.bz2) = d9c452d929ce2d8ff436cc3bfd5a342e45cb6a3e9741112d839eb094a3aa83ac18a0e0bd078e899233870c243957066d46c0dac095bf92f24a41c5d34d19c7ef
SHA512 (anaconda-36.16.5.tar.bz2) = 0aad7f859c641e0e767801aa0bbd2f19cac01e80813ce1d3012319e316a271bb4c60875957c3431f9681ddb28045f91d7010122e8f2c5c44d7d670737ae112ea