Add hardware logging to beginning of installation
This commit is contained in:
parent
c851a38a9e
commit
e90b17ca1c
|
|
@ -119,12 +119,12 @@ def cpu_model() -> Optional[str]:
|
||||||
|
|
||||||
def sys_vendor() -> Optional[str]:
|
def sys_vendor() -> Optional[str]:
|
||||||
with open(f"/sys/devices/virtual/dmi/id/sys_vendor") as vendor:
|
with open(f"/sys/devices/virtual/dmi/id/sys_vendor") as vendor:
|
||||||
return vendor.read()
|
return vendor.read().strip()
|
||||||
|
|
||||||
|
|
||||||
def product_name() -> Optional[str]:
|
def product_name() -> Optional[str]:
|
||||||
with open(f"/sys/devices/virtual/dmi/id/product_name") as product:
|
with open(f"/sys/devices/virtual/dmi/id/product_name") as product:
|
||||||
return product.read()
|
return product.read().strip()
|
||||||
|
|
||||||
|
|
||||||
def mem_info():
|
def mem_info():
|
||||||
|
|
@ -144,6 +144,10 @@ def mem_total() -> Optional[str]:
|
||||||
return mem_info()['MemTotal']
|
return mem_info()['MemTotal']
|
||||||
|
|
||||||
|
|
||||||
|
def virtualization() -> Optional[str]:
|
||||||
|
return str(SysCommand("systemd-detect-virt")).strip('\r\n')
|
||||||
|
|
||||||
|
|
||||||
def is_vm() -> bool:
|
def is_vm() -> bool:
|
||||||
try:
|
try:
|
||||||
# systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
|
# systemd-detect-virt issues a non-zero exit code if it is not on a virtual machine
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import time
|
||||||
|
|
||||||
import archinstall
|
import archinstall
|
||||||
from archinstall.lib.general import run_custom_user_commands
|
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.networking import check_mirror_reachable
|
||||||
from archinstall.lib.profiles import Profile
|
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.")
|
print("Archinstall requires root privileges to run. See --help for more.")
|
||||||
exit(1)
|
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
|
# 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)
|
archinstall.log(f"Disk states before installing: {archinstall.disk_layouts()}", level=logging.DEBUG)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue