Switch back to arch-chroot

This reverts commit 27fa511914.
This commit is contained in:
Dylan Taylor 2021-05-20 14:59:06 -04:00
parent c39fc34eab
commit 7811e01a90
1 changed files with 6 additions and 7 deletions

View File

@ -4,10 +4,10 @@ import os
import time import time
import archinstall import archinstall
from archinstall.lib.general import SysCommand
from archinstall.lib.hardware import has_uefi from archinstall.lib.hardware import has_uefi
from archinstall.lib.networking import check_mirror_reachable from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profiles import Profile from archinstall.lib.profiles import Profile
from archinstall.lib.systemd import Boot
if archinstall.arguments.get('help'): if archinstall.arguments.get('help'):
print("See `man archinstall` for help.") print("See `man archinstall` for help.")
@ -379,12 +379,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: for index, command in enumerate(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') with open(f"/mnt/var/tmp/user-command.{index}.sh", "w") as temp_script:
with open(f"/mnt/var/tmp/user-command.{index}.sh", "w") as temp_script: temp_script.write(command)
temp_script.write(command) SysCommand(f"arch-chroot /mnt bash /var/tmp/user-command.{index}.sh")
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'):