diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-03-12 20:13:29 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-03-13 17:06:24 +0100 |
commit | cc5957dca055bfdc6df24af47f6687d1ba1a3d7a (patch) | |
tree | 73daf12eea3d439dfc7261be5aa3405cee2cdb7e /src | |
parent | 0ae4456c93384191b2cc884fdc7542c8c869cdca (diff) | |
download | systemd-cc5957dca055bfdc6df24af47f6687d1ba1a3d7a.tar.gz systemd-cc5957dca055bfdc6df24af47f6687d1ba1a3d7a.tar.bz2 systemd-cc5957dca055bfdc6df24af47f6687d1ba1a3d7a.zip |
bootspec: don't log in boot_entries_load_config_auto() about no ESP
Let's do it in the caller instead. That way, logind can stay silent
about it.
Fixes: #11950
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-dbus.c | 4 | ||||
-rw-r--r-- | src/shared/bootspec.c | 4 | ||||
-rw-r--r-- | src/systemctl/systemctl.c | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index a3b8f43346..1207193b7f 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -2798,7 +2798,7 @@ static int boot_loader_entry_exists(const char *id) { assert(id); r = boot_entries_load_config_auto(NULL, NULL, &config); - if (r < 0) + if (r < 0 && r != -ENOKEY) /* don't complain if no GPT is found, hence skip ENOKEY */ return r; (void) boot_entries_augment_from_loader(&config, true); @@ -2953,7 +2953,7 @@ static int property_get_boot_loader_entries( assert(userdata); r = boot_entries_load_config_auto(NULL, NULL, &config); - if (r < 0) + if (r < 0 && r != -ENOKEY) /* don't complain if there's no GPT found */ return r; (void) boot_entries_augment_from_loader(&config, true); diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index f2b919b6bb..59930464bc 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -712,9 +712,7 @@ int boot_entries_load_config_auto( } r = find_esp_and_warn(override_esp_path, false, &esp_where, NULL, NULL, NULL, NULL); - if (r == -ENOKEY) /* find_esp_and_warn() doesn't warn about this case */ - return log_error_errno(r, "Cannot find the ESP partition mount point."); - if (r < 0) /* But it logs about all these cases, hence don't log here again */ + if (r < 0) /* we don't log about ENOKEY here, but propagate it, leaving it to the caller to log */ return r; r = find_xbootldr_and_warn(override_xbootldr_path, false, &xbootldr_where, NULL); diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 7f6196328b..23818a0db1 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3591,6 +3591,8 @@ static int load_kexec_kernel(void) { return log_error_errno(errno, KEXEC" is not available: %m"); r = boot_entries_load_config_auto(NULL, NULL, &config); + if (r == -ENOKEY) /* The call doesn't log about ENOKEY, let's do so here. */ + return log_error_errno(r, "Cannot find the ESP partition mount point."); if (r < 0) return r; |