Merge pull request #14074 from keszybz/rename-system-options
Rename system-options
This commit is contained in:
commit
2d8898f564
4
NEWS
4
NEWS
|
@ -19,7 +19,7 @@ CHANGES WITH 244 in spe:
|
||||||
SystemdOptions. This may be used to configure systemd behaviour when
|
SystemdOptions. This may be used to configure systemd behaviour when
|
||||||
modifying the kernel command line is inconvenient, but configuration
|
modifying the kernel command line is inconvenient, but configuration
|
||||||
on disk is read too late, for example for the options related to
|
on disk is read too late, for example for the options related to
|
||||||
cgroup hierarchy setup. 'bootctl system-options' may be used to
|
cgroup hierarchy setup. 'bootctl systemd-efi-options' may be used to
|
||||||
set the EFI variable.
|
set the EFI variable.
|
||||||
|
|
||||||
* systemd will now disable printk ratelimits in early boot. This should
|
* systemd will now disable printk ratelimits in early boot. This should
|
||||||
|
@ -505,7 +505,7 @@ CHANGES WITH 243:
|
||||||
* SuccessExitStatus=, RestartPreventExitStatus=, and
|
* SuccessExitStatus=, RestartPreventExitStatus=, and
|
||||||
RestartForceExitStatus= now accept exit status names (e.g. "DATAERR"
|
RestartForceExitStatus= now accept exit status names (e.g. "DATAERR"
|
||||||
is equivalent to "65"). Those exit status name mappings may be
|
is equivalent to "65"). Those exit status name mappings may be
|
||||||
displayed with the sytemd-analyze exit-status verb describe above.
|
displayed with the systemd-analyze exit-status verb describe above.
|
||||||
|
|
||||||
* systemd-logind now exposes a per-session SetBrightness() bus call,
|
* systemd-logind now exposes a per-session SetBrightness() bus call,
|
||||||
which may be used to securely change the brightness of a kernel
|
which may be used to securely change the brightness of a kernel
|
||||||
|
|
|
@ -47,8 +47,8 @@ All tools:
|
||||||
* `$SYSTEMD_CRYPTTAB` — if set, use this path instead of /etc/crypttab. Only
|
* `$SYSTEMD_CRYPTTAB` — if set, use this path instead of /etc/crypttab. Only
|
||||||
useful for debugging. Currently only supported by systemd-cryptsetup-generator.
|
useful for debugging. Currently only supported by systemd-cryptsetup-generator.
|
||||||
|
|
||||||
* `$SYSTEMD_EFI_OPTIONS` — if set, used instead of the string in SystemdOptions
|
* `$SYSTEMD_EFI_OPTIONS` — if set, used instead of the string in the
|
||||||
EFI variable. Analogous to `$SYSTEMD_PROC_CMDLINE`.
|
SystemdOptions EFI variable. Analogous to `$SYSTEMD_PROC_CMDLINE`.
|
||||||
|
|
||||||
* `$SYSTEMD_IN_INITRD` — takes a boolean. If set, overrides initrd detection.
|
* `$SYSTEMD_IN_INITRD` — takes a boolean. If set, overrides initrd detection.
|
||||||
This is useful for debugging and testing initrd-only programs in the main
|
This is useful for debugging and testing initrd-only programs in the main
|
||||||
|
|
|
@ -102,7 +102,7 @@
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><option>system-options</option> <optional><replaceable>VALUE</replaceable></optional></term>
|
<term><option>systemd-efi-options</option> <optional><replaceable>VALUE</replaceable></optional></term>
|
||||||
|
|
||||||
<listitem><para>When called without the optional argument, prints the current value of the
|
<listitem><para>When called without the optional argument, prints the current value of the
|
||||||
<literal>SystemdOptions</literal> EFI variable. When called with an argument, sets the
|
<literal>SystemdOptions</literal> EFI variable. When called with an argument, sets the
|
||||||
|
|
|
@ -220,7 +220,7 @@ int efi_set_variable_string(sd_id128_t vendor, const char *name, const char *v)
|
||||||
return efi_set_variable(vendor, name, u16, (char16_strlen(u16) + 1) * sizeof(char16_t));
|
return efi_set_variable(vendor, name, u16, (char16_strlen(u16) + 1) * sizeof(char16_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
int efi_systemd_options_variable(char **line) {
|
int systemd_efi_options_variable(char **line) {
|
||||||
const char *e;
|
const char *e;
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ int efi_get_variable_string(sd_id128_t vendor, const char *name, char **p);
|
||||||
int efi_set_variable(sd_id128_t vendor, const char *name, const void *value, size_t size);
|
int efi_set_variable(sd_id128_t vendor, const char *name, const void *value, size_t size);
|
||||||
int efi_set_variable_string(sd_id128_t vendor, const char *name, const char *p);
|
int efi_set_variable_string(sd_id128_t vendor, const char *name, const char *p);
|
||||||
|
|
||||||
int efi_systemd_options_variable(char **line);
|
int systemd_efi_options_variable(char **line);
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ static inline int efi_set_variable_string(sd_id128_t vendor, const char *name, c
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int efi_systemd_options_variable(char **line) {
|
static inline int systemd_efi_options_variable(char **line) {
|
||||||
return -ENODATA;
|
return -ENODATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -119,7 +119,7 @@ int proc_cmdline_parse(proc_cmdline_parse_t parse_item, void *data, ProcCmdlineF
|
||||||
|
|
||||||
/* We parse the EFI variable first, because later settings have higher priority. */
|
/* We parse the EFI variable first, because later settings have higher priority. */
|
||||||
|
|
||||||
r = efi_systemd_options_variable(&line);
|
r = systemd_efi_options_variable(&line);
|
||||||
if (r < 0 && r != -ENODATA)
|
if (r < 0 && r != -ENODATA)
|
||||||
log_debug_errno(r, "Failed to get SystemdOptions EFI variable, ignoring: %m");
|
log_debug_errno(r, "Failed to get SystemdOptions EFI variable, ignoring: %m");
|
||||||
|
|
||||||
|
@ -250,7 +250,7 @@ int proc_cmdline_get_key(const char *key, ProcCmdlineFlags flags, char **ret_val
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
line = mfree(line);
|
line = mfree(line);
|
||||||
r = efi_systemd_options_variable(&line);
|
r = systemd_efi_options_variable(&line);
|
||||||
if (r == -ENODATA)
|
if (r == -ENODATA)
|
||||||
return false; /* Not found */
|
return false; /* Not found */
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
|
|
|
@ -1033,19 +1033,19 @@ static int help(int argc, char *argv[], void *userdata) {
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
printf("%s [OPTIONS...] COMMAND ...\n"
|
printf("%s [OPTIONS...] COMMAND ...\n"
|
||||||
"\n%sInstall, update or remove the systemd-boot EFI boot manager.%s\n"
|
"\n%sInstall/update/remove the systemd-boot EFI boot manager and list/select entries.%s\n"
|
||||||
"\nBoot Loader Commands:\n"
|
"\nBoot Loader Commands:\n"
|
||||||
" status Show status of installed systemd-boot and EFI variables\n"
|
" status Show status of installed systemd-boot and EFI variables\n"
|
||||||
" install Install systemd-boot to the ESP and EFI variables\n"
|
" install Install systemd-boot to the ESP and EFI variables\n"
|
||||||
" update Update systemd-boot in the ESP and EFI variables\n"
|
" update Update systemd-boot in the ESP and EFI variables\n"
|
||||||
" remove Remove systemd-boot from the ESP and EFI variables\n"
|
" remove Remove systemd-boot from the ESP and EFI variables\n"
|
||||||
" is-installed Test whether systemd-boot is installed in the ESP\n"
|
" is-installed Test whether systemd-boot is installed in the ESP\n"
|
||||||
" random-seed Initialize random seed in ESP and EFI variables\n"
|
" random-seed Initialize random seed in ESP and EFI variables\n"
|
||||||
" system-options Query or set system options string in EFI variable\n"
|
" systemd-efi-options Query or set system options string in EFI variable\n"
|
||||||
"\nBoot Loader Entries Commands:\n"
|
"\nBoot Loader Entries Commands:\n"
|
||||||
" list List boot loader entries\n"
|
" list List boot loader entries\n"
|
||||||
" set-default ID Set default boot loader entry\n"
|
" set-default ID Set default boot loader entry\n"
|
||||||
" set-oneshot ID Set default boot loader entry, for next boot only\n"
|
" set-oneshot ID Set default boot loader entry, for next boot only\n"
|
||||||
"\nOptions:\n"
|
"\nOptions:\n"
|
||||||
" -h --help Show this help\n"
|
" -h --help Show this help\n"
|
||||||
" --version Print version\n"
|
" --version Print version\n"
|
||||||
|
@ -1716,17 +1716,17 @@ static int verb_random_seed(int argc, char *argv[], void *userdata) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int verb_system_options(int argc, char *argv[], void *userdata) {
|
static int verb_systemd_efi_options(int argc, char *argv[], void *userdata) {
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
_cleanup_free_ char *line = NULL;
|
_cleanup_free_ char *line = NULL;
|
||||||
|
|
||||||
r = efi_systemd_options_variable(&line);
|
r = systemd_efi_options_variable(&line);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "Failed to query SystemdOptions EFI variable: %m");
|
return log_error_errno(r, "Failed to query SystemdOptions EFI variable: %m");
|
||||||
|
|
||||||
printf("SystemdOptions: %s\n", line);
|
puts(line);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r = efi_set_variable_string(EFI_VENDOR_SYSTEMD, "SystemdOptions", argv[1]);
|
r = efi_set_variable_string(EFI_VENDOR_SYSTEMD, "SystemdOptions", argv[1]);
|
||||||
|
@ -1739,17 +1739,17 @@ static int verb_system_options(int argc, char *argv[], void *userdata) {
|
||||||
|
|
||||||
static int bootctl_main(int argc, char *argv[]) {
|
static int bootctl_main(int argc, char *argv[]) {
|
||||||
static const Verb verbs[] = {
|
static const Verb verbs[] = {
|
||||||
{ "help", VERB_ANY, VERB_ANY, 0, help },
|
{ "help", VERB_ANY, VERB_ANY, 0, help },
|
||||||
{ "status", VERB_ANY, 1, VERB_DEFAULT, verb_status },
|
{ "status", VERB_ANY, 1, VERB_DEFAULT, verb_status },
|
||||||
{ "install", VERB_ANY, 1, 0, verb_install },
|
{ "install", VERB_ANY, 1, 0, verb_install },
|
||||||
{ "update", VERB_ANY, 1, 0, verb_install },
|
{ "update", VERB_ANY, 1, 0, verb_install },
|
||||||
{ "remove", VERB_ANY, 1, 0, verb_remove },
|
{ "remove", VERB_ANY, 1, 0, verb_remove },
|
||||||
{ "is-installed", VERB_ANY, 1, 0, verb_is_installed },
|
{ "is-installed", VERB_ANY, 1, 0, verb_is_installed },
|
||||||
{ "list", VERB_ANY, 1, 0, verb_list },
|
{ "list", VERB_ANY, 1, 0, verb_list },
|
||||||
{ "set-default", 2, 2, 0, verb_set_default },
|
{ "set-default", 2, 2, 0, verb_set_default },
|
||||||
{ "set-oneshot", 2, 2, 0, verb_set_default },
|
{ "set-oneshot", 2, 2, 0, verb_set_default },
|
||||||
{ "random-seed", VERB_ANY, 1, 0, verb_random_seed },
|
{ "random-seed", VERB_ANY, 1, 0, verb_random_seed },
|
||||||
{ "system-options", VERB_ANY, 2, 0, verb_system_options },
|
{ "systemd-efi-options", VERB_ANY, 2, 0, verb_systemd_efi_options },
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -501,18 +501,14 @@ fail:
|
||||||
|
|
||||||
static bool path_check_good(Path *p, bool initial) {
|
static bool path_check_good(Path *p, bool initial) {
|
||||||
PathSpec *s;
|
PathSpec *s;
|
||||||
bool good = false;
|
|
||||||
|
|
||||||
assert(p);
|
assert(p);
|
||||||
|
|
||||||
LIST_FOREACH(spec, s, p->specs) {
|
LIST_FOREACH(spec, s, p->specs)
|
||||||
good = path_spec_check_good(s, initial);
|
if (path_spec_check_good(s, initial))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (good)
|
return false;
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return good;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void path_enter_waiting(Path *p, bool initial, bool recheck) {
|
static void path_enter_waiting(Path *p, bool initial, bool recheck) {
|
||||||
|
|
Loading…
Reference in a new issue