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

Function perform_installation

examples/interactive_installation.py:52–201  ·  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,
	mirror_list_handler: MirrorListHandler,
	auth_handler: AuthenticationHandler,
	application_handler: ApplicationHandler,
)

Source from the content-addressed store, hash-verified

50
51
52def perform_installation(
53 arch_config_handler: ArchConfigHandler,
54 mirror_list_handler: MirrorListHandler,
55 auth_handler: AuthenticationHandler,
56 application_handler: ApplicationHandler,
57) -> None:
58 """
59 Performs the installation steps on a block device.
60 Only requirement is that the block devices are
61 formatted and setup prior to entering this function.
62 """
63 start_time = time.monotonic()
64 info('Starting installation...')
65
66 mountpoint = arch_config_handler.args.mountpoint
67 config = arch_config_handler.config
68
69 if not config.disk_config:
70 error('No disk configuration provided')
71 return
72
73 disk_config = config.disk_config
74 run_mkinitcpio = not config.bootloader_config or not config.bootloader_config.uki
75 locale_config = config.locale_config
76 optional_repositories = config.mirror_config.optional_repositories if config.mirror_config else []
77 mountpoint = disk_config.mountpoint if disk_config.mountpoint else mountpoint
78
79 with Installer(
80 mountpoint,
81 disk_config,
82 kernels=config.kernels,
83 silent=arch_config_handler.args.silent,
84 ) as installation:
85 # Mount all the drives to the desired mountpoint
86 if disk_config.config_type != DiskLayoutType.Pre_mount:
87 installation.mount_ordered_layout()
88
89 installation.sanity_check(
90 arch_config_handler.args.offline,
91 arch_config_handler.args.skip_ntp,
92 arch_config_handler.args.skip_wkd,
93 )
94
95 if disk_config.config_type != DiskLayoutType.Pre_mount:
96 if disk_config.disk_encryption and disk_config.disk_encryption.encryption_type != EncryptionType.NO_ENCRYPTION:
97 # generate encryption key files for the mounted luks devices
98 installation.generate_key_files()
99
100 if mirror_config := config.mirror_config:
101 installation.set_mirrors(mirror_list_handler, mirror_config, on_target=False)
102
103 installation.minimal_installation(
104 optional_repositories=optional_repositories,
105 mkinitcpio=run_mkinitcpio,
106 hostname=arch_config_handler.config.hostname,
107 locale_config=locale_config,
108 pacman_config=config.pacman_config,
109 )

Callers 1

mainFunction · 0.70

Calls 15

infoFunction · 0.90
errorFunction · 0.90
InstallerClass · 0.90
install_network_configFunction · 0.90
UserClass · 0.90
run_custom_user_commandsFunction · 0.90
debugFunction · 0.90
disk_layoutsFunction · 0.90
select_post_installationFunction · 0.90
mount_ordered_layoutMethod · 0.80
sanity_checkMethod · 0.80

Tested by

no test coverage detected