Fix UEFI grub2-install: add missing modules package and fix DNF stderr logging
This commit is contained in:
@@ -50,8 +50,9 @@ def run_command(cmd, check=True):
|
||||
t1 = threading.Thread(
|
||||
target=read_stream, args=(process.stdout, stdout_lines, logger.info)
|
||||
)
|
||||
# Log stderr as INFO to avoid Discord notification spam, but still capture it
|
||||
t2 = threading.Thread(
|
||||
target=read_stream, args=(process.stderr, stderr_lines, logger.error)
|
||||
target=read_stream, args=(process.stderr, stderr_lines, logger.info)
|
||||
)
|
||||
|
||||
t1.start()
|
||||
@@ -66,8 +67,9 @@ def run_command(cmd, check=True):
|
||||
stderr_str = "".join(stderr_lines)
|
||||
|
||||
if check and returncode != 0:
|
||||
error_msg = f"Command '{' '.join(cmd)}' failed with exit code {returncode}\nStderr: {stderr_str}"
|
||||
log_to_discord("ERROR", error_msg, module="os_install")
|
||||
error_msg = f"Command failed: {' '.join(cmd)}\nExit Code: {returncode}\nStderr: {stderr_str}"
|
||||
# Log this specific failure as ERROR so it DOES go to Discord
|
||||
logger.error(error_msg)
|
||||
raise subprocess.CalledProcessError(
|
||||
returncode, cmd, output=stdout_str, stderr=stderr_str
|
||||
)
|
||||
@@ -148,7 +150,7 @@ def install_minimal_os(mount_root, releasever="43"):
|
||||
]
|
||||
|
||||
if uefi:
|
||||
packages += ["grub2-efi-x64", "shim-x64", "efibootmgr"]
|
||||
packages += ["grub2-efi-x64", "grub2-efi-x64-modules", "shim-x64", "efibootmgr"]
|
||||
else:
|
||||
packages += ["grub2-pc"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user