Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Taylor <dylan@dylanmtaylor.com>2021-05-19 21:30:06 -0400
committerDylan Taylor <dylan@dylanmtaylor.com>2021-05-19 22:43:27 -0400
commit27fa5119145ffdc50b7aff400315dc7a82a8cc29 (patch)
treea2d9e61fd574f413c649acd7388a2320857ebd01
parentc03da01412ace204d86a57aa817b43159a699b80 (diff)
Try to use the new systemd-nspawn code paths
-rw-r--r--examples/guided.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 65f4c9d9..77f1f4f1 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -4,10 +4,10 @@ import os
import time
import archinstall
-from archinstall.lib.general import SysCommand
from archinstall.lib.hardware import has_uefi
from archinstall.lib.networking import check_mirror_reachable
from archinstall.lib.profiles import Profile
+from archinstall.lib.systemd import Boot
if archinstall.arguments.get('help'):
print("See `man archinstall` for help.")
@@ -187,10 +187,7 @@ def ask_user_questions():
if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_prep_function():
with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
if not imported._prep_function():
- archinstall.log(
- ' * Profile\'s preparation requirements was not fulfilled.',
- fg='red'
- )
+ archinstall.log(' * Profile\'s preparation requirements was not fulfilled.', fg='red')
exit(1)
# Ask about audio server selection if one is not already set
@@ -381,13 +378,13 @@ def perform_installation(mountpoint):
if not imported._post_install():
archinstall.log(' * Profile\'s post configuration requirements was not fulfilled.', fg='red')
exit(1)
-
+
# If the user provided custom commands to be run post-installation, execute them now.
if len(archinstall.arguments['custom-commands']):
- for command in archinstall.arguments['custom-commands']:
- archinstall.log(f'Executing custom command "{command}" ...', fg='yellow')
- SysCommand(f"arch-chroot /mnt bash -c '{command}'")
-
+ with Boot(archinstall) as session:
+ for command in archinstall.arguments['custom-commands']:
+ archinstall.log(f'Executing custom command "{command}" ...', fg='yellow')
+ session.SysCommand(["bash", "-c"] + command.split(' '))
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'):