From 18eb56c3c09f8d4a272d12500f74f21fa8457b8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 5 May 2022 12:15:46 +0200 Subject: [PATCH 1/2] bootctl: support --graceful in is-installed --- man/bootctl.xml | 3 ++- src/boot/bootctl.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index 99cef4c00a..630dac7d48 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -272,7 +272,8 @@ Ignore failure when the EFI System Partition cannot be found, when EFI variables cannot be written, or a different or newer boot loader is already installed. Currently only applies - to random seed and update operations. + to is-installed, update, and random-seed + verbs. diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 058dac5381..32a0c40aa5 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -2226,7 +2226,9 @@ static int verb_remove(int argc, char *argv[], void *userdata) { static int verb_is_installed(int argc, char *argv[], void *userdata) { int r; - r = acquire_esp(/* privileged_mode= */ false, /* graceful= */ false, NULL, NULL, NULL, NULL, NULL); + r = acquire_esp(/* privileged_mode= */ false, + /* graceful= */ arg_graceful, + NULL, NULL, NULL, NULL, NULL); if (r < 0) return r; From 14e6e444dd9eaa0db229548c31baecd75de4478e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 5 May 2022 12:28:32 +0200 Subject: [PATCH 2/2] bootctl: add --quiet It's useful for installation scripts and suchlike. Raised in https://bugzilla.redhat.com/show_bug.cgi?id=2079784#c9. --- man/bootctl.xml | 8 ++++++++ src/boot/bootctl.c | 28 +++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index 630dac7d48..1e6d537d0b 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -276,6 +276,14 @@ verbs. + + + + + Suppress printing of the results of various commands and also the hints about ESP + being unavailable. + + Controls creation and deletion of the 0) { - puts("yes"); + if (!arg_quiet) + puts("yes"); return EXIT_SUCCESS; } else { - puts("no"); + if (!arg_quiet) + puts("no"); return EXIT_FAILURE; } }