Made waiting for reflector mandatory. Which should fix issue #47.

This commit is contained in:
Anton Hvornum 2020-09-01 15:38:23 +02:00
parent 4413fdcf81
commit 911d876cb6
1 changed files with 7 additions and 4 deletions

View File

@ -7,10 +7,13 @@ def perform_installation(device, boot_partition, language, mirrors):
formatted and setup prior to entering this function. formatted and setup prior to entering this function.
""" """
with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation: with archinstall.Installer(device, boot_partition=boot_partition, hostname=hostname) as installation:
if len(mirrors): ## if len(mirrors):
archinstall.log(f'Waiting for automatic mirror selection has completed before using custom mirrors.') # Certain services might be running that affects the system during installation.
while 'dead' not in (status := archinstall.service_state('reflector')): # Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
time.sleep(0.25) # We need to wait for it before we continue since we opted in to use a custom mirror/region.
archinstall.log(f'Waiting for automatic mirror selection has completed before using custom mirrors.')
while 'dead' not in (status := archinstall.service_state('reflector')):
time.sleep(1)
archinstall.use_mirrors(mirrors) # Set the mirrors for the live medium archinstall.use_mirrors(mirrors) # Set the mirrors for the live medium
if installation.minimal_installation(): if installation.minimal_installation():