bootctl: split-out entry token related definitions into boot-entry.[ch]

No functional change, just preparation for later commits.
These can be used in kernel-install later.

Note, unlike the our usual coding style, the arguments for
boot_entry_token_ensure() and parse_boot_entry_token_type() are
referenced, updated, and may freed, hence, always pass initialized
values. That's why they are not named as 'ret_xyz'.
This commit is contained in:
Yu Watanabe
2023-03-27 09:51:18 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 600362aa11
commit 9e43296fd2
7 changed files with 267 additions and 125 deletions
+2 -9
View File
@@ -3,17 +3,10 @@
#include "sd-id128.h"
#include "boot-entry.h"
#include "json.h"
#include "pager.h"
typedef enum EntryTokenType {
ARG_ENTRY_TOKEN_MACHINE_ID,
ARG_ENTRY_TOKEN_OS_IMAGE_ID,
ARG_ENTRY_TOKEN_OS_ID,
ARG_ENTRY_TOKEN_LITERAL,
ARG_ENTRY_TOKEN_AUTO,
} EntryTokenType;
typedef enum InstallSource {
ARG_INSTALL_SOURCE_IMAGE,
ARG_INSTALL_SOURCE_HOST,
@@ -32,7 +25,7 @@ extern bool arg_quiet;
extern int arg_make_entry_directory; /* tri-state: < 0 for automatic logic */
extern sd_id128_t arg_machine_id;
extern char *arg_install_layout;
extern EntryTokenType arg_entry_token_type;
extern BootEntryTokenType arg_entry_token_type;
extern char *arg_entry_token;
extern JsonFormatFlags arg_json_format_flags;
extern bool arg_arch_all;