summaryrefslogtreecommitdiff
path: root/src/boot
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2023-04-06 12:17:18 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-04-07 10:34:34 +0200
commit05f70527326d0f6c61362ea93462d37dc701c98b (patch)
tree97f4490f394cf880ddfa6598018b5694b8b9b441 /src/boot
parent4bc14b1790752b6083861d370334ad438d859c54 (diff)
downloadsystemd-05f70527326d0f6c61362ea93462d37dc701c98b.tar.gz
bootctl: Gracefully handle missing bootloader directory
When --graceful is specified, let's gracefully deal with a missing bootloader directory.
Diffstat (limited to 'src/boot')
-rw-r--r--src/boot/bootctl-install.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/boot/bootctl-install.c b/src/boot/bootctl-install.c
index dc8596fa05..2dd50360ec 100644
--- a/src/boot/bootctl-install.c
+++ b/src/boot/bootctl-install.c
@@ -391,6 +391,10 @@ static int install_binaries(const char *esp_path, const char *arch, bool force)
/* If we had a root directory to try, we didn't find it and we are in auto mode, retry on the host */
if (r == -ENOENT && root && arg_install_source == ARG_INSTALL_SOURCE_AUTO)
r = chase_and_opendir(BOOTLIBDIR, NULL, CHASE_PREFIX_ROOT|CHASE_PROHIBIT_SYMLINKS, &path, &d);
+ if (r == -ENOENT && arg_graceful) {
+ log_debug("Source directory does not exist, ignoring.");
+ return 0;
+ }
if (r < 0)
return log_error_errno(r, "Failed to open boot loader directory %s%s: %m", strempty(root), BOOTLIBDIR);