Move system info logging to function (#3356)

This commit is contained in:
codefiles 2025-04-06 23:19:18 -04:00 committed by GitHub
parent d7a5a59342
commit 63b2f986c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 10 deletions

View File

@ -27,6 +27,14 @@ if TYPE_CHECKING:
# project to mark strings as translatable with _('translate me') # project to mark strings as translatable with _('translate me')
DeferredTranslation.install() DeferredTranslation.install()
# @archinstall.plugin decorator hook to programmatically add
# plugins in runtime. Useful in profiles_bck and other things.
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 # 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"Hardware model detected: {SysInfo.sys_vendor()} {SysInfo.product_name()}; UEFI mode: {SysInfo.has_uefi()}")
debug(f"Processor model detected: {SysInfo.cpu_model()}") debug(f"Processor model detected: {SysInfo.cpu_model()}")
@ -38,12 +46,6 @@ debug(f"Graphics devices detected: {SysInfo._graphics_devices().keys()}")
debug(f"Disk states before installing:\n{disk_layouts()}") 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.
def plugin(f, *args, **kwargs) -> None: # type: ignore[no-untyped-def]
plugins[f.__name__] = f
def _fetch_arch_db() -> None: def _fetch_arch_db() -> None:
info("Fetching Arch Linux package database...") info("Fetching Arch Linux package database...")
try: try:
@ -82,6 +84,8 @@ def main() -> int:
print(_("Archinstall requires root privileges to run. See --help for more.")) print(_("Archinstall requires root privileges to run. See --help for more."))
return 1 return 1
_log_sys_info()
if not arch_config_handler.args.offline: if not arch_config_handler.args.offline:
_fetch_arch_db() _fetch_arch_db()