index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds@gmail.com> | 2021-04-17 09:52:09 +0200 |
---|---|---|
committer | Anton Hvornum <anton.feeds@gmail.com> | 2021-04-17 09:52:09 +0200 |
commit | 5fba277dda00c32ed7cecd6c497c0ced922598e6 (patch) | |
tree | 04433f76cda1519d94044bdec46a5cb54c709d5c /archinstall/lib/general.py | |
parent | e5b0468384ba70398b91c5418399b0118ece0bc5 (diff) | |
parent | 407290b03483ebed95e5f02c6b60024bd331ba1d (diff) |
-rw-r--r-- | archinstall/lib/general.py | 10 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 5b1b3c2a..dc0f018a 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -76,7 +76,7 @@ class sys_command():#Thread): """ Stolen from archinstall_gui """ - def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, *args, **kwargs): + def __init__(self, cmd, callback=None, start_callback=None, peak_output=False, environment_vars={}, *args, **kwargs): kwargs.setdefault("worker_id", gen_uid()) kwargs.setdefault("emulate", False) kwargs.setdefault("suppress_errors", False) @@ -102,6 +102,7 @@ class sys_command():#Thread): self.args = args self.kwargs = kwargs self.peak_output = peak_output + self.environment_vars = environment_vars self.kwargs.setdefault("worker", None) self.callback = callback @@ -200,7 +201,7 @@ class sys_command():#Thread): # Replace child process with our main process if not self.kwargs['emulate']: try: - os.execv(self.cmd[0], self.cmd) + os.execve(self.cmd[0], self.cmd, {**os.environ, **self.environment_vars}) except FileNotFoundError: self.status = 'done' self.log(f"{self.cmd[0]} does not exist.", level=LOG_LEVELS.Debug) @@ -304,6 +305,11 @@ class sys_command():#Thread): with open(f'{self.cwd}/trace.log', 'wb') as fh: fh.write(self.trace_log) + try: + os.close(child_fd) + except: + pass + def prerequisite_check(): if not os.path.isdir("/sys/firmware/efi"): |