SYSTEMD-BLESS-BOOT.SERVICE(8)

๐Ÿ’… SYSTEMD-BLESS-BOOT.SERVICE(8) โ€” bestie edition ๐ŸŽ€

okay so we're talking about systemd-bless-boot.service and systemd-bless-boot today, and honestly? it's giving "the finishing touch on your boot" โœจ (that (8) is just the manual section, don't worry about it ๐Ÿ’–)


๐ŸŒธ NAME ๐ŸŒธ

systemd-bless-boot.service, systemd-bless-boot โ€” marks the current boot process as successful. that's it, that's the vibe. ๐Ÿ‘‘


โœจ SYNOPSIS โœจ

systemd-bless-boot.service

/usr/lib/systemd/systemd-bless-boot

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so systemd-bless-boot.service is a system service whose whole personality is marking the current boot process as successful. no cap. it gets automatically pulled into the initial transaction when systemd-bless-boot-generator(8) detects that systemd-boot(7) style boot counting is being used. it just shows up. main character energy.

internally, the service operates based on the LoaderBootCountPath EFI variable (vendor UUID 4a67b082-0a4c-41cf-b6c7-440b29bb8c4f), which gets passed from the boot loader to the OS. ๐Ÿ’ซ this variable contains a file system path (relative to the EFI system partition) of the UAPI.1 Boot Loader Specification compliant boot loader entry file or unified kernel image file that was used to boot up the system.

systemd-bless-boot.service then removes the two "tries done" and "tries left" numeric boot counters from the filename ๐Ÿ˜Œ which signals to future invocations of the boot loader that this entry has completed booting successfully at least once. (this service will hence rename the boot loader entry file or unified kernel image file on the first successful boot โ€” iconic behaviour, honestly.)


๐Ÿ’… OPTIONS ๐Ÿ’…

the /usr/lib/systemd/systemd-bless-boot executable may also be invoked from the command line, and it takes one of these command arguments:

  • status โ€” shows the current status of the boot loader entry file or unified kernel image file. ๐ŸŽ€ it outputs one of "good", "bad", "indeterminate", "clean", "dirty", depending on the state and previous invocations of the command. the string "indeterminate" is shown initially after boot, before it has been marked as "good" or "bad". the string "good" is shown after the boot was marked as "good" with the good command below, and "bad" conversely after the bad command was invoked. the string "clean" is returned when boot counting is currently not in effect (which includes the case where the current entry was already marked as persistently good ๐ŸŒˆ). the string "dirty" is returned when the system is booted up with a known-bad kernel (i.e. one where the tries left counter has previously reached zero already ๐Ÿ’€).

this command is implied if no command argument is specified. so like, it's the default, she's always ready.

added in version 240.

  • good โ€” when invoked, the current boot loader entry file or unified kernel image file will be marked as "good", executing the file rename operation described above. ๐Ÿซถ this command is intended to be invoked at the end of a successful boot. the systemd-bless-boot.service unit invokes this command.

added in version 240.

  • bad โ€” when called, the "tries left" counter in the boot loader entry file name or unified kernel image file name is set to zero, marking the boot loader entry or kernel image as "bad" ๐Ÿ˜ญ so that the boot loader will not consider it anymore on future boots (at least as long as there are other entries available that are not marked "bad" yet). this command is normally not executed, but it can be used to instantly put an end to the boot counting logic if a problem is detected, and to persistently mark the boot entry as bad. dramatic but valid.

added in version 240.

  • indeterminate โ€” this command undoes any marking of the current boot loader entry file or unified kernel image file as good or bad ๐Ÿ™ˆ. it's implemented by renaming the boot loader entry file or unified kernel image file back to the path encoded in the LoaderBootCountPath EFI variable. note that this operation will fail if the current kernel is not booted with boot counting enabled (i.e. if the EFI variable is not set). also, if the boot counter already reached zero tries left on a previous boot, this operation will fail too: once an entry is marked bad it can only be reset to good again, but not to indeterminate. so likeโ€ฆ no take-backsies on bad. ๐Ÿ˜ฌ

added in version 240.

  • -h, --help โ€” print a short help text and exit. cute and quick ๐Ÿฆ‹
  • --version โ€” print a short version string and exit. โญ

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

systemd(1), systemd-boot(7), systemd.special(7)


๐Ÿ“ NOTES ๐Ÿ“

  1. UAPI.1 Boot Loader Specification https://uapi-group.org/specifications/specs/boot_loader_specification

bestie reminder: indeterminate and good are your only reset options once things go sideways โ€” bad is forever-ish. choose wisely ๐Ÿงš

and that's the whole page, no notes ๐Ÿ“ this little writeup is brought to you by systemd 261.3 โ€” mwah, slay, periodt ๐Ÿ’œ

๐Ÿ“ฆ where this page comes from