]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootspec: rename boot_entry_type_to_string() to boot_entry_type_description_to_string()
authorLennart Poettering <lennart@poettering.net>
Mon, 7 Jul 2025 13:52:17 +0000 (15:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 7 Jul 2025 16:13:06 +0000 (18:13 +0200)
This helper does not translate BootEntryType to a string matching the
enum's value names, but instead returns a human readable descriptive
string. Let's make it clearer what this, by including "description" in
the name.

src/shared/bootspec.c
src/shared/bootspec.h
src/vmspawn/vmspawn.c

index bac00c5b3caed2c9eb9c3f277e621d6fe1893c1b..59ab33a19b079783955578ca6d2f4a15a0ae812e 100644 (file)
 #include "strv.h"
 #include "uki.h"
 
-static const char* const boot_entry_type_table[_BOOT_ENTRY_TYPE_MAX] = {
+static const char* const boot_entry_type_description_table[_BOOT_ENTRY_TYPE_MAX] = {
         [BOOT_ENTRY_CONF]        = "Boot Loader Specification Type #1 (.conf)",
         [BOOT_ENTRY_UNIFIED]     = "Boot Loader Specification Type #2 (.efi)",
         [BOOT_ENTRY_LOADER]      = "Reported by Boot Loader",
         [BOOT_ENTRY_LOADER_AUTO] = "Automatic",
 };
 
-DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_type, BootEntryType);
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_type_description, BootEntryType);
 
 static const char* const boot_entry_type_json_table[_BOOT_ENTRY_TYPE_MAX] = {
         [BOOT_ENTRY_CONF]        = "type1",
@@ -1823,7 +1823,7 @@ int show_boot_entry(
         assert(e);
 
         printf("         type: %s\n",
-               boot_entry_type_to_string(e->type));
+               boot_entry_type_description_to_string(e->type));
 
         printf("        title: %s%s%s",
                ansi_highlight(), boot_entry_title(e), ansi_normal());
index e0c561808c73132f17f8123b79634105136e78f3..f73ca627c5c2da1951542376ef52bb9fe8710efc 100644 (file)
@@ -91,7 +91,7 @@ typedef struct BootConfig {
                 .selected_entry = -1, \
         }
 
-const char* boot_entry_type_to_string(BootEntryType) _const_;
+const char* boot_entry_type_description_to_string(BootEntryType) _const_;
 const char* boot_entry_type_json_to_string(BootEntryType) _const_;
 
 const char* boot_entry_source_to_string(BootEntrySource) _const_;
index 49833ec49fce03f522e7671f2a23fec9262222cd..6a7a34d35be65cca3ac4b05c0defde096de192a6 100644 (file)
@@ -1373,7 +1373,7 @@ static int discover_boot_entry(const char *root, char **ret_linux, char ***ret_i
         if (!boot_entry)
                 return log_error_errno(SYNTHETIC_ERRNO(ENOENT), "Failed to discover any boot entries.");
 
-        log_debug("Discovered boot entry %s (%s)", boot_entry->id, boot_entry_type_to_string(boot_entry->type));
+        log_debug("Discovered boot entry %s (%s)", boot_entry->id, boot_entry_type_description_to_string(boot_entry->type));
 
         _cleanup_free_ char *linux_kernel = NULL;
         _cleanup_strv_free_ char **initrds = NULL;