]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: output a more precise log message when updating existing EFI vars
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Sep 2025 08:38:59 +0000 (10:38 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 19 Sep 2025 15:47:46 +0000 (00:47 +0900)
src/bootctl/bootctl-install.c

index 89a82192f87637dd313e9c41b5ba8745c2e5dd94..b70e945ca7aeb8804b871fa69e608c9fa3c091c6 100644 (file)
@@ -906,10 +906,17 @@ static int install_variables(
                 return graceful ? 0 : r;
         }
 
-        if (first || r == 0) {
-                r = efi_add_boot_option(slot, pick_efi_boot_option_description(),
-                                        part, pstart, psize,
-                                        uuid, path);
+        bool existing = r > 0;
+
+        if (first || !existing) {
+                r = efi_add_boot_option(
+                                slot,
+                                pick_efi_boot_option_description(),
+                                part,
+                                pstart,
+                                psize,
+                                uuid,
+                                path);
                 if (r < 0) {
                         int level = graceful ? arg_quiet ? LOG_DEBUG : LOG_INFO : LOG_ERR;
                         const char *skip = graceful ? ", skipping" : "";
@@ -919,7 +926,9 @@ static int install_variables(
                         return graceful ? 0 : r;
                 }
 
-                log_info("Created EFI boot entry \"%s\".", pick_efi_boot_option_description());
+                log_info("%s EFI boot entry \"%s\".",
+                         existing ? "Updated" : "Created",
+                         pick_efi_boot_option_description());
         }
 
         return insert_into_order(slot, first);