4242from archinstall .lib .packages .packages import installed_package
4343from archinstall .lib .translationhandler import tr
4444
45- from .args import arch_config_handler
4645from .boot import Boot
4746from .command import SysCommand , run
4847from .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' )
0 commit comments