index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Richard Neumann <mail@richard-neumann.de> | 2021-08-20 18:13:23 +0200 |
---|---|---|
committer | Richard Neumann <mail@richard-neumann.de> | 2021-08-20 18:13:23 +0200 |
commit | b8ede1b333e3dd4d2a6c3553685e5026dfd2c346 (patch) | |
tree | 1d59245962fcd197277a42e93ea9d983b86ae3aa /archinstall | |
parent | 3a4076419418dcdac538c543903cfc6e16bde35f (diff) |
-rw-r--r-- | archinstall/lib/hardware.py | 21 |
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py index a63155f5..56a9fa11 100644 --- a/archinstall/lib/hardware.py +++ b/archinstall/lib/hardware.py @@ -1,7 +1,8 @@ import json import os import subprocess -from typing import Optional +from pathlib import Path +from typing import Iterator, Optional from .general import SysCommand from .networking import list_interfaces, enrich_iface_types @@ -57,6 +58,24 @@ AVAILABLE_GFX_DRIVERS = { "VMware / VirtualBox (open-source)": ["mesa", "xf86-video-vmware"], } +CPUINFO = Path("/proc/cpuinfo") + + +def cpuinfo() -> Iterator[dict[str, str]]: + """Yields information about the CPUs of the system.""" + + cpu = {} + + with CPUINFO.open() as file: + for line in file: + if not (line := line.strip()): + yield cpu + cpu = {} + continue + + key, value = line.split(":", maxsplit=1) + cpu[key.strip()] = value.strip() + def has_wifi() -> bool: return 'WIRELESS' in enrich_iface_types(list_interfaces().values()).values() |