Performs the installation steps on a block device. Only requirement is that the block devices are formatted and setup prior to entering this function.
(arch_config_handler: ArchConfigHandler)
| 28 | |
| 29 | |
| 30 | def perform_installation(arch_config_handler: ArchConfigHandler) -> None: |
| 31 | """ |
| 32 | Performs the installation steps on a block device. |
| 33 | Only requirement is that the block devices are |
| 34 | formatted and setup prior to entering this function. |
| 35 | """ |
| 36 | mountpoint = arch_config_handler.args.mountpoint |
| 37 | config = arch_config_handler.config |
| 38 | |
| 39 | if not config.disk_config: |
| 40 | error('No disk configuration provided') |
| 41 | return |
| 42 | |
| 43 | disk_config = config.disk_config |
| 44 | mountpoint = disk_config.mountpoint if disk_config.mountpoint else mountpoint |
| 45 | |
| 46 | with Installer( |
| 47 | mountpoint, |
| 48 | disk_config, |
| 49 | kernels=config.kernels, |
| 50 | silent=arch_config_handler.args.silent, |
| 51 | ) as installation: |
| 52 | # Mount all the drives to the desired mountpoint |
| 53 | # This *can* be done outside of the installation, but the installer can deal with it. |
| 54 | installation.mount_ordered_layout() |
| 55 | |
| 56 | # to generate a fstab directory holder. Avoids an error on exit and at the same time checks the procedure |
| 57 | target = Path(f'{mountpoint}/etc/fstab') |
| 58 | if not target.parent.exists(): |
| 59 | target.parent.mkdir(parents=True) |
| 60 | |
| 61 | # For support reasons, we'll log the disk layout post installation (crash or no crash) |
| 62 | debug(f'Disk states after installing:\n{disk_layouts()}') |
| 63 | |
| 64 | |
| 65 | def main(arch_config_handler: ArchConfigHandler | None = None) -> None: |
no test coverage detected