diff --git a/README.md b/README.md index b6d5708503..887986fcb7 100644 --- a/README.md +++ b/README.md @@ -184,6 +184,19 @@ For a quick fix the below command will install the latest keyrings ```pacman -Sy archlinux-keyring``` +## PGP verification errors pacstrap + +This can occur if the **timezone selected** is incorrect and/or hardware clock in motherboard settings is not accurate (fails during verification of packages at first base-strap). Ie. when CMOS battery is dead and power cut-off happens this can reset other settings such as Clock, Sata Mode, Fast Boot, etc... + +For **offline installs** can set manually via: + +``` +timedatectl status +timedatectl set-time "YYYY-MM-DD HH:MM:SS" +``` + +Or in motherboard settings directly ! If you have internet and picked your timezone properly in the menu, NTP handles this by default. + ## How to dual boot with Windows To install Arch Linux alongside an existing Windows installation using `archinstall`, follow these steps: diff --git a/archinstall/lib/args.py b/archinstall/lib/args.py index f654345be9..5d0eb0e60f 100644 --- a/archinstall/lib/args.py +++ b/archinstall/lib/args.py @@ -73,7 +73,7 @@ class ArchConfig: packages: list[str] = field(default_factory=list) parallel_downloads: int = 0 swap: bool = True - timezone: str = 'UTC' + timezone: str | None = None services: list[str] = field(default_factory=list) custom_commands: list[str] = field(default_factory=list) @@ -213,7 +213,7 @@ def from_config(cls, args_config: dict[str, Any], args: Arguments) -> 'ArchConfi arch_config.swap = args_config.get('swap', True) - if timezone := args_config.get('timezone', 'UTC'): + if timezone := args_config.get('timezone', None): arch_config.timezone = timezone if services := args_config.get('services', []): diff --git a/archinstall/lib/global_menu.py b/archinstall/lib/global_menu.py index 8c13daf402..23eb53947e 100644 --- a/archinstall/lib/global_menu.py +++ b/archinstall/lib/global_menu.py @@ -150,9 +150,10 @@ def _get_menu_options(self) -> list[MenuItem]: MenuItem( text=tr('Timezone'), action=ask_for_a_timezone, - value='UTC', + value=None, preview_action=self._prev_tz, key='timezone', + mandatory=True, ), MenuItem( text=tr('Automatic time sync (NTP)'), @@ -330,7 +331,12 @@ def _prev_applications(self, item: MenuItem) -> str | None: def _prev_tz(self, item: MenuItem) -> str | None: if item.value: - return f'{tr("Timezone")}: {item.value}' + output = f'{tr("Timezone")}: {item.value}' + return output + else: + # Show RTC time when no timezone is selected yet + if rtc_time := SysInfo.hw_clock(): + return f'RTC time: {rtc_time}' return None def _prev_ntp(self, item: MenuItem) -> str | None: diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index e1278dfad4..338dae4a93 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -143,6 +143,13 @@ class _SysInfo: def __init__(self) -> None: pass + def hw_clock(self) -> str: + """ + Returns the RTC (hardware clock) time from timedatectl + """ + time = SysCommand('timedatectl show --property=RTCTimeUSec --value').decode().strip() + return time + @cached_property def cpu_info(self) -> dict[str, str]: """ @@ -207,6 +214,10 @@ def has_wifi() -> bool: def has_uefi() -> bool: return os.path.isdir('/sys/firmware/efi') + @staticmethod + def hw_clock() -> str: + return _sys_info.hw_clock() + @staticmethod def _graphics_devices() -> dict[str, str]: cards: dict[str, str] = {}