Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/examples/swiss.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/swiss.py')
-rw-r--r--examples/swiss.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/examples/swiss.py b/examples/swiss.py
index 2f7d90c4..d0f02dc1 100644
--- a/examples/swiss.py
+++ b/examples/swiss.py
@@ -219,7 +219,7 @@ class MyMenu(archinstall.GlobalMenu):
if self._execution_mode in ('full','lineal'):
options_list = ['keyboard-layout', 'mirror-region', 'harddrives', 'disk_layouts',
'!encryption-password','swap', 'bootloader', 'hostname', '!root-password',
- '!superusers', '!users', 'profile', 'audio', 'kernels', 'packages','additional-repositories','nic',
+ '!users', 'profile', 'audio', 'kernels', 'packages','additional-repositories','nic',
'timezone', 'ntp']
if archinstall.arguments.get('advanced',False):
options_list.extend(['sys-language','sys-encoding'])
@@ -229,7 +229,7 @@ class MyMenu(archinstall.GlobalMenu):
mandatory_list = ['harddrives']
elif self._execution_mode == 'only_os':
options_list = ['keyboard-layout', 'mirror-region','bootloader', 'hostname',
- '!root-password', '!superusers', '!users', 'profile', 'audio', 'kernels',
+ '!root-password', '!users', 'profile', 'audio', 'kernels',
'packages', 'additional-repositories', 'nic', 'timezone', 'ntp']
mandatory_list = ['hostname']
if archinstall.arguments.get('advanced',False):
@@ -262,8 +262,12 @@ class MyMenu(archinstall.GlobalMenu):
def check(s):
return self.option(s).has_selection()
+ def has_superuser() -> bool:
+ users = self._menu_options['!users'].current_selection
+ return any([u.sudo for u in users])
+
_, missing = self.mandatory_overview()
- if mode in ('full','only_os') and (not check('!root-password') and not check('!superusers')):
+ if mode in ('full','only_os') and (not check('!root-password') and not has_superuser()):
missing += 1
if mode in ('full', 'only_hd') and check('harddrives'):
if not self.option('harddrives').is_empty() and not check('disk_layouts'):
@@ -420,13 +424,8 @@ def os_setup(installation):
if archinstall.arguments.get('profile', None):
installation.install_profile(archinstall.arguments.get('profile', None))
- if archinstall.arguments.get('!users',{}):
- for user, user_info in archinstall.arguments.get('!users', {}).items():
- installation.user_create(user, user_info["!password"], sudo=False)
-
- if archinstall.arguments.get('!superusers',{}):
- for superuser, user_info in archinstall.arguments.get('!superusers', {}).items():
- installation.user_create(superuser, user_info["!password"], sudo=True)
+ if users := archinstall.arguments.get('!users', None):
+ installation.create_users(users)
if timezone := archinstall.arguments.get('timezone', None):
installation.set_timezone(timezone)