自动启动评估

自动启动评估#

systemd provides support for automatically reverting back to the previous version of the OS or kernel in case the system consistently fails to boot. The UAPI.1 Boot Loader Specification describes how to annotate boot loader entries with a counter that specifies how many attempts should be made to boot it. This document describes how systemd implements this scheme.

The many different components involved in the implementation may be used independently and in combination with other software to, for example, support other boot loaders or take actions outside of the boot loader.

引导加载程序接口

引导加载程序接口#

systemd can interface with the boot loader to receive performance data and other information, and pass control information. This is only supported on EFI systems. Data is transferred between the boot loader and systemd in EFI variables. All EFI variables use the vendor UUID 4a67b082-0a4c-41cf-b6c7-440b29bb8c4f. Variables will be listed below using the Linux efivarfs naming, <name>-<vendoruuid>.

  • The EFI Variable LoaderTimeInitUSec-4a67b082-0a4c-41cf-b6c7-440b29bb8c4f contains the timestamp in microseconds when the loader was initialized. This value is the time spent in the firmware for initialization. It is formatted as numeric, NUL-terminated, decimal string, in UTF-16.

恢复出厂设置

恢复出厂设置#

In various scenarios it is important to be able to reset operating systems back into a “factory state”, i.e. where all state, user data and configuration is reset so that it resembles the system state when it was originally shipped.

systemd natively supports a concept of factory reset, that can both act as a specific implementation for UEFI based systems, as well as a series of hook points and a template for implementations on other systems.