Debian Codegraph @

man/systemd-bless-boot.service.xml

raw
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd-bless-boot.service" conditional='ENABLE_BOOTLOADER HAVE_BLKID'
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>systemd-bless-boot.service</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-bless-boot.service</refentrytitle>
16 <manvolnum>8</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-bless-boot.service</refname>
21 <refname>systemd-bless-boot</refname>
22 <refpurpose>Mark current boot process as successful</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <para><filename>systemd-bless-boot.service</filename></para>
27 <para><filename>/usr/lib/systemd/systemd-bless-boot</filename></para>
28 </refsynopsisdiv>
29
30 <refsect1>
31 <title>Description</title>
32
33 <para><filename>systemd-bless-boot.service</filename> is a system service that marks the current boot process as
34 successful. It's automatically pulled into the initial transaction when
35 <citerefentry><refentrytitle>systemd-bless-boot-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
36 detects that <citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry> style
37 boot counting is used.</para>
38
39 <para>Internally, the service operates based on the <varname>LoaderBootCountPath</varname> EFI variable
40 (of the vendor UUID <constant>4a67b082-0a4c-41cf-b6c7-440b29bb8c4f</constant>), which is passed from the
41 boot loader to the OS. It contains a file system path (relative to the EFI system partition) of the
42 <ulink url="https://uapi-group.org/specifications/specs/boot_loader_specification">UAPI.1 Boot Loader
43 Specification</ulink> compliant boot loader entry file or unified kernel image file that was used to boot
44 up the system. <command>systemd-bless-boot.service</command> removes the two "tries done" and "tries
45 left" numeric boot counters from the filename, which indicates to future invocations of the boot loader
46 that the entry has completed booting successfully at least once. (This service will hence rename the boot
47 loader entry file or unified kernel image file on the first successful boot.)</para>
48 </refsect1>
49
50 <refsect1>
51 <title>Options</title>
52
53 <para>The <filename>/usr/lib/systemd/systemd-bless-boot</filename> executable may also be invoked from the
54 command line, taking one of the following command arguments:</para>
55
56 <variablelist>
57 <varlistentry>
58 <term><option>status</option></term>
59
60 <listitem><para>The current status of the boot loader entry file or unified kernel image file is
61 shown. This outputs one of <literal>good</literal>, <literal>bad</literal>,
62 <literal>indeterminate</literal>, <literal>clean</literal>, <literal>dirty</literal>, depending on
63 the state and previous invocations of the command. The string <literal>indeterminate</literal> is
64 shown initially after boot, before it has been marked as "good" or "bad". The string
65 <literal>good</literal> is shown after the boot was marked as "good" with the <option>good</option>
66 command below, and "bad" conversely after the <option>bad</option> command was invoked. The string
67 <literal>clean</literal> is returned when boot counting is currently not in effect (which includes
68 the case where the current entry was already marked as persistently good). The string
69 <literal>dirty</literal> is returned when the system is booted up with a known-bad kernel (i.e. one
70 where the tries left counter has previously reached zero already).</para>
71
72 <para>This command is implied if no command argument is specified.</para>
73
74 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
75 </varlistentry>
76
77 <varlistentry>
78 <term><option>good</option></term>
79
80 <listitem><para>When invoked, the current boot loader entry file or unified kernel image file will be marked as
81 "good", executing the file rename operation described above. This command is intended to be invoked at the end
82 of a successful boot. The <filename>systemd-bless-boot.service</filename> unit invokes this
83 command.</para>
84
85 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
86 </varlistentry>
87
88 <varlistentry>
89 <term><option>bad</option></term>
90
91 <listitem><para>When called the "tries left" counter in the boot loader entry file name or unified kernel image
92 file name is set to zero, marking the boot loader entry or kernel image as "bad", so that the boot loader will not
93 consider it anymore on future boots (at least as long as there are other entries available that are not marked
94 "bad" yet). This command is normally not executed, but can be used to instantly put an end to the boot counting
95 logic if a problem is detected and persistently mark the boot entry as bad.</para>
96
97 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
98 </varlistentry>
99
100 <varlistentry>
101 <term><option>indeterminate</option></term>
102
103 <listitem><para>This command undoes any marking of the current boot loader entry file or unified
104 kernel image file as good or bad. This is implemented by renaming the boot loader entry file or
105 unified kernel image file back to the path encoded in the <varname>LoaderBootCountPath</varname> EFI
106 variable. Note that operation will fail if the current kernel is not booted with boot counting
107 enabled (i.e. if the EFI variable is not set). If the boot counter already reached zero tries left on
108 a previous boot this operation will fail too: once an entry is marked <option>bad</option> it can
109 only be reset to <option>good</option> again, but not to <option>indeterminate</option>.</para>
110
111 <xi:include href="version-info.xml" xpointer="v240"/></listitem>
112 </varlistentry>
113
114 <xi:include href="standard-options.xml" xpointer="help" />
115 <xi:include href="standard-options.xml" xpointer="version" />
116
117 </variablelist>
118 </refsect1>
119
120 <refsect1>
121 <title>See Also</title>
122 <para><simplelist type="inline">
123 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
124 <member><citerefentry><refentrytitle>systemd-boot</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
125 <member><citerefentry><refentrytitle>systemd.special</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
126 </simplelist></para>
127 </refsect1>
128
129 </refentry>