Skip to content

Commit 2ea4985

Browse files
committed
Remove arch_config_handler from installer
1 parent bd35473 commit 2ea4985

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

archinstall/lib/installer.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
from archinstall.lib.packages.packages import installed_package
4343
from archinstall.lib.translationhandler import tr
4444

45-
from .args import arch_config_handler
4645
from .boot import Boot
4746
from .command import SysCommand, run
4847
from .exceptions import DiskError, HardwareIncompatibilityError, RequirementError, ServiceException, SysCallError
@@ -74,6 +73,7 @@ def __init__(
7473
disk_config: DiskLayoutConfiguration,
7574
base_packages: list[str] = [],
7675
kernels: list[str] | None = None,
76+
silent: bool = False,
7777
):
7878
"""
7979
`Installer()` is the wrapper for most basic installation steps.
@@ -126,7 +126,7 @@ def __init__(
126126
self._zram_enabled = False
127127
self._disable_fstrim = False
128128

129-
self.pacman = Pacman(self.target, arch_config_handler.args.silent)
129+
self.pacman = Pacman(self.target, silent)
130130

131131
def __enter__(self) -> Self:
132132
return self
@@ -176,14 +176,14 @@ def append_mod(self, mod: str) -> None:
176176
if mod not in self._modules:
177177
self._modules.append(mod)
178178

179-
def _verify_service_stop(self) -> None:
179+
def _verify_service_stop(self, offline: bool, skip_ntp: bool, skip_wkd: bool) -> None:
180180
"""
181181
Certain services might be running that affects the system during installation.
182182
One such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
183183
We need to wait for it before we continue since we opted in to use a custom mirror/region.
184184
"""
185185

186-
if not arch_config_handler.args.skip_ntp:
186+
if not skip_ntp:
187187
info(tr('Waiting for time sync (timedatectl show) to complete.'))
188188

189189
started_wait = time.time()
@@ -200,7 +200,7 @@ def _verify_service_stop(self) -> None:
200200
else:
201201
info(tr('Skipping waiting for automatic time sync (this can cause issues if time is out of sync during installation)'))
202202

203-
if not arch_config_handler.args.offline:
203+
if not offline:
204204
info('Waiting for automatic mirror selection (reflector) to complete.')
205205
for _ in range(60):
206206
if self._service_state('reflector') in ('dead', 'failed', 'exited'):
@@ -215,7 +215,7 @@ def _verify_service_stop(self) -> None:
215215
# while self._service_state('pacman-init') not in ('dead', 'failed', 'exited'):
216216
# time.sleep(1)
217217

218-
if not arch_config_handler.args.skip_wkd:
218+
if not skip_wkd:
219219
info(tr('Waiting for Arch Linux keyring sync (archlinux-keyring-wkd-sync) to complete.'))
220220
# Wait for the timer to kick in
221221
while self._service_started('archlinux-keyring-wkd-sync.timer') is None:
@@ -243,9 +243,14 @@ def _verify_boot_part(self) -> None:
243243
f'Please resize it to at least 200MiB and re-run the installation.',
244244
)
245245

246-
def sanity_check(self) -> None:
246+
def sanity_check(
247+
self,
248+
offline: bool = False,
249+
skip_ntp: bool = False,
250+
skip_wkd: bool = False,
251+
) -> None:
247252
# self._verify_boot_part()
248-
self._verify_service_stop()
253+
self._verify_service_stop(offline, skip_ntp, skip_wkd)
249254

250255
def mount_ordered_layout(self) -> None:
251256
debug('Mounting ordered layout')

archinstall/scripts/guided.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,17 @@ def perform_installation(
7777
mountpoint,
7878
disk_config,
7979
kernels=config.kernels,
80+
silent=arch_config_handler.args.silent,
8081
) as installation:
8182
# Mount all the drives to the desired mountpoint
8283
if disk_config.config_type != DiskLayoutType.Pre_mount:
8384
installation.mount_ordered_layout()
8485

85-
installation.sanity_check()
86+
installation.sanity_check(
87+
arch_config_handler.args.offline,
88+
arch_config_handler.args.skip_ntp,
89+
arch_config_handler.args.skip_wkd,
90+
)
8691

8792
if disk_config.config_type != DiskLayoutType.Pre_mount:
8893
if disk_config.disk_encryption and disk_config.disk_encryption.encryption_type != EncryptionType.NoEncryption:

archinstall/scripts/minimal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def perform_installation(mountpoint: Path) -> None:
2828
mountpoint,
2929
disk_config,
3030
kernels=config.kernels,
31+
silent=arch_config_handler.args.silent,
3132
) as installation:
3233
# Strap in the base system, add a bootloader and configure
3334
# some other minor details as specified by this profile and user.

archinstall/scripts/only_hd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def perform_installation(mountpoint: Path) -> None:
4040
mountpoint,
4141
disk_config,
4242
kernels=config.kernels,
43+
silent=arch_config_handler.args.silent,
4344
) as installation:
4445
# Mount all the drives to the desired mountpoint
4546
# This *can* be done outside of the installation, but the installer can deal with it.

0 commit comments

Comments
 (0)