index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-05-21 09:29:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-21 09:29:04 +0200 |
commit | 60cdb2ab8725a9001768473d90bfd189ada577f9 (patch) | |
tree | c2054f41030325e5cf1f2e609e030ae91fe19d55 /archinstall/lib | |
parent | 9bb940a8f58bb5522ca4bbcfd378550079c520ac (diff) | |
parent | 7fefd55a0c716ef93f621d54d20f8d834cbc87ef (diff) |
-rw-r--r-- | archinstall/lib/general.py | 10 |
diff --git a/archinstall/lib/general.py b/archinstall/lib/general.py index 81793cb8..249c7890 100644 --- a/archinstall/lib/general.py +++ b/archinstall/lib/general.py @@ -366,3 +366,13 @@ def pid_exists(pid: int): return any(subprocess.check_output(['/usr/bin/ps', '--no-headers', '-o', 'pid', '-p', str(pid)]).strip()) except subprocess.CalledProcessError: return False + + +def run_custom_user_commands(commands, installation): + for index, command in enumerate(commands): + log(f'Executing custom command "{command}" ...', fg='yellow') + with open(f"{installation.target}/var/tmp/user-command.{index}.sh", "w") as temp_script: + temp_script.write(command) + execution_output = SysCommand(f"arch-chroot {installation.target} bash /var/tmp/user-command.{index}.sh") + log(execution_output) + os.unlink(f"{installation.target}/var/tmp/user-command.{index}.sh") |