Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a --skip-ntp parameter to deal with #2144 #2225

Merged
merged 4 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions archinstall/__init__.py
Expand Up @@ -77,6 +77,7 @@ def define_arguments():
parser.add_argument("-v", "--version", action="version", version="%(prog)s " + __version__)
parser.add_argument("--config", nargs="?", help="JSON configuration file or URL")
parser.add_argument("--creds", nargs="?", help="JSON credentials configuration file")
parser.add_argument("--skip-ntp", nargs="?", help="Disables NTP checks during instalation")
parser.add_argument("--silent", action="store_true",
help="WARNING: Disables all prompts for input and confirmation. If no configuration is provided, this is ignored")
parser.add_argument("--dry-run", "--dry_run", action="store_true",
Expand Down
22 changes: 16 additions & 6 deletions archinstall/lib/installer.py
Expand Up @@ -130,13 +130,23 @@ def _verify_service_stop(self):
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.
"""
info('Waiting for time sync (systemd-timesyncd.service) to complete.')

while True:
time_val = SysCommand('timedatectl show --property=NTPSynchronized --value').decode()
if time_val and time_val.strip() == 'yes':
break
time.sleep(1)
if not storage['arguments'].get('skip_ntp', False):
info('Waiting for time sync (timedatectl show) to complete.')
Torxed marked this conversation as resolved.
Show resolved Hide resolved

_started_wait = time.time()
_notified = False
while True:
if not _notified and time.time() - _started_wait > 5:
_notified = True
warn("Time syncronization not completing, while you wait - check the docs for workarounds: https://archinstall.readthedocs.io/")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add something like "(...) completing ,this could me an issue with your network/ntp/environment permissions, while you wait (...)" and also maybe link directly to the relevant section instead of the whole doc?


time_val = SysCommand('timedatectl show --property=NTPSynchronized --value').decode()
if time_val and time_val.strip() == 'yes':
break
time.sleep(1)
else:
info('Skipping waiting for automatic time sync (this can cause issues if time it out of sync during installation)')
Torxed marked this conversation as resolved.
Show resolved Hide resolved

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