From c09a36b7b166cc5cf74e5c25e8c9b200f4f2088a Mon Sep 17 00:00:00 2001 From: Anton Hvornum Date: Wed, 15 Sep 2021 13:33:34 +0000 Subject: Changed from internal storage to parameter-friendly arguments for disk_layouts, so we can support JSON for disk layouts on the new logic. --- examples/guided.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/guided.py b/examples/guided.py index 3dd30875..7574f39f 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -102,7 +102,7 @@ def ask_user_questions(): allow_empty=True) if archinstall.arguments.get('harddrives', None): - archinstall.storage['disk_layouts'] = archinstall.select_disk_layout(archinstall.arguments['harddrives']) + archinstall.arguments['disk_layouts'] = archinstall.select_disk_layout(archinstall.arguments['harddrives']) # Get disk encryption password (or skip if blank) if archinstall.arguments['harddrives'] and archinstall.arguments.get('!encryption-password', None) is None: @@ -112,8 +112,8 @@ def ask_user_questions(): if archinstall.arguments['harddrives'] and archinstall.arguments.get('!encryption-password', None): # If no partitions was marked as encrypted, but a password was supplied and we have some disks to format.. # Then we need to identify which partitions to encrypt. This will default to / (root). - if len(list(archinstall.encrypted_partitions(archinstall.storage['disk_layouts']))) == 0: - archinstall.storage['disk_layouts'] = archinstall.select_encrypted_partitions(archinstall.storage['disk_layouts'], archinstall.arguments['!encryption-password']) + if len(list(archinstall.encrypted_partitions(archinstall.arguments['disk_layouts']))) == 0: + archinstall.arguments['disk_layouts'] = archinstall.select_encrypted_partitions(archinstall.arguments['disk_layouts'], archinstall.arguments['!encryption-password']) # Ask which boot-loader to use (will only ask if we're in BIOS (non-efi) mode) if not archinstall.arguments.get("bootloader", None): @@ -207,7 +207,7 @@ def perform_filesystem_operations(): archinstall.log(user_configuration, level=logging.INFO) with open("/var/log/archinstall/user_configuration.json", "w") as config_file: config_file.write(user_configuration) - user_disk_layout = json.dumps(archinstall.storage['disk_layouts'], indent=4, sort_keys=True, cls=archinstall.JSON) + user_disk_layout = json.dumps(archinstall.arguments['disk_layouts'], indent=4, sort_keys=True, cls=archinstall.JSON) archinstall.log(user_disk_layout, level=logging.INFO) with open("/var/log/archinstall/user_disk_layout.json", "w") as disk_layout_file: disk_layout_file.write(user_disk_layout) @@ -238,7 +238,7 @@ def perform_filesystem_operations(): for drive in archinstall.arguments['harddrives']: with archinstall.Filesystem(drive, mode) as fs: - fs.load_layout(archinstall.storage['disk_layouts'][drive]) + fs.load_layout(archinstall.arguments['disk_layouts'][drive]) def perform_installation(mountpoint): @@ -250,7 +250,7 @@ def perform_installation(mountpoint): with archinstall.Installer(mountpoint, kernels=archinstall.arguments.get('kernels', 'linux')) as installation: # Mount all the drives to the desired mountpoint # This *can* be done outside of the installation, but the installer can deal with it. - installation.mount_ordered_layout(archinstall.storage['disk_layouts']) + installation.mount_ordered_layout(archinstall.arguments['disk_layouts']) # if len(mirrors): # Certain services might be running that affects the system during installation. -- cgit v1.2.3-54-g00ecf