Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archinstall/lib/hardware.py34
-rw-r--r--archinstall/scripts/guided.py5
-rw-r--r--examples/interactive_installation.py5
3 files changed, 27 insertions, 17 deletions
diff --git a/archinstall/lib/hardware.py b/archinstall/lib/hardware.py
index 8d0fb74f..220d3d37 100644
--- a/archinstall/lib/hardware.py
+++ b/archinstall/lib/hardware.py
@@ -86,6 +86,21 @@ class _SysInfo:
def mem_info_by_key(self, key: str) -> int:
return self.mem_info[key]
+ @cached_property
+ def loaded_modules(self) -> List[str]:
+ """
+ Returns loaded kernel modules
+ """
+ modules_path = Path('/proc/modules')
+ modules: List[str] = []
+
+ with modules_path.open() as file:
+ for line in file:
+ module = line.split(maxsplit=1)[0]
+ modules.append(module)
+
+ return modules
+
_sys_info = _SysInfo()
@@ -171,20 +186,9 @@ class SysInfo:
return False
@staticmethod
- def _loaded_modules() -> List[str]:
- """
- Returns loaded kernel modules
- """
- modules_path = Path('/proc/modules')
- modules: List[str] = []
-
- with modules_path.open() as file:
- for line in file:
- module = line.split(maxsplit=1)[0]
- modules.append(module)
-
- return modules
+ def requires_sof_fw() -> bool:
+ return 'snd_sof' in _sys_info.loaded_modules
@staticmethod
- def requires_sof() -> bool:
- return 'snd_sof' in SysInfo._loaded_modules()
+ def requires_alsa_fw() -> bool:
+ return 'snd_emu10k1' in _sys_info.loaded_modules
diff --git a/archinstall/scripts/guided.py b/archinstall/scripts/guided.py
index 9cb4ec2a..1e19c9a3 100644
--- a/archinstall/scripts/guided.py
+++ b/archinstall/scripts/guided.py
@@ -183,8 +183,11 @@ def perform_installation(mountpoint: Path):
elif audio == 'pulseaudio':
installation.add_additional_packages("pulseaudio")
- if SysInfo.requires_sof():
+ if SysInfo.requires_sof_fw():
installation.add_additional_packages('sof-firmware')
+
+ if SysInfo.requires_alsa_fw():
+ installation.add_additional_packages('alsa-firmware')
else:
info("No audio server will be installed")
diff --git a/examples/interactive_installation.py b/examples/interactive_installation.py
index 5738a9cc..487db4dd 100644
--- a/examples/interactive_installation.py
+++ b/examples/interactive_installation.py
@@ -162,8 +162,11 @@ def perform_installation(mountpoint: Path):
elif audio == 'pulseaudio':
installation.add_additional_packages("pulseaudio")
- if SysInfo.requires_sof():
+ if SysInfo.requires_sof_fw():
installation.add_additional_packages('sof-firmware')
+
+ if SysInfo.requires_alsa_fw():
+ installation.add_additional_packages('alsa-firmware')
else:
info("No audio server will be installed.")