Skip to content

Commit 3705ef0

Browse files
committed
Move system info logging to function
1 parent d7a5a59 commit 3705ef0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

archinstall/__init__.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,25 @@
2727
# project to mark strings as translatable with _('translate me')
2828
DeferredTranslation.install()
2929

30-
# Log various information about hardware before starting the installation. This might assist in troubleshooting
31-
debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}")
32-
debug(f"Processor model detected: {SysInfo.cpu_model()}")
33-
debug(f"Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed")
34-
debug(f"Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}")
35-
debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}")
36-
37-
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout
38-
debug(f"Disk states before installing:\n{disk_layouts()}")
39-
4030

4131
# @archinstall.plugin decorator hook to programmatically add
4232
# plugins in runtime. Useful in profiles_bck and other things.
4333
def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
4434
plugins[f.__name__] = f
4535

4636

37+
def _log_sys_info() -> None:
38+
# Log various information about hardware before starting the installation. This might assist in troubleshooting
39+
debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}")
40+
debug(f"Processor model detected: {SysInfo.cpu_model()}")
41+
debug(f"Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed")
42+
debug(f"Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}")
43+
debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}")
44+
45+
# For support reasons, we'll log the disk layout pre installation to match against post-installation layout
46+
debug(f"Disk states before installing:\n{disk_layouts()}")
47+
48+
4749
def _fetch_arch_db() -> None:
4850
info("Fetching Arch Linux package database...")
4951
try:
@@ -82,6 +84,8 @@ def main() -> int:
8284
print(_("Archinstall requires root privileges to run. See --help for more."))
8385
return 1
8486

87+
_log_sys_info()
88+
8589
if not arch_config_handler.args.offline:
8690
_fetch_arch_db()
8791

0 commit comments

Comments
 (0)