Resolves: RHEL-100553,RHEL-103354,RHEL-104555,RHEL-106260,RHEL-44419,RHEL-72701,RHEL-79976,RHEL-97625,RHEL-97762
77 lines
3.6 KiB
Diff
77 lines
3.6 KiB
Diff
From ebc7ea083afdfe257703d5312a03f345f142652e Mon Sep 17 00:00:00 2001
|
|
From: Lennart Poettering <lennart@poettering.net>
|
|
Date: Mon, 7 Jul 2025 18:26:59 +0200
|
|
Subject: [PATCH] bootspec: boot_entry_source_to_json_string() to
|
|
boot_entry_source_to_string()
|
|
|
|
As with the previous changes for BootEntryType, let's also clean up the
|
|
naming for BootEntrySource.
|
|
|
|
(cherry picked from commit 1e7ba4780d5e887788742430feafc768e5cc7e49)
|
|
|
|
Resolves: RHEL-103354
|
|
---
|
|
src/shared/bootspec.c | 10 +++++-----
|
|
src/shared/bootspec.h | 2 +-
|
|
2 files changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
|
|
index 5da8f64fa6..a7e868b397 100644
|
|
--- a/src/shared/bootspec.c
|
|
+++ b/src/shared/bootspec.c
|
|
@@ -33,7 +33,7 @@ static const char* const boot_entry_type_description_table[_BOOT_ENTRY_TYPE_MAX]
|
|
[BOOT_ENTRY_AUTO] = "Automatic",
|
|
};
|
|
|
|
-DEFINE_STRING_TABLE_LOOKUP(boot_entry_type, BootEntryType);
|
|
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_type_description, BootEntryType);
|
|
|
|
static const char* const boot_entry_type_table[_BOOT_ENTRY_TYPE_MAX] = {
|
|
[BOOT_ENTRY_TYPE1] = "type1",
|
|
@@ -42,7 +42,7 @@ static const char* const boot_entry_type_table[_BOOT_ENTRY_TYPE_MAX] = {
|
|
[BOOT_ENTRY_AUTO] = "auto",
|
|
};
|
|
|
|
-DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_type, BootEntryType);
|
|
+DEFINE_STRING_TABLE_LOOKUP(boot_entry_type, BootEntryType);
|
|
|
|
static const char* const boot_entry_source_description_table[_BOOT_ENTRY_SOURCE_MAX] = {
|
|
[BOOT_ENTRY_ESP] = "EFI System Partition",
|
|
@@ -51,12 +51,12 @@ static const char* const boot_entry_source_description_table[_BOOT_ENTRY_SOURCE_
|
|
|
|
DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_description, BootEntrySource);
|
|
|
|
-static const char* const boot_entry_source_json_table[_BOOT_ENTRY_SOURCE_MAX] = {
|
|
+static const char* const boot_entry_source_table[_BOOT_ENTRY_SOURCE_MAX] = {
|
|
[BOOT_ENTRY_ESP] = "esp",
|
|
[BOOT_ENTRY_XBOOTLDR] = "xbootldr",
|
|
};
|
|
|
|
-DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source_json, BootEntrySource);
|
|
+DEFINE_STRING_TABLE_LOOKUP_TO_STRING(boot_entry_source, BootEntrySource);
|
|
|
|
static void boot_entry_addons_done(BootEntryAddons *addons) {
|
|
assert(addons);
|
|
@@ -1930,7 +1930,7 @@ int boot_entry_to_json(const BootConfig *c, size_t i, sd_json_variant **ret) {
|
|
r = sd_json_variant_merge_objectbo(
|
|
&v,
|
|
SD_JSON_BUILD_PAIR("type", SD_JSON_BUILD_STRING(boot_entry_type_to_string(e->type))),
|
|
- SD_JSON_BUILD_PAIR("source", SD_JSON_BUILD_STRING(boot_entry_source_json_to_string(e->source))),
|
|
+ SD_JSON_BUILD_PAIR("source", SD_JSON_BUILD_STRING(boot_entry_source_to_string(e->source))),
|
|
SD_JSON_BUILD_PAIR_CONDITION(!!e->id, "id", SD_JSON_BUILD_STRING(e->id)),
|
|
SD_JSON_BUILD_PAIR_CONDITION(!!e->path, "path", SD_JSON_BUILD_STRING(e->path)),
|
|
SD_JSON_BUILD_PAIR_CONDITION(!!e->root, "root", SD_JSON_BUILD_STRING(e->root)),
|
|
diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h
|
|
index 5c9d24e78a..348324c069 100644
|
|
--- a/src/shared/bootspec.h
|
|
+++ b/src/shared/bootspec.h
|
|
@@ -103,7 +103,7 @@ const char* boot_entry_type_to_string(BootEntryType) _const_;
|
|
BootEntryType boot_entry_type_from_string(const char *s) _pure_;
|
|
|
|
const char* boot_entry_source_description_to_string(BootEntrySource) _const_;
|
|
-const char* boot_entry_source_json_to_string(BootEntrySource) _const_;
|
|
+const char* boot_entry_source_to_string(BootEntrySource) _const_;
|
|
|
|
BootEntry* boot_config_find_entry(BootConfig *config, const char *id);
|
|
|