MCPcopy Index your code
hub / github.com/archlinux/archinstall / perform_installation

Function perform_installation

examples/only_hd_installation.py:30–62  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

28
29
30def 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
65def main(arch_config_handler: ArchConfigHandler | None = None) -> None:

Callers 1

mainFunction · 0.70

Calls 6

errorFunction · 0.90
InstallerClass · 0.90
debugFunction · 0.90
disk_layoutsFunction · 0.90
mount_ordered_layoutMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected