From 2b197967bf251ecf58b93fed0f51b9d4cd83fda4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jan 2023 18:29:13 +0100 Subject: [PATCH 1/5] bootctl: drop full stop at end of --help texts We never do that, don't do so here either. --- src/boot/bootctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 14a692ad1bd..e2ca484739c 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -155,8 +155,8 @@ static int help(int argc, char *argv[], void *userdata) { " is-installed Test whether systemd-boot is installed in the ESP\n" " random-seed Initialize random seed in ESP and EFI variables\n" "\n%3$skernel Commands:%4$s\n" - " kernel-identify Identify kernel image type.\n" - " kernel-inspect Prints details about the kernel.\n" + " kernel-identify Identify kernel image type\n" + " kernel-inspect Prints details about the kernel\n" "\n%3$sOptions:%4$s\n" " -h --help Show this help\n" " --version Print version\n" From 1e7d6cc07211de425bcc5c408c1f4376d6717305 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jan 2023 18:30:06 +0100 Subject: [PATCH 2/5] bootctl: change section title for kernel image commands Let's call them kernel *images*, not just *kernels*. --- man/bootctl.xml | 2 +- src/boot/bootctl.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index ada8c03332c..a5a3e6b307b 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -233,7 +233,7 @@ - <command>kernel</command> Commands + Kernel Image Commands diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index e2ca484739c..ff2f7c33421 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -154,9 +154,9 @@ static int help(int argc, char *argv[], void *userdata) { " remove Remove systemd-boot from the ESP and EFI variables\n" " is-installed Test whether systemd-boot is installed in the ESP\n" " random-seed Initialize random seed in ESP and EFI variables\n" - "\n%3$skernel Commands:%4$s\n" + "\n%3$sKernel Image Commands:%4$s\n" " kernel-identify Identify kernel image type\n" - " kernel-inspect Prints details about the kernel\n" + " kernel-inspect Prints details about the kernel image\n" "\n%3$sOptions:%4$s\n" " -h --help Show this help\n" " --version Print version\n" From 5bbf72bb9ed57db851abaae7265b926497ca41ca Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jan 2023 18:30:47 +0100 Subject: [PATCH 3/5] bootctl: realign column in --help text for some reason the descriptions of the switches and the commands weren't aligned, one space off. Fix that. --- src/boot/bootctl.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index ff2f7c33421..5ce5cb042e9 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -134,29 +134,29 @@ static int help(int argc, char *argv[], void *userdata) { printf("%1$s [OPTIONS...] COMMAND ...\n" "\n%5$sControl EFI firmware boot settings and manage boot loader.%6$s\n" "\n%3$sGeneric EFI Firmware/Boot Loader Commands:%4$s\n" - " status Show status of installed boot loader and EFI variables\n" + " status Show status of installed boot loader and EFI variables\n" " reboot-to-firmware [BOOL]\n" - " Query or set reboot-to-firmware EFI flag\n" + " Query or set reboot-to-firmware EFI flag\n" " systemd-efi-options [STRING]\n" - " Query or set system options string in EFI variable\n" + " Query or set system options string in EFI variable\n" "\n%3$sBoot Loader Specification Commands:%4$s\n" - " list List boot loader entries\n" - " set-default ID Set default boot loader entry\n" - " set-oneshot ID Set default boot loader entry, for next boot only\n" - " set-timeout SECONDS Set the menu timeout\n" + " list List boot loader entries\n" + " set-default ID Set default boot loader entry\n" + " set-oneshot ID Set default boot loader entry, for next boot only\n" + " set-timeout SECONDS Set the menu timeout\n" " set-timeout-oneshot SECONDS\n" - " Set the menu timeout for the next boot only\n" - " unlink ID Remove boot loader entry\n" - " cleanup Remove files in ESP not referenced in any boot entry\n" + " Set the menu timeout for the next boot only\n" + " unlink ID Remove boot loader entry\n" + " cleanup Remove files in ESP not referenced in any boot entry\n" "\n%3$ssystemd-boot Commands:%4$s\n" - " install Install systemd-boot to the ESP and EFI variables\n" - " update Update systemd-boot in the ESP and EFI variables\n" - " remove Remove systemd-boot from the ESP and EFI variables\n" - " is-installed Test whether systemd-boot is installed in the ESP\n" - " random-seed Initialize random seed in ESP and EFI variables\n" + " install Install systemd-boot to the ESP and EFI variables\n" + " update Update systemd-boot in the ESP and EFI variables\n" + " remove Remove systemd-boot from the ESP and EFI variables\n" + " is-installed Test whether systemd-boot is installed in the ESP\n" + " random-seed Initialize random seed in ESP and EFI variables\n" "\n%3$sKernel Image Commands:%4$s\n" - " kernel-identify Identify kernel image type\n" - " kernel-inspect Prints details about the kernel image\n" + " kernel-identify Identify kernel image type\n" + " kernel-inspect Prints details about the kernel image\n" "\n%3$sOptions:%4$s\n" " -h --help Show this help\n" " --version Print version\n" From eab7061898bcd1f2db77bc0a732003bbb2abc67b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jan 2023 18:36:31 +0100 Subject: [PATCH 4/5] bootctl: split out boot loader spec + boot loader interface commands in --help text grub (at least on fedora) nowadays implements the boot loader spec, but not the boot loader interface. Hence let's split out the commands specific to each in two groups in the --help text. This way the first group just covers boot lodaer spec stuff (i.e. stuff on disk in the ESP/XBOOTLDR partition). And the other covers talking to the boot loader via EFI var. --- man/bootctl.xml | 48 +++++++++++++++++++++++++++++----------------- src/boot/bootctl.c | 5 +++-- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index a5a3e6b307b..52c9179cd0f 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -85,9 +85,10 @@ Boot Loader Specification Commands - These commands are available for all boot loaders that implement the Boot Loader Specification and/or the Boot Loader Interface, such as + These commands are available for all boot loaders that + implement the Boot + Loader Specification, such as systemd-boot. @@ -104,6 +105,32 @@ + + ID + + Removes a boot loader entry including the files it refers to. Takes a single boot + loader entry ID string or a glob pattern as argument. Referenced files such as kernel or initrd are + only removed if no other entry refers to them. + + + + + + Removes files from the ESP and XBOOTLDR partitions that belong to the entry token but + are not referenced in any boot loader entries. + + + + + + Boot Loader Interface Commands + + These commands are available for all boot loaders that implement the Boot Loader Specification and the Boot Loader Interface, such as + systemd-boot. + + ID ID @@ -153,21 +180,6 @@ disables the timeout while always showing the menu. When an empty string ("") is specified the bootloader will revert to its default menu timeout. - - - ID - - Removes a boot loader entry including the files it refers to. Takes a single boot - loader entry ID string or a glob pattern as argument. Referenced files such as kernel or initrd are - only removed if no other entry refers to them. - - - - - - Removes files from the ESP and XBOOTLDR partitions that belong to the entry token but - are not referenced in any boot loader entries. - diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 5ce5cb042e9..ee8d5c6e61d 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -141,13 +141,14 @@ static int help(int argc, char *argv[], void *userdata) { " Query or set system options string in EFI variable\n" "\n%3$sBoot Loader Specification Commands:%4$s\n" " list List boot loader entries\n" + " unlink ID Remove boot loader entry\n" + " cleanup Remove files in ESP not referenced in any boot entry\n" + "\n%3$sBoot Loader Interface Commands:%4$s\n" " set-default ID Set default boot loader entry\n" " set-oneshot ID Set default boot loader entry, for next boot only\n" " set-timeout SECONDS Set the menu timeout\n" " set-timeout-oneshot SECONDS\n" " Set the menu timeout for the next boot only\n" - " unlink ID Remove boot loader entry\n" - " cleanup Remove files in ESP not referenced in any boot entry\n" "\n%3$ssystemd-boot Commands:%4$s\n" " install Install systemd-boot to the ESP and EFI variables\n" " update Update systemd-boot in the ESP and EFI variables\n" From e684d2d5f85a82ed47eb063809145540df01ae1a Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 20 Jan 2023 18:40:57 +0100 Subject: [PATCH 5/5] bootctl: remove space that should not be there --- src/boot/bootctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index ee8d5c6e61d..914825564eb 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -131,7 +131,7 @@ static int help(int argc, char *argv[], void *userdata) { if (r < 0) return log_oom(); - printf("%1$s [OPTIONS...] COMMAND ...\n" + printf("%1$s [OPTIONS...] COMMAND ...\n" "\n%5$sControl EFI firmware boot settings and manage boot loader.%6$s\n" "\n%3$sGeneric EFI Firmware/Boot Loader Commands:%4$s\n" " status Show status of installed boot loader and EFI variables\n"