Added more services that we need to wait for. (#1647)

* Added more services that we need to wait for.

* Fixed small issue with previous commit not checking if disk_encryption is None or not.
This commit is contained in:
Anton Hvornum 2023-02-27 09:43:26 +01:00 committed by GitHub
parent ea029ed3f9
commit 50d20f0b80
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 8 deletions

View File

@ -146,14 +146,6 @@ def perform_installation(mountpoint):
if partition.size < 0.19: # ~200 MiB in GiB if partition.size < 0.19: # ~200 MiB in GiB
raise archinstall.DiskError(f"The selected /boot partition in use is not large enough to properly install a boot loader. Please resize it to at least 200MiB and re-run the installation.") raise archinstall.DiskError(f"The selected /boot partition in use is not large enough to properly install a boot loader. Please resize it to at least 200MiB and re-run the installation.")
# if len(mirrors):
# Certain services might be running that affects the system during installation.
# Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
# We need to wait for it before we continue since we opted in to use a custom mirror/region.
installation.log('Waiting for automatic mirror selection (reflector) to complete.', level=logging.INFO)
while archinstall.service_state('reflector') not in ('dead', 'failed'):
time.sleep(1)
# If we've activated NTP, make sure it's active in the ISO too and # If we've activated NTP, make sure it's active in the ISO too and
# make sure at least one time-sync finishes before we continue with the installation # make sure at least one time-sync finishes before we continue with the installation
if archinstall.arguments.get('ntp', False): if archinstall.arguments.get('ntp', False):
@ -176,6 +168,22 @@ def perform_installation(mountpoint):
logged = True logged = True
time.sleep(1) time.sleep(1)
# if len(mirrors):
# Certain services might be running that affects the system during installation.
# Currently, only one such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
# We need to wait for it before we continue since we opted in to use a custom mirror/region.
installation.log('Waiting for automatic mirror selection (reflector) to complete.', level=logging.INFO)
while archinstall.service_state('reflector') not in ('dead', 'failed'):
time.sleep(1)
installation.log('Waiting pacman-init.service to complete.', level=logging.INFO)
while archinstall.service_state('pacman-init') not in ('dead', 'failed'):
time.sleep(1)
installation.log('Waiting Arch Linux keyring sync (archlinux-keyring-wkd-sync) to complete.', level=logging.INFO)
while archinstall.service_state('archlinux-keyring-wkd-sync') not in ('dead', 'failed'):
time.sleep(1)
# Set mirrors used by pacstrap (outside of installation) # Set mirrors used by pacstrap (outside of installation)
if archinstall.arguments.get('mirror-region', None): if archinstall.arguments.get('mirror-region', None):
archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium archinstall.use_mirrors(archinstall.arguments['mirror-region']) # Set the mirrors for the live medium