index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton@hvornum.se> | 2021-09-06 16:42:31 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-06 16:42:31 +0200 |
commit | e39e49ecc73c327fbb2161a080a7f9b4eacafb21 (patch) | |
tree | 3ba3d199d010f8f87793b6bd37a459782ad318a7 /archinstall/lib/installer.py | |
parent | 4505c3a11ff8a6bda21fc0d86a621b0cb86ee498 (diff) | |
parent | e10daf4c57b0aa6a8ce4677fc9375b6e8fbc84d0 (diff) |
-rw-r--r-- | archinstall/lib/installer.py | 25 |
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 25b5331a..3efb0499 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -57,7 +57,6 @@ class Installer: self.post_base_install = [] storage['session'] = self - self.partitions = get_partitions_in_use(self.target) self.MODULES = [] self.BINARIES = [] @@ -108,6 +107,10 @@ class Installer: self.sync_log_to_install_medium() return False + @property + def partitions(self): + return get_partitions_in_use(self.target) + def sync_log_to_install_medium(self): # Copy over the install log (if there is one) to the install medium if # at least the base has been strapped in, otherwise we won't have a filesystem/structure to copy to. @@ -122,6 +125,23 @@ class Installer: return True + def mount_ordered_layout(self, layouts :dict): + from .luks import luks2 + + mountpoints = {} + for blockdevice in layouts: + for partition in layouts[blockdevice]['partitions']: + mountpoints[partition['mountpoint']] = partition + + for mountpoint in sorted(mountpoints.keys()): + if mountpoints[mountpoint]['encrypted']: + loopdev = storage.get('ENC_IDENTIFIER', 'ai')+'loop' + password = mountpoints[mountpoint]['password'] + with luks2(mountpoints[mountpoint]['device_instance'], loopdev, password, auto_unmount=False) as unlocked_device: + unlocked_device.mount(f"{self.target}{mountpoint}") + else: + mountpoints[mountpoint]['device_instance'].mount(f"{self.target}{mountpoint}") + def mount(self, partition, mountpoint, create_mountpoint=True): if create_mountpoint and not os.path.isdir(f'{self.target}{mountpoint}'): os.makedirs(f'{self.target}{mountpoint}') @@ -425,6 +445,9 @@ class Installer: elif partition.mountpoint == self.target: root_partition = partition + if boot_partition is None and root_partition is None: + raise ValueError(f"Could not detect root (/) or boot (/boot) in {self.target} based on: {self.partitions}") + self.log(f'Adding bootloader {bootloader} to {boot_partition if boot_partition else root_partition}', level=logging.INFO) if bootloader == 'systemd-bootctl': |