From 74731a22619add6fde7114c27c7815073313ffad Mon Sep 17 00:00:00 2001 From: Martin Kolman Date: Mon, 27 May 2024 19:04:25 +0200 Subject: [PATCH] Adjust to freerdp and GNOME package changes Adjust HOME variable to fix credential storage with new freerdp and also adjust GNOME remote desktop options for updated package. Resolves: RHEL-38407 (cherry picked from commit 04d5bb7f5ebeba7fdbd2df67b2f5a57336b10502) --- pyanaconda/core/util.py | 4 ++-- pyanaconda/display.py | 9 ++------- pyanaconda/gnome_remote_destop.py | 4 ++-- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pyanaconda/core/util.py b/pyanaconda/core/util.py index 01f9e552f9b..8d2a6d543ab 100644 --- a/pyanaconda/core/util.py +++ b/pyanaconda/core/util.py @@ -354,7 +354,7 @@ def execWithRedirect(command, argv, stdin=None, stdout=None, root='/', env_prune log_output=log_output, binary_output=binary_output, do_preexec=do_preexec)[0] -def execWithCapture(command, argv, stdin=None, root='/', env_prune=None, +def execWithCapture(command, argv, stdin=None, root='/', env_prune=None, env_add=None, log_output=True, filter_stderr=False, do_preexec=True): """ Run an external program and capture standard out and err. @@ -370,7 +370,7 @@ def execWithCapture(command, argv, stdin=None, root='/', env_prune=None, argv = [command] + argv return _run_program(argv, stdin=stdin, root=root, log_output=log_output, env_prune=env_prune, - filter_stderr=filter_stderr, do_preexec=do_preexec)[1] + env_add=env_add, filter_stderr=filter_stderr, do_preexec=do_preexec)[1] def execWithCaptureAsLiveUser(command, argv, stdin=None, root='/', log_output=True, diff --git a/pyanaconda/display.py b/pyanaconda/display.py index 615e80fe00f..e2dbae75348 100644 --- a/pyanaconda/display.py +++ b/pyanaconda/display.py @@ -249,14 +249,9 @@ def wl_preexec(): "--wayland", "--no-x11", "--wayland-display", constants.WAYLAND_SOCKET_NAME]) - # remote access needs gnome-kiosk to start in headless mode & - # configure a virtual monitor + # remote access needs gnome-kiosk to start in headless mode if headless: - # check virtual monitor resolution has been set - if headless_resolution is None: - # use default value - headless_resolution = "1280x1024" - argv.extend(["--headless", "--virtual-monitor", headless_resolution]) + argv.extend(["--headless"]) childproc = util.startProgram(argv, env_add={'XDG_DATA_DIRS': xdg_data_dirs}, preexec_fn=wl_preexec) diff --git a/pyanaconda/gnome_remote_destop.py b/pyanaconda/gnome_remote_destop.py index 3813a1edd6a..1091178611c 100644 --- a/pyanaconda/gnome_remote_destop.py +++ b/pyanaconda/gnome_remote_destop.py @@ -167,7 +167,7 @@ def _run_grdctl(self, argv): # extend the base argv by the caller provided arguments combined_argv = base_argv + argv # make sure HOME is set to /root or else settings might not be saved - execWithCapture("grdctl", combined_argv, env_prune=['HOME']) + execWithCapture("grdctl", combined_argv, env_add={"HOME": "/root"}) def _open_grd_log_file(self): # FIXME: redirect to journal ? @@ -186,7 +186,7 @@ def _start_grd_process(self): global grd_process grd_process = startProgram([GRD_BINARY_PATH, "--headless"], stdout=self._open_grd_log_file(), - env_prune=['HOME']) + env_add={"HOME": "/root"}) self.log.info("GNOME remote desktop is now running.") except OSError: stdoutLog.critical("Could not start GNOME remote desktop. Aborting.")