Skip to content

Commit 831ebbb

Browse files
committed
Added a --skip-ntp parameter to deal with #2144
1 parent cc806d9 commit 831ebbb

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

archinstall/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ def define_arguments():
7777
parser.add_argument("-v", "--version", action="version", version="%(prog)s " + __version__)
7878
parser.add_argument("--config", nargs="?", help="JSON configuration file or URL")
7979
parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file")
80+
parser.add_argument("--skip-ntp", nargs="?", help="Disables NTP checks during instalation")
8081
parser.add_argument("--silent", action="store_true",
8182
help="WARNING: Disables all prompts for input and confirmation. If no configuration is provided, this is ignored")
8283
parser.add_argument("--dry-run", "--dry_run", action="store_true",

archinstall/lib/installer.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,23 @@ def _verify_service_stop(self):
130130
One such service is "reflector.service" which updates /etc/pacman.d/mirrorlist
131131
We need to wait for it before we continue since we opted in to use a custom mirror/region.
132132
"""
133-
info('Waiting for time sync (systemd-timesyncd.service) to complete.')
134133

135-
while True:
136-
time_val = SysCommand('timedatectl show --property=NTPSynchronized --value').decode()
137-
if time_val and time_val.strip() == 'yes':
138-
break
139-
time.sleep(1)
134+
if not storage['arguments'].get('skip_ntp', False):
135+
info('Waiting for time sync (timedatectl show) to complete.')
136+
137+
_started_wait = time.time()
138+
_notified = False
139+
while True:
140+
if not _notified and time.time() - _started_wait > 5:
141+
_notified = True
142+
warn("Time syncronization not completing, while you wait - check the docs for workarounds: https://archinstall.readthedocs.io/")
143+
144+
time_val = SysCommand('timedatectl show --property=NTPSynchronized --value').decode()
145+
if time_val and time_val.strip() == 'yes':
146+
break
147+
time.sleep(1)
148+
else:
149+
info('Skipping waiting for automatic time sync (this can cause issues if time it out of sync during installation)')
140150

141151
info('Waiting for automatic mirror selection (reflector) to complete.')
142152
while self._service_state('reflector') not in ('dead', 'failed', 'exited'):

0 commit comments

Comments
 (0)