From 63b2f986c33da8f338f079d103be65c37200cd72 Mon Sep 17 00:00:00 2001 From: codefiles <11915375+codefiles@users.noreply.github.com> Date: Sun, 6 Apr 2025 23:19:18 -0400 Subject: [PATCH] Move system info logging to function (#3356) --- archinstall/__init__.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/archinstall/__init__.py b/archinstall/__init__.py index 463351a0..dbb5557b 100644 --- a/archinstall/__init__.py +++ b/archinstall/__init__.py @@ -27,16 +27,6 @@ if TYPE_CHECKING: # project to mark strings as translatable with _('translate me') DeferredTranslation.install() -# Log various information about hardware before starting the installation. This might assist in troubleshooting -debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}") -debug(f"Processor model detected: {SysInfo.cpu_model()}") -debug(f"Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed") -debug(f"Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}") -debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}") - -# For support reasons, we'll log the disk layout pre installation to match against post-installation layout -debug(f"Disk states before installing:\n{disk_layouts()}") - # @archinstall.plugin decorator hook to programmatically add # plugins in runtime. Useful in profiles_bck and other things. @@ -44,6 +34,18 @@ def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def] plugins[f.__name__] = f +def _log_sys_info() -> None: + # Log various information about hardware before starting the installation. This might assist in troubleshooting + debug(f"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}") + debug(f"Processor model detected: {SysInfo.cpu_model()}") + debug(f"Memory statistics: {SysInfo.mem_available()} available out of {SysInfo.mem_total()} total installed") + debug(f"Virtualization detected: {SysInfo.virtualization()}; is VM: {SysInfo.is_vm()}") + debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}") + + # For support reasons, we'll log the disk layout pre installation to match against post-installation layout + debug(f"Disk states before installing:\n{disk_layouts()}") + + def _fetch_arch_db() -> None: info("Fetching Arch Linux package database...") try: @@ -82,6 +84,8 @@ def main() -> int: print(_("Archinstall requires root privileges to run. See --help for more.")) return 1 + _log_sys_info() + if not arch_config_handler.args.offline: _fetch_arch_db()