Add mirror reachability check
Needed error handling Fix internet connection text not showing up and make it red
This commit is contained in:
parent
e3c8692bfa
commit
22fc18dc46
|
|
@ -26,6 +26,14 @@ def list_interfaces(skip_loopback=True):
|
|||
return interfaces
|
||||
|
||||
|
||||
def check_mirror_reachable():
|
||||
try:
|
||||
check = SysCommand("pacman -Sy")
|
||||
return check.exit_code == 0
|
||||
except:
|
||||
return False
|
||||
|
||||
|
||||
def enrich_iface_types(interfaces: dict):
|
||||
result = {}
|
||||
for iface in interfaces:
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import time
|
|||
|
||||
import archinstall
|
||||
from archinstall.lib.hardware import has_uefi
|
||||
from archinstall.lib.networking import check_mirror_reachable
|
||||
|
||||
if archinstall.arguments.get('help'):
|
||||
print("See `man archinstall` for help.")
|
||||
|
|
@ -387,5 +388,9 @@ def perform_installation(mountpoint):
|
|||
archinstall.log(f"Disk states after installing: {archinstall.disk_layouts()}", level=logging.DEBUG)
|
||||
|
||||
|
||||
if not check_mirror_reachable():
|
||||
archinstall.log("Arch Linux mirrors are not reachable. Please check your internet connection and try again.", level=logging.INFO, fg="red")
|
||||
exit(1)
|
||||
|
||||
ask_user_questions()
|
||||
perform_installation_steps()
|
||||
|
|
|
|||
Loading…
Reference in New Issue