Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan M. Taylor <dylan@dylanmtaylor.com>2021-05-20 13:16:18 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-20 14:19:09 -0400
commitc39fc34eab0afd6b36802f97bb0df284f9308a48 (patch)
treea0a5d148f5e0375a2d28dcb3b03141a637cd1d57
parentcf3e47aa44dcd66b97b2943c2392cbcb311952e0 (diff)
Use temporary script files
Path will be different inside of target env.
-rw-r--r--examples/guided.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 960d4b38..a2f2036e 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -380,9 +380,11 @@ def perform_installation(mountpoint):
# If the user provided custom commands to be run post-installation, execute them now.
if len(archinstall.arguments['custom-commands']):
with Boot(installation) as session:
- for command in archinstall.arguments['custom-commands']:
+ for index, command in enumerate(archinstall.arguments['custom-commands']):
archinstall.log(f'Executing custom command "{command}" ...', fg='yellow')
- session.SysCommand(["bash", "-c"] + command.split(' '))
+ with open(f"/mnt/var/tmp/user-command.{index}.sh", "w") as temp_script:
+ temp_script.write(command)
+ session.SysCommand(["bash", f"/var/tmp/user-command.{index}.sh"])
installation.log("For post-installation tips, see https://wiki.archlinux.org/index.php/Installation_guide#Post-installation", fg="yellow")
if not archinstall.arguments.get('silent'):