Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoradvaithm <advaith.madhukar@gmail.com>2021-04-06 07:21:11 +0530
committeradvaithm <advaith.madhukar@gmail.com>2021-04-06 07:21:11 +0530
commitf0e40f56765156aff22cb270b28aa15c5547534f (patch)
tree60df3796db57fd3fee53fac779165fd706a664b4 /examples
parentb56f7d0515d7dc3b31f2c255c20bc514df9155b1 (diff)
added _post_install hook.
Diffstat (limited to 'examples')
-rw-r--r--examples/guided.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 032a1f39..3f11b7a8 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -1,4 +1,4 @@
-import getpass, time, json, sys, signal, os, subprocess
+import getpass, time, json, sys, signal, os
import archinstall
from archinstall.lib.hardware import hasUEFI
@@ -344,9 +344,15 @@ def perform_installation(device, boot_partition, language, mirrors):
if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
installation.user_set_pw('root', root_pw)
- if archinstall.arguments.get('profile', None) == "i3-wm" or archinstall.arguments.get('profile', None) == "i3-gaps":
- print("the installation of i3/i3-gaps does not conatain any configuerations for the wm. in this shell you should add your configuerations")
- subprocess.check_call("arch-chroot /mnt",shell=True)
+ if archinstall.arguments['profile'] and archinstall.arguments['profile'].has_post_install():
+ with archinstall.arguments['profile'].load_instructions(namespace=f"{archinstall.arguments['profile'].namespace}.py") as imported:
+ if not imported._post_install():
+ archinstall.log(
+ ' * Profile\'s preparation requirements was not fulfilled.',
+ bg='black',
+ fg='red'
+ )
+ exit(1)
ask_user_questions()
perform_installation_steps()