From 5729b0bb4da4ce9361e0fe55b3fe8f20d8d747e4 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 28 May 2021 13:52:01 -0400 Subject: Make this template usable to users of more platforms In case someone is trying to edit this as a template, this will work for more people. --- examples/custom-command-sample.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/custom-command-sample.json b/examples/custom-command-sample.json index f38bcca1..980541de 100644 --- a/examples/custom-command-sample.json +++ b/examples/custom-command-sample.json @@ -8,7 +8,7 @@ ], "!encryption-password": "supersecret", "filesystem": "btrfs", - "gfx_driver": "VMware / VirtualBox (open-source)", + "gfx_driver": "All open-source (default)", "harddrive": { "path": "/dev/nvme0n1" }, -- cgit v1.2.3-70-g09d2 From e90b17ca1cab9287529eac7576c4e031d18a1f04 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 2 Jun 2021 21:10:41 -0400 Subject: Add hardware logging to beginning of installation --- archinstall/lib/hardware.py | 8 ++++++-- examples/guided.py | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 6f05f620..180d0b75 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -119,12 +119,12 @@ def cpu_model() -> Optional[str]: def sys_vendor() -> Optional[str]: with open(f"/sys/devices/virtual/dmi/id/sys_vendor") as vendor: - return vendor.read() + return vendor.read().strip() def product_name() -> Optional[str]: with open(f"/sys/devices/virtual/dmi/id/product_name") as product: - return product.read() + return product.read().strip() def mem_info(): @@ -144,6 +144,10 @@ def mem_total() -> Optional[str]: return mem_info()['MemTotal'] +def virtualization() -> Optional[str]: + return str(SysCommand("systemd-detect-virt")).strip('\r\n') + + def is_vm() -> bool: try: # systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine diff --git a/examples/guided.py b/examples/guided.py index 42429370..a842e6ff 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -5,7 +5,7 @@ import time import archinstall from archinstall.lib.general import run_custom_user_commands -from archinstall.lib.hardware import has_uefi, AVAILABLE_GFX_DRIVERS +from archinstall.lib.hardware import * from archinstall.lib.networking import check_mirror_reachable from archinstall.lib.profiles import Profile @@ -16,6 +16,12 @@ if os.getuid() != 0: print("Archinstall requires root privileges to run. See --help for more.") exit(1) +# Log various information about hardware before starting the installation. This might assist in troubleshooting +archinstall.log(f"Hardware model detected: {archinstall.sys_vendor()} {archinstall.product_name()}; UEFI mode: {archinstall.has_uefi()}", level=logging.DEBUG) +archinstall.log(f"Processor model detected: {archinstall.cpu_model()}", level=logging.DEBUG) +archinstall.log(f"Memory statistics: {archinstall.mem_available()} available out of {archinstall.mem_total()} total installed", level=logging.DEBUG) +archinstall.log(f"Virtualization detected: {archinstall.virtualization()}; is VM: {archinstall.is_vm()}", level=logging.DEBUG) + # For support reasons, we'll log the disk layout pre installation to match against post-installation layout archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG) -- cgit v1.2.3-70-g09d2 From 5f4a24d5cc0ebfdb48898b677fe1a9f3a5c93d05 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 2 Jun 2021 21:23:56 -0400 Subject: Add graphics device listing --- examples/guided.py | 1 + 1 file changed, 1 insertion(+) (limited to 'examples') diff --git a/examples/guided.py b/examples/guided.py index a842e6ff..18b2e768 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -21,6 +21,7 @@ archinstall.log(f"Hardware model detected: {archinstall.sys_vendor()} {archinsta archinstall.log(f"Processor model detected: {archinstall.cpu_model()}", level=logging.DEBUG) archinstall.log(f"Memory statistics: {archinstall.mem_available()} available out of {archinstall.mem_total()} total installed", level=logging.DEBUG) archinstall.log(f"Virtualization detected: {archinstall.virtualization()}; is VM: {archinstall.is_vm()}", level=logging.DEBUG) +archinstall.log(f"Graphics devices detected: {archinstall.graphics_devices()}", level=logging.DEBUG) # For support reasons, we'll log the disk layout pre installation to match against post-installation layout archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG) -- cgit v1.2.3-70-g09d2 From 3e505d4321a6593574bfbcb468803ae5266ffb01 Mon Sep 17 00:00:00 2001 From: Dylan Taylor Date: Wed, 2 Jun 2021 21:43:46 -0400 Subject: Clean up graphics driver output --- archinstall/lib/hardware.py | 8 ++++---- examples/guided.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index 66dfd3d0..45e042db 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -81,20 +81,20 @@ def graphics_devices() -> dict: for line in SysCommand("lspci"): if b' VGA ' in line or b' 3D ' in line: _, identifier = line.split(b': ', 1) - cards[identifier.strip().lower().decode('UTF-8')] = line + cards[identifier.strip().decode('UTF-8')] = line return cards def has_nvidia_graphics() -> bool: - return any('nvidia' in x for x in graphics_devices()) + return any('nvidia' in x.lower() for x in graphics_devices()) def has_amd_graphics() -> bool: - return any('amd' in x for x in graphics_devices()) + return any('amd' in x.lower() for x in graphics_devices()) def has_intel_graphics() -> bool: - return any('intel' in x for x in graphics_devices()) + return any('intel' in x.lower() for x in graphics_devices()) def cpu_vendor() -> Optional[str]: diff --git a/examples/guided.py b/examples/guided.py index 18b2e768..56c054fc 100644 --- a/examples/guided.py +++ b/examples/guided.py @@ -21,7 +21,7 @@ archinstall.log(f"Hardware model detected: {archinstall.sys_vendor()} {archinsta archinstall.log(f"Processor model detected: {archinstall.cpu_model()}", level=logging.DEBUG) archinstall.log(f"Memory statistics: {archinstall.mem_available()} available out of {archinstall.mem_total()} total installed", level=logging.DEBUG) archinstall.log(f"Virtualization detected: {archinstall.virtualization()}; is VM: {archinstall.is_vm()}", level=logging.DEBUG) -archinstall.log(f"Graphics devices detected: {archinstall.graphics_devices()}", level=logging.DEBUG) +archinstall.log(f"Graphics devices detected: {archinstall.graphics_devices().keys()}", level=logging.DEBUG) # For support reasons, we'll log the disk layout pre installation to match against post-installation layout archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG) -- cgit v1.2.3-70-g09d2