Use temporary script files
Path will be different inside of target env.
This commit is contained in:
parent
cf3e47aa44
commit
c39fc34eab
|
|
@ -380,9 +380,11 @@ def perform_installation(mountpoint):
|
||||||
# If the user provided custom commands to be run post-installation, execute them now.
|
# If the user provided custom commands to be run post-installation, execute them now.
|
||||||
if len(archinstall.arguments['custom-commands']):
|
if len(archinstall.arguments['custom-commands']):
|
||||||
with Boot(installation) as session:
|
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')
|
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")
|
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'):
|
if not archinstall.arguments.get('silent'):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue