Synchronize `archlinux-keyring` when running guided.py (#917)
* Update guided.py * Update guided.py * Update guided.py * Fix typo * Format string properly; elaborate log msg * Make change consistent to mirror-check * Update documentation
This commit is contained in:
parent
275a960e6c
commit
179c103cdd
|
|
@ -40,6 +40,16 @@ def check_mirror_reachable() -> bool:
|
||||||
|
|
||||||
return False
|
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]:
|
def enrich_iface_types(interfaces: Union[Dict[str, Any], List[str]]) -> Dict[str, str]:
|
||||||
result = {}
|
result = {}
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,8 @@ Networking
|
||||||
|
|
||||||
.. autofunction:: archinstall.check_mirror_reachable
|
.. autofunction:: archinstall.check_mirror_reachable
|
||||||
|
|
||||||
|
.. autofunction:: archinstall.update_keyring
|
||||||
|
|
||||||
.. autofunction:: archinstall.enrich_iface_types
|
.. autofunction:: archinstall.enrich_iface_types
|
||||||
|
|
||||||
.. autofunction:: archinstall.get_interface_from_mac
|
.. autofunction:: archinstall.get_interface_from_mac
|
||||||
|
|
|
||||||
|
|
@ -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")
|
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)
|
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()
|
load_config()
|
||||||
if not archinstall.arguments.get('silent'):
|
if not archinstall.arguments.get('silent'):
|
||||||
ask_user_questions()
|
ask_user_questions()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue