bootspec: make pe_find_uki_sections() non-static

This commit is contained in:
Lennart Poettering
2026-05-01 07:10:31 +02:00
parent acdaececf0
commit 0a46727ce7
2 changed files with 16 additions and 8 deletions
+14 -8
View File
@@ -963,7 +963,7 @@ static int trim_cmdline(char **cmdline) {
* the ones we do care about and we are willing to load into memory have this size limit.) */
#define PE_SECTION_SIZE_MAX (4U*1024U*1024U)
static int pe_find_uki_sections(
int pe_find_uki_sections(
int fd,
const char *path,
unsigned profile,
@@ -979,9 +979,6 @@ static int pe_find_uki_sections(
assert(fd >= 0);
assert(path);
assert(profile != UINT_MAX);
assert(ret_osrelease);
assert(ret_profile);
assert(ret_cmdline);
r = pe_load_headers_and_sections(fd, path, &sections, &pe_header);
if (r < 0)
@@ -1038,13 +1035,22 @@ static int pe_find_uki_sections(
if (trim_cmdline(&cmdline_text) < 0)
return log_oom();
*ret_osrelease = TAKE_PTR(osrelease_text);
*ret_profile = TAKE_PTR(profile_text);
*ret_cmdline = TAKE_PTR(cmdline_text);
if (ret_osrelease)
*ret_osrelease = TAKE_PTR(osrelease_text);
if (ret_profile)
*ret_profile = TAKE_PTR(profile_text);
if (ret_cmdline)
*ret_cmdline = TAKE_PTR(cmdline_text);
return 1;
nothing:
*ret_osrelease = *ret_profile = *ret_cmdline = NULL;
if (ret_osrelease)
*ret_osrelease = NULL;
if (ret_profile)
*ret_profile = NULL;
if (ret_cmdline)
*ret_cmdline = NULL;
return 0;
}
+2
View File
@@ -162,3 +162,5 @@ int show_boot_entries(
int boot_filename_extract_tries(const char *fname, char **ret_stripped, unsigned *ret_tries_left, unsigned *ret_tries_done);
int boot_entry_to_json(const BootConfig *c, size_t i, sd_json_variant **ret);
int pe_find_uki_sections(int fd, const char *path, unsigned profile, char **ret_osrelease, char **ret_profile, char **ret_cmdline);