shared: split out ESP/XBOOTLDR search stuff from bootspec.c

The code is quite different from the rest of bootspec.c, with different
deps and stuff. There's even a /***/ line to separate the two parts.
Given how large the file already is, let#s just split it into two.

No code changes, just some splitting out.
This commit is contained in:
Lennart Poettering
2022-03-18 11:49:39 +01:00
parent 09d4d60360
commit e94830c0a1
7 changed files with 728 additions and 718 deletions

View File

@@ -8,6 +8,7 @@
#include "efi-loader.h"
#include "efivars.h"
#include "fd-util.h"
#include "find-esp.h"
#include "fs-util.h"
#include "log.h"
#include "main-func.h"

View File

@@ -24,6 +24,7 @@
#include "escape.h"
#include "fd-util.h"
#include "fileio.h"
#include "find-esp.h"
#include "fs-util.h"
#include "glyph-util.h"
#include "main-func.h"

File diff suppressed because it is too large Load Diff

View File

@@ -2,12 +2,11 @@
#pragma once
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
#include <sys/types.h>
#include "sd-id128.h"
#include "string-util.h"
typedef enum BootEntryType {
@@ -90,6 +89,3 @@ static inline const char* boot_entry_title(const BootEntry *entry) {
return entry->show_title ?: entry->title ?: entry->id;
}
int find_esp_and_warn(const char *path, bool unprivileged_mode, char **ret_path, uint32_t *ret_part, uint64_t *ret_pstart, uint64_t *ret_psize, sd_id128_t *ret_uuid, dev_t *ret_devid);
int find_xbootldr_and_warn(const char *path, bool unprivileged_mode, char **ret_path,sd_id128_t *ret_uuid, dev_t *ret_devid);

709
src/shared/find-esp.c Normal file

File diff suppressed because it is too large Load Diff

12
src/shared/find-esp.h Normal file
View File

@@ -0,0 +1,12 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include <inttypes.h>
#include <stdbool.h>
#include <sys/types.h>
#include "sd-id128.h"
int find_esp_and_warn(const char *path, bool unprivileged_mode, char **ret_path, uint32_t *ret_part, uint64_t *ret_pstart, uint64_t *ret_psize, sd_id128_t *ret_uuid, dev_t *ret_devid);
int find_xbootldr_and_warn(const char *path, bool unprivileged_mode, char **ret_path, sd_id128_t *ret_uuid, dev_t *ret_devid);

View File

@@ -125,6 +125,8 @@ shared_sources = files(
'fdset.h',
'fileio-label.c',
'fileio-label.h',
'find-esp.c',
'find-esp.h',
'firewall-util-nft.c',
'firewall-util-private.h',
'firewall-util.c',