Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/unattended.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-08-20 19:47:39 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-08-20 19:47:39 +0000
commitf6f5875892e4ec6978323026b5f7819ddce1bb83 (patch)
treeb71535281671592f7966ab0f24812a9bc34558b4 /examples/unattended.py
parent056b800c8eb42c4112dce54bd1a7336d52ead2ab (diff)
Added a unattended installer. Fixed list_profiles() to not include .py ending in the profile name, it's already in the ['path'] defintion. Renamed desktop.py to awesome.py as it more accurately describes what's being installed. desktop should be reserved to a default desktop environment that's more new-user-friendly.
Diffstat (limited to 'examples/unattended.py')
-rw-r--r--examples/unattended.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/examples/unattended.py b/examples/unattended.py
index 7dfa58c1..b0ef0b7b 100644
--- a/examples/unattended.py
+++ b/examples/unattended.py
@@ -1,6 +1,17 @@
import archinstall
+import time
-for profile in archinstall.list_profiles():
- # Tailored means it's a match for this machine.
- if profile['tailored']:
- print('Selecting profile to be installed:', profile) \ No newline at end of file
+for name, info in archinstall.list_profiles().items():
+ # Tailored means it's a match for this machine
+ # based on it's MAC address (or some other criteria
+ # that fits the requirements for this machine specifically).
+ if info['tailored']:
+ print(f'Found a tailored profile for this machine called: "{name}".')
+ print(f'Starting install in:')
+ for i in range(10, 0, -1):
+ print(f'{i}...')
+ time.sleep(1)
+
+ profile = archinstall.Profile(None, info['path'])
+ profile.install()
+ break \ No newline at end of file