Files
systemd/src/shared/boot-entry.h
Daan De Meyer f102bc3e5f tree-wide: Introduce sd-forward.h and shared-forward.h headers
Let's not leak details from src/shared and src/libsystemd into
src/basic, even though you can't actually do anything useful with
just forward declarations from src/shared.

The sd-forward.h header is put in src/libsystemd/sd-common as we
don't have a directory for shared internal headers for libsystemd
yet.

Let's also rename forward.h to basic-forward.h to keep things
self-explanatory.
2025-10-16 17:00:29 +02:00

38 lines
1.3 KiB
C

/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "sd-id128.h"
#include "shared-forward.h"
typedef enum BootEntryTokenType {
BOOT_ENTRY_TOKEN_MACHINE_ID,
BOOT_ENTRY_TOKEN_OS_IMAGE_ID,
BOOT_ENTRY_TOKEN_OS_ID,
BOOT_ENTRY_TOKEN_LITERAL,
BOOT_ENTRY_TOKEN_AUTO,
_BOOT_ENTRY_TOKEN_TYPE_MAX,
_BOOT_ENTRY_TOKEN_TYPE_INVALID = -EINVAL,
} BootEntryTokenType;
bool boot_entry_token_valid(const char *p);
int boot_entry_token_ensure(
const char *root,
const char *conf_root, /* will be prefixed with root, typically /etc/kernel. */
sd_id128_t machine_id,
bool machine_id_is_random,
BootEntryTokenType *type, /* input and output */
char **token); /* output, but do not pass uninitialized value. */
int boot_entry_token_ensure_at(
int rfd,
const char *conf_root,
sd_id128_t machine_id,
bool machine_id_is_random,
BootEntryTokenType *type,
char **token);
int parse_boot_entry_token_type(const char *s, BootEntryTokenType *type, char **token);
const char* boot_entry_token_type_to_string(BootEntryTokenType t);