Skip to content

Commit

Permalink
Adjust to freerdp and GNOME package changes
Browse files Browse the repository at this point in the history
Adjust HOME variable to fix credential storage with new freerdp and also
adjust GNOME remote desktop options for updated package.

Resolves: RHEL-38407
  • Loading branch information
M4rtinK committed Jun 7, 2024
1 parent 0a042ff commit fc232b2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions pyanaconda/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down
9 changes: 2 additions & 7 deletions pyanaconda/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,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)
Expand Down
4 changes: 2 additions & 2 deletions pyanaconda/gnome_remote_destop.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,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 ?
Expand All @@ -187,7 +187,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.")
Expand Down

0 comments on commit fc232b2

Please sign in to comment.