index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Timothy Pidashev <pidashev.tim@gmail.com> | 2022-01-30 02:01:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 11:01:04 +0100 |
commit | 179c103cddf930b91ffa82a9feee37c7f2487ed8 (patch) | |
tree | 6965d69447711fe5df929cccbc8929653fa53049 | |
parent | 275a960e6cb7163f4f37c4d16a4a62f599046613 (diff) |
-rw-r--r-- | archinstall/lib/networking.py | 10 | ||||
-rw-r--r-- | docs/archinstall/general.rst | 2 | ||||
-rw-r--r-- | examples/guided.py | 5 |
diff --git a/archinstall/lib/networking.py b/archinstall/lib/networking.py index 6b09deba..82754b58 100644 --- a/archinstall/lib/networking.py +++ b/archinstall/lib/networking.py @@ -40,6 +40,16 @@ def check_mirror_reachable() -> bool: return False +def update_keyring() -> bool: + log("Updating archlinux-keyring ...", level=logging.INFO) + if SysCommand("pacman -Sy archlinux-keyring").exit_code == 0: + return True + + elif os.geteuid() != 0: + log("update_keyring() uses 'pacman -Sy archlinux-keyring' which requires root.", level=logging.ERROR, fg="red") + + return False + def enrich_iface_types(interfaces: Union[Dict[str, Any], List[str]]) -> Dict[str, str]: result = {} diff --git a/docs/archinstall/general.rst b/docs/archinstall/general.rst index 804d4416..53847139 100644 --- a/docs/archinstall/general.rst +++ b/docs/archinstall/general.rst @@ -74,6 +74,8 @@ Networking .. autofunction:: archinstall.check_mirror_reachable +.. autofunction:: archinstall.update_keyring + .. autofunction:: archinstall.enrich_iface_types .. autofunction:: archinstall.get_interface_from_mac diff --git a/examples/guided.py b/examples/guided.py index 9092d8f6..22e0f883 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -309,6 +309,11 @@ if not (archinstall.check_mirror_reachable() or archinstall.arguments.get('skip- archinstall.log(f"Arch Linux mirrors are not reachable. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") exit(1) +if not (archinstall.update_keyring() or archinstall.arguments.get('skip-keyring-update', False)): + log_file = os.path.join(archinstall.storage.get('LOG_PATH', None), archinstall.storage.get('LOG_FILE', None)) + archinstall.log(f"Failed to update the keyring. Please check your internet connection and the log file '{log_file}'.", level=logging.INFO, fg="red") + exit(1) + load_config() if not archinstall.arguments.get('silent'): ask_user_questions() |