Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/guided.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds@gmail.com>2021-03-09 16:13:21 +0100
committerAnton Hvornum <anton.feeds@gmail.com>2021-03-09 16:13:21 +0100
commit2bd220c28016ca46b5e44235c08f384ea1e8f44f (patch)
treeab49fb523fe97ef43f28593ff5b7bce8e62e7884 /examples/guided.py
parentaafe3d19c67eb32ab8559021cc1ab984ca48b5ee (diff)
Moved everything into a function block rather than having everything on a line by line situation. This just helps separate what the two major components/blocks are of the guided profile. The change was done in the previous commit, but a spelling mistake was made here and I forgot to mention it in the already long commit log. But user-questions is now in one function. Installation steps are now in a two-tier function, one for setup and one for install steps.
Diffstat (limited to 'examples/guided.py')
-rw-r--r--examples/guided.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/examples/guided.py b/examples/guided.py
index 28d07d0f..9d242842 100644
--- a/examples/guided.py
+++ b/examples/guided.py
@@ -60,15 +60,21 @@ def perform_installation(device, boot_partition, language, mirrors):
installation.install_profile(profile)
if archinstall.arguments.get('users', None):
- for user, password in archinstall.arguments.get('users').items():
+ for user in archinstall.arguments.get('users'):
+ password = users[user]
installation.user_create(user, password, sudo=False)
-
if archinstall.arguments.get('superusers', None):
- for user, password in archinstall.arguments.get('superusers').items():
- installation.user_create(user, password, sudo=True)
+ for user in archinstall.arguments.get('users'):
+ password = users[user]
+ installation.user_create(user, password, sudo=Tru)
+
+ # sudo = False
+ # if 'root_pw' not in archinstall.storage['_guided_hidden'] or len(archinstall.storage['_guided_hidden']['root_pw'].strip()) == 0:
+ # sudo = True
+
- if (root_pw := archinstall.arguments.get('!root-password', None)) and len(root_pw):
- installation.user_set_pw('root', root_pw)
+ if 'root_pw' in archinstall.storage['_guided_hidden'] and archinstall.storage['_guided_hidden']['root_pw']:
+ installation.user_set_pw('root', archinstall.storage['_guided_hidden']['root_pw'])
def ask_user_questions():
"""
@@ -322,4 +328,4 @@ def perform_installation_steps():
mirrors=archinstall.arguments['mirror-region'])
ask_user_questions()
-perform_pre_installation_steps() \ No newline at end of file
+perform_installation_steps() \ No newline at end of file