From 6f8adbad80f017dd753d65f1433e659c94b6e4de Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 24 May 2022 11:40:53 +0200 Subject: [PATCH] bootctl: Make sure bootctl install returns 0 on success This backports the same fix from 6e9165397faa1b546d367bdfc28dd4377a8f1d0a in systemd upstream that we can't backport directly because that commit introduces a new feature. (cherry picked from commit eb76587f33a08c91f025d4c7fa685c44f7b2d332) --- src/boot/bootctl.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index ebe2575126..7fd9baf3dd 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -1852,13 +1852,16 @@ static int verb_install(int argc, char *argv[], void *userdata) { (void) sync_everything(); - if (arg_touch_variables) - r = install_variables(arg_esp_path, - part, pstart, psize, uuid, - "/EFI/systemd/systemd-boot" EFI_MACHINE_TYPE_NAME ".efi", - install); + if (!arg_touch_variables) + return 0; - return r; + r = install_variables(arg_esp_path, part, pstart, psize, uuid, + "/EFI/systemd/systemd-boot" EFI_MACHINE_TYPE_NAME ".efi", + install); + if (r < 0) + return r; + + return 0; } static int verb_remove(int argc, char *argv[], void *userdata) {