index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-11-09 17:43:28 +0100 |
---|---|---|
committer | Anton Hvornum <anton@hvornum.se> | 2021-11-09 17:43:28 +0100 |
commit | 389aa1080b99b4b0a52a3940e9a344027b5cb9b6 (patch) | |
tree | 180b29983c3802f42b630f234db9917542df4385 /examples/guided.py | |
parent | d1716eeeef00d6a8e01a2c3bf5e1de831f50128c (diff) |
-rw-r--r-- | examples/guided.py | 21 |
diff --git a/examples/guided.py b/examples/guided.py index b1c34464..a1f30f76 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -138,11 +138,11 @@ def ask_user_questions(): archinstall.arguments['!root-password'] = archinstall.get_password(prompt='Enter root password (leave blank to disable disabled & create superuser): ') # Ask for additional users (super-user if root pw was not set) - if not archinstall.arguments.get('!root-password', None) and not archinstall.arguments.get('superusers', None): - archinstall.arguments['superusers'] = archinstall.ask_for_superuser_account('Create a required super-user with sudo privileges: ', forced=True) + if not archinstall.arguments.get('!root-password', None) and not archinstall.arguments.get('!superusers', None): + archinstall.arguments['!superusers'] = archinstall.ask_for_superuser_account('Create a required super-user with sudo privileges: ', forced=True) users, superusers = archinstall.ask_for_additional_users('Enter a username to create an additional user (leave blank to skip & continue): ') - archinstall.arguments['users'] = users - archinstall.arguments['superusers'] = {**archinstall.arguments['superusers'], **superusers} + archinstall.arguments['!users'] = users + archinstall.arguments['!superusers'] = {**archinstall.arguments['!superusers'], **superusers} # Ask for archinstall-specific profiles (such as desktop environments etc) if not archinstall.arguments.get('profile', None): @@ -243,6 +243,15 @@ def perform_filesystem_operations(): fs.load_layout(archinstall.storage['disk_layouts'][drive.path]) def perform_installation(mountpoint): + user_credentials = json.dumps({ + "!users" : archinstall.arguments['!users'], + "!superusers" : archinstall.arguments['!users'], + "!root-password" : archinstall.arguments['!users'], + }, indent=4, sort_keys=True, cls=archinstall.UNSAFE_JSON) + + with open("/var/log/archinstall/user_credentials.json", "w") as config_file: + config_file.write(user_credentials) + """ Performs the installation steps on a block device. Only requirement is that the block devices are @@ -305,10 +314,10 @@ def perform_installation(mountpoint): if archinstall.arguments.get('profile', None): installation.install_profile(archinstall.arguments.get('profile', None)) - for user, user_info in archinstall.arguments.get('users', {}).items(): + for user, user_info in archinstall.arguments.get('!users', {}).items(): installation.user_create(user, user_info["!password"], sudo=False) - for superuser, user_info in archinstall.arguments.get('superusers', {}).items(): + for superuser, user_info in archinstall.arguments.get('!superusers', {}).items(): installation.user_create(superuser, user_info["!password"], sudo=True) if timezone := archinstall.arguments.get('timezone', None): |