From 976904bf26957e75dbed467334592badf108beee Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 2 Oct 2023 17:09:29 +0100 Subject: [PATCH 1/3] bootctl: remove all our non-volatile variables on uninstall Grepping around showed a few extra entries that are not listed in the remove_loader_variables() function. Namely: - BootNext - OsIndications - LoaderConfigConsoleMode - LoaderEntryLastBooted Of which the latter two are systemd specific, even though they are undocumented. Ensure they're removed - follow-up commits will add documentation references. Signed-off-by: Emil Velikov --- src/boot/bootctl-install.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/boot/bootctl-install.c b/src/boot/bootctl-install.c index ca14564a8e..e6f66deeab 100644 --- a/src/boot/bootctl-install.c +++ b/src/boot/bootctl-install.c @@ -972,9 +972,11 @@ static int remove_loader_variables(void) { /* Remove all persistent loader variables we define */ FOREACH_STRING(var, + EFI_LOADER_VARIABLE(LoaderConfigConsoleMode), EFI_LOADER_VARIABLE(LoaderConfigTimeout), EFI_LOADER_VARIABLE(LoaderConfigTimeoutOneShot), EFI_LOADER_VARIABLE(LoaderEntryDefault), + EFI_LOADER_VARIABLE(LoaderEntryLastBooted), EFI_LOADER_VARIABLE(LoaderEntryOneShot), EFI_LOADER_VARIABLE(LoaderSystemToken)){ From b207ad6344d565cfa844aa047223e13a4b5120dc Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 2 Oct 2023 17:31:36 +0100 Subject: [PATCH 2/3] man: document LoaderConfigConsoleMode The variable was introduced with systemd v250 although it went completely undocumented, even though sd-boot will honour and print it separately (from the loader.conf one) in the boot help screen. Document it in the systemd-boot and hint about it in loader.conf manual pages. Signed-off-by: Emil Velikov --- man/loader.conf.xml | 9 ++++++--- man/systemd-boot.xml | 9 +++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/man/loader.conf.xml b/man/loader.conf.xml index 9592f48247..c7794cd195 100644 --- a/man/loader.conf.xml +++ b/man/loader.conf.xml @@ -142,9 +142,12 @@ console-mode - This option configures the resolution of the console. Takes a - number or one of the special values listed below. The following values may be - used: + This option configures the resolution of the console. This may be changed in + the boot menu itself and will be stored as an EFI variable in that case, overriding this + option. + + Takes a number or one of the special values listed below. The following + values may be used: diff --git a/man/systemd-boot.xml b/man/systemd-boot.xml index def2d06cf1..67208806f9 100644 --- a/man/systemd-boot.xml +++ b/man/systemd-boot.xml @@ -416,6 +416,15 @@ + + LoaderConfigConsoleMode + The numerical menu console mode. Read by the boot loader. LoaderConfigConsoleMode + is maintained persistently. LoaderConfigConsoleMode may be manipulated with the + r/R keys, see above. + + + + LoaderDevicePartUUID From ef4976dc25a57ca4836a2937ba35bd5f7d487397 Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Mon, 2 Oct 2023 17:56:42 +0100 Subject: [PATCH 3/3] man: document LoaderEntryLastBooted The option was introduced with systemd v250 although it went undocumented. It effectively sits between Default and OneShot, in term of priority. It is repeatedly updated as long as loader.conf default is "@saved" and the OneShot is not set. v2: - squash some typos v3: - special mention to default @saved + loader.conf reference - reword update side, to avoid misleading that it's needlessly overwritten Signed-off-by: Emil Velikov --- man/systemd-boot.xml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/man/systemd-boot.xml b/man/systemd-boot.xml index 67208806f9..b6efd8927c 100644 --- a/man/systemd-boot.xml +++ b/man/systemd-boot.xml @@ -461,6 +461,27 @@ + + LoaderEntryLastBooted + + The identifier of the boot loader entry last attempted. Set and read by the boot loader, + only when /loader/loader.conf has default set to @saved. See + loader.conf5. + + The boot loader will ensure LoaderEntryLastBooted is up-to date for every boot, + updating it as needed and will omit changing it all together when LoaderEntryOneShot + is set. + + The boot loader reads the variable, which takes higher priority than + LoaderEntryDefault. The variable is ignored when LoaderEntryOneShot + is set. + + LoaderEntryLastBooted cannot be used as indication that the last boot was + successful or not. + + + + LoaderEntrySelected