mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 00:14:32 +09:00
Print location of loader.conf in bootctl status and related updates (#38389)
This commit is contained in:
@@ -353,12 +353,13 @@ All tools:
|
||||
default is not appropriate for a given system. Defaults to `5`, accepts
|
||||
positive integers.
|
||||
|
||||
* `$SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_INTERVAL_SEC` — can be set to override the mount
|
||||
units interval rate limit for parsing `/proc/self/mountinfo`. Similar to
|
||||
`$SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST`, the interval limit maybe adjusted when
|
||||
the default is not appropriate for a given system. The default value is 1 and the
|
||||
default application time unit is second, and the time unit can beoverriden as usual
|
||||
by specifying it explicitly, see the systemd.time(7) man page.
|
||||
* `$SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_INTERVAL_SEC` — can be set to override the
|
||||
mount units interval rate limit for parsing `/proc/self/mountinfo`. Similar
|
||||
to `$SYSTEMD_DEFAULT_MOUNT_RATE_LIMIT_BURST`, the interval limit maybe
|
||||
adjusted when the default is not appropriate for a given system. The default
|
||||
value is 1, the default application time unit is second, and the time unit
|
||||
can be overridden as usual by specifying it explicitly, see the
|
||||
systemd.time(7) man page.
|
||||
|
||||
`systemd-remount-fs`:
|
||||
|
||||
|
||||
@@ -21,47 +21,50 @@
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
<para><filename><replaceable>ESP</replaceable>/loader/loader.conf</filename>,
|
||||
<filename><replaceable>ESP</replaceable>/loader/entries/*.conf</filename>
|
||||
<filename><replaceable>XBOOTLDR</replaceable>/loader/entries/*.conf</filename>
|
||||
</para>
|
||||
<para><filename><replaceable>ESP</replaceable>/loader/loader.conf</filename></para>
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1>
|
||||
<title>Description</title>
|
||||
|
||||
<para>
|
||||
<citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> will
|
||||
read <filename><replaceable>ESP</replaceable>/loader/loader.conf</filename>, and any files with the
|
||||
<literal>.conf</literal> extension under
|
||||
<filename><replaceable>ESP</replaceable>/loader/entries/</filename> on the EFI system partition (ESP),
|
||||
and <filename><replaceable>XBOOTLDR</replaceable>/loader/entries/</filename> on the extended boot loader
|
||||
partition (XBOOTLDR) as defined by <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader
|
||||
Specification</ulink>.
|
||||
</para>
|
||||
<citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> reads
|
||||
<filename><replaceable>ESP</replaceable>/loader/loader.conf</filename>. This file configures whether the
|
||||
menu is shown and for how long, the font, audible beep, types of menu entries to show, the default
|
||||
choice, and some aspects of Secure Boot enrollment and firmware handling. See the list of available
|
||||
options below.</para>
|
||||
|
||||
<para>Each of these configuration files must consist of series of newline (i.e. ASCII code 10) separated
|
||||
lines, each consisting of an option name, followed by whitespace, and the option
|
||||
value. <literal>#</literal> may be used to start a comment line. Empty and comment lines are ignored. The
|
||||
files use UTF-8 encoding.</para>
|
||||
<para>The file uses UTF-8 encoding and consists of series of lines separated by "line feed" (i.e. ASCII
|
||||
code 10). Lines that are empty or start with the comment sign (<literal>#</literal>) are ignored. Other
|
||||
lines consist of an option name, followed by whitespace, and the option value.
|
||||
</para>
|
||||
|
||||
<para>Boolean arguments may be written as
|
||||
<literal>yes</literal>/<literal>y</literal>/<literal>true</literal>/<literal>t</literal>/<literal>on</literal>/<literal>1</literal> or
|
||||
<literal>yes</literal>/<literal>y</literal>/<literal>true</literal>/<literal>t</literal>/<literal>on</literal>/<literal>1</literal>
|
||||
or
|
||||
<literal>no</literal>/<literal>n</literal>/<literal>false</literal>/<literal>f</literal>/<literal>off</literal>/<literal>0</literal>.
|
||||
</para>
|
||||
|
||||
<para>Note: <command>systemd-boot</command> will also read boot loader entry files,
|
||||
type #1 (<filename><replaceable>ESP</replaceable>/loader/entries/*.conf</filename> and
|
||||
<filename><replaceable>XBOOTLDR</replaceable>/loader/entries/*.conf</filename>)
|
||||
and type #2 (<filename><replaceable>ESP</replaceable>/EFI/Linux/*.uki</filename>
|
||||
and <filename><replaceable>XBOOTLDR</replaceable>/EFI/Linux/*.uki</filename>).
|
||||
Those files are described by the
|
||||
<ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader
|
||||
Specification</ulink>.</para>
|
||||
|
||||
<para>Note: the behaviour of <command>systemd-boot</command> is also influenced by EFI variables. Some of
|
||||
the settings specified in this file can be overridden by those, for example the default boot menu entry
|
||||
or the menu timeouts. See
|
||||
<citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
|
||||
details.</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Options</title>
|
||||
|
||||
<para>The configuration options supported by
|
||||
<filename><replaceable>ESP</replaceable>/loader/entries/*.conf</filename> and
|
||||
<filename><replaceable>XBOOTLDR</replaceable>/loader/entries/*.conf</filename> files are defined as part
|
||||
of the <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">Boot Loader
|
||||
Specification</ulink>.</para>
|
||||
|
||||
<para>The following configuration are supported by the <filename>loader.conf</filename> configuration
|
||||
file:</para>
|
||||
<para>The following configuration are supported in <filename>loader.conf</filename>:</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@@ -254,8 +257,9 @@
|
||||
<varlistentry>
|
||||
<term>beep</term>
|
||||
|
||||
<listitem><para>Takes a boolean argument. If timeout enabled beep every second, otherwise beep n times when n-th entry in boot menu is selected (default disabled).
|
||||
Currently, only x86 is supported, where it uses the PC speaker.</para>
|
||||
<listitem><para>Takes a boolean argument. If timeout enabled beep every second, otherwise beep n
|
||||
times when n-th entry in boot menu is selected (default disabled). Currently, only x86 is supported,
|
||||
where it uses the PC speaker.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v251"/></listitem>
|
||||
</varlistentry>
|
||||
@@ -402,8 +406,8 @@ sbvarsign --attr "${attr}" --key KEK.key --cert KEK.pem --output db.auth db db.e
|
||||
<listitem><para>Caveat: This feature is experimental, and is likely to be changed (or removed in its
|
||||
current form) in a future version of systemd.</para>
|
||||
|
||||
<para>Work around BitLocker requiring a recovery key when the boot loader was
|
||||
updated (disabled by default).</para>
|
||||
<para>Work around BitLocker requiring a recovery key when the boot loader was updated (disabled by
|
||||
default).</para>
|
||||
|
||||
<para>Try to detect BitLocker encrypted drives along with an active TPM. If both are found and
|
||||
Windows Boot Manager is selected in the boot menu, set the <literal>BootNext</literal> EFI variable
|
||||
@@ -442,8 +446,11 @@ sbvarsign --attr "${attr}" --key KEK.key --cert KEK.pem --output db.auth db db.e
|
||||
<varlistentry>
|
||||
<term><option>auto</option></term>
|
||||
<listitem>
|
||||
<para>Perform the reboot if and only if boot counting is enabled for this entry and the tries left counter wasn't already at 0.</para>
|
||||
<para>This is the default, as it is typically a safe option, that ensures a clean measurement log on each boot attempt, but also does not risk an unbounded reboot loop.</para>
|
||||
<para>Perform the reboot if and only if boot counting is enabled for this entry and the tries
|
||||
left counter wasn't already at 0.</para>
|
||||
|
||||
<para>This is the default, as it is typically a safe option, that ensures a clean measurement log
|
||||
on each boot attempt, but also does not risk an unbounded reboot loop.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -149,6 +149,8 @@
|
||||
<term><keycap>d</keycap></term>
|
||||
<listitem><para>Make selected entry the default</para>
|
||||
|
||||
<para>An EFI variable is set to allow this setting to persist.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v239"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -164,6 +166,8 @@
|
||||
<term><keycap>t</keycap></term>
|
||||
<listitem><para>Increase the timeout before default entry is booted</para>
|
||||
|
||||
<para>An EFI variable is set to allow this setting to persist.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v239"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -172,6 +176,8 @@
|
||||
<term><keycap>T</keycap></term>
|
||||
<listitem><para>Decrease the timeout</para>
|
||||
|
||||
<para>An EFI variable is set to allow this setting to persist.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v239"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -179,6 +185,8 @@
|
||||
<term><keycap>r</keycap></term>
|
||||
<listitem><para>Change screen resolution, skipping any unsupported modes.</para>
|
||||
|
||||
<para>An EFI variable is set to allow this setting to persist.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v250"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -186,6 +194,8 @@
|
||||
<term><keycap>R</keycap></term>
|
||||
<listitem><para>Reset screen resolution to firmware or configuration file default.</para>
|
||||
|
||||
<para>An EFI variable is set to allow this setting to persist.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v250"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -280,15 +290,15 @@
|
||||
</variablelist>
|
||||
|
||||
<para>The boot menu is shown when a non-zero menu timeout has been configured. If the menu timeout has
|
||||
been set to zero, it is sufficient to press any key — before the boot loader initializes — to bring up
|
||||
the boot menu, except for the keys listed immediately above as they directly boot into the selected boot
|
||||
menu item. Note that depending on the firmware implementation the time window where key presses are
|
||||
accepted before the boot loader initializes might be short. If the window is missed, reboot and try
|
||||
again, possibly pressing a suitable key (e.g. the space bar) continuously; on most systems it should be
|
||||
possible to hit the time window after a few attempts. To avoid this problem, consider setting a non-zero
|
||||
timeout, thus showing the boot menu unconditionally. Some desktop environments might offer an option to
|
||||
directly boot into the boot menu, to avoid the problem altogether. Alternatively, use the command line
|
||||
<command>systemctl reboot --boot-loader-menu=0</command> from the shell.</para>
|
||||
been set to zero, hold down a key (<keycap>space</keycap> is recommended) before the boot loader
|
||||
initializes to bring up the boot menu. Note that depending on the firmware implementation the time window
|
||||
where key presses are accepted before the boot loader initializes might be short. If the window is
|
||||
missed, reboot and try again, possibly repeatedly pressing a suitable key; on most systems it should be
|
||||
possible to hit the time window after a few attempts. Keys other than the space bar may be used, except
|
||||
for the keys listed above. If showing the menu on demand doesn't work well, consider setting a non-zero
|
||||
timeout to show the boot menu unconditionally. Some desktop environments might offer an option to boot
|
||||
directly into the boot menu, which also avoids the problem altogether. Alternatively, use the command
|
||||
line <command>systemctl reboot --boot-loader-menu=</command> with a non-zero value from the shell.</para>
|
||||
|
||||
<para>In the editor, most keys simply insert themselves, but the following keys
|
||||
may be used to perform additional actions:</para>
|
||||
@@ -389,16 +399,16 @@
|
||||
<refsect1>
|
||||
<title>EFI Variables</title>
|
||||
|
||||
<para>The following EFI variables are defined, set and read by <command>systemd-boot</command>, under the
|
||||
vendor UUID <literal>4a67b082-0a4c-41cf-b6c7-440b29bb8c4f</literal>, for communication between the boot
|
||||
loader and the OS:</para>
|
||||
<para>The following EFI variables are defined, and may be set or read by <command>systemd-boot</command>
|
||||
for communication between the boot loader and the OS. The vendor UUID
|
||||
<literal>4a67b082-0a4c-41cf-b6c7-440b29bb8c4f</literal> is used in all cases.</para>
|
||||
|
||||
<variablelist class='efi-variables'>
|
||||
<varlistentry>
|
||||
<term><varname>LoaderBootCountPath</varname></term>
|
||||
<listitem><para>If boot counting is enabled, contains the path to the file in whose name the boot counters are
|
||||
encoded. Set by the boot
|
||||
loader. <citerefentry><refentrytitle>systemd-bless-boot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
<listitem><para>If boot counting is enabled, contains the path to the file in whose name the boot
|
||||
counters are encoded. Set by the boot loader.
|
||||
<citerefentry><refentrytitle>systemd-bless-boot.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>
|
||||
uses this information to mark a boot as successful as determined by the successful activation of the
|
||||
<filename>boot-complete.target</filename> target unit.</para>
|
||||
|
||||
@@ -465,13 +475,13 @@
|
||||
<term><varname>LoaderEntrySysFail</varname></term>
|
||||
<term><varname>LoaderEntryOneShot</varname></term>
|
||||
|
||||
<listitem><para>The identifier of the default boot loader entry. Set primarily by the OS and read by the boot
|
||||
<listitem><para>The identifier of the default boot loader entry. Can be set in the OS and the boot
|
||||
loader. <varname>LoaderEntryOneShot</varname> sets the default entry for the next boot only, while
|
||||
<varname>LoaderEntryDefault</varname> sets it persistently for all future
|
||||
boots. <citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
|
||||
<option>set-default</option> and <option>set-oneshot</option> commands make use of these variables. The boot
|
||||
loader modifies <varname>LoaderEntryDefault</varname> on request, when the <keycap>d</keycap> key is used, see
|
||||
above.</para>
|
||||
<varname>LoaderEntryDefault</varname> sets it persistently for all future boots.
|
||||
<citerefentry><refentrytitle>bootctl</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
|
||||
<option>set-default</option> and <option>set-oneshot</option> commands make use of these variables.
|
||||
The boot loader modifies <varname>LoaderEntryDefault</varname> on request, when the
|
||||
<keycap>d</keycap> key is used, see above.</para>
|
||||
|
||||
<xi:include href="version-info.xml" xpointer="v240"/></listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -83,6 +83,17 @@ static int status_entries(
|
||||
printf(", %s$BOOT%s", ansi_green(), ansi_normal());
|
||||
printf(")");
|
||||
|
||||
if (config->loader_conf_status != 0) {
|
||||
assert(esp_path);
|
||||
printf("\n config: %s%s/%s%s",
|
||||
ansi_grey(), esp_path, ansi_normal(), "/loader/loader.conf");
|
||||
if (config->loader_conf_status < 0)
|
||||
printf(": %s%s%s",
|
||||
config->loader_conf_status == -ENOENT ? ansi_grey() : ansi_highlight_yellow(),
|
||||
STRERROR(config->loader_conf_status),
|
||||
ansi_normal());
|
||||
}
|
||||
|
||||
if (xbootldr_path) {
|
||||
printf("\n XBOOTLDR: %s (", xbootldr_path);
|
||||
if (!sd_id128_is_null(xbootldr_partition_uuid))
|
||||
|
||||
@@ -533,6 +533,7 @@ static int boot_loader_read_conf_path(BootConfig *config, const char *root, cons
|
||||
assert(path);
|
||||
|
||||
r = chase_and_fopen_unlocked(path, root, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, "re", &full, &f);
|
||||
config->loader_conf_status = r < 0 ? r : true;
|
||||
if (r == -ENOENT)
|
||||
return 0;
|
||||
if (r < 0)
|
||||
|
||||
@@ -67,6 +67,8 @@ typedef struct BootEntry {
|
||||
}
|
||||
|
||||
typedef struct BootConfig {
|
||||
int loader_conf_status; /* 0 → before loading, 1 → loaded, negative → error. */
|
||||
|
||||
char *default_pattern;
|
||||
|
||||
char *entry_oneshot;
|
||||
|
||||
Reference in New Issue
Block a user