From d77d43f7963019c411ba364337dfcd7fa734ed90 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 13 Oct 2023 09:56:06 -0400 Subject: [PATCH] bootloader: Add BOOTC_BOOTLOADER_DEBUG env var To force on verbose tracing for bootupd to debug things. --- lib/src/bootloader.rs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/lib/src/bootloader.rs b/lib/src/bootloader.rs index b6f2520f4..59ec4e878 100644 --- a/lib/src/bootloader.rs +++ b/lib/src/bootloader.rs @@ -56,19 +56,15 @@ pub(crate) fn install_via_bootupd( rootfs: &Utf8Path, boot_uuid: &str, ) -> Result<()> { - Task::new_and_run( - "Running bootupctl to install bootloader", - "bootupctl", - [ - "backend", - "install", - "--src-root", - "/", - "--device", - device.as_str(), - rootfs.as_str(), - ], - )?; + let verbose = std::env::var_os("BOOTC_BOOTLOADER_DEBUG").map(|_| "-vvvv"); + let args = ["backend", "install"].into_iter().chain(verbose).chain([ + "--src-root", + "/", + "--device", + device.as_str(), + rootfs.as_str(), + ]); + Task::new_and_run("Running bootupctl to install bootloader", "bootupctl", args)?; let grub2_uuid_contents = format!("set BOOT_UUID=\"{boot_uuid}\"\n");