]>
git.ipfire.org Git - thirdparty/systemd.git/blob - src/shared/bootspec.h
12accc6c44302c67f9915af2f0cfb03df204f8e9
2 This file is part of systemd.
4 Copyright 2017 Zbigniew Jędrzejewski-Szmek
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
24 typedef struct BootEntry
{
33 char *kernel
; /* linux is #defined to 1, yikes! */
39 typedef struct BootConfig
{
40 char *default_pattern
;
52 ssize_t default_entry
;
55 void boot_entry_free(BootEntry
*entry
);
56 int boot_entry_load(const char *path
, BootEntry
*entry
);
57 int boot_entries_find(const char *dir
, BootEntry
**entries
, size_t *n_entries
);
59 int boot_loader_read_conf(const char *path
, BootConfig
*config
);
60 void boot_config_free(BootConfig
*config
);
61 int boot_entries_load_config(const char *esp_path
, BootConfig
*config
);
63 static inline const char* boot_entry_title(const BootEntry
*entry
) {
64 return entry
->show_title
?: entry
->title
?: entry
->filename
;
67 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
);