summaryrefslogtreecommitdiff
path: root/src/boot/bootctl-util.c
diff options
context:
space:
mode:
authorLudwig Nussel <ludwig.nussel@suse.de>2022-12-27 15:28:27 +0100
committerLennart Poettering <lennart@poettering.net>2023-01-10 15:17:07 +0100
commit2e76ca79b344b94e6f973e2ef2a8fc2e17dfb03f (patch)
tree29df2b20fcefcaf2daf44ec44a0936b31b5c6af4 /src/boot/bootctl-util.c
parentcd48e23f6a33c9acb47a06b99d9bdc84ee42cebe (diff)
downloadsystemd-2e76ca79b344b94e6f973e2ef2a8fc2e17dfb03f.tar.gz
bootctl: honor $KERNEL_INSTALL_CONF_ROOT
Honor $KERNEL_INSTALL_CONF_ROOT for reading config files, as kernel-install does.
Diffstat (limited to 'src/boot/bootctl-util.c')
-rw-r--r--src/boot/bootctl-util.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/boot/bootctl-util.c b/src/boot/bootctl-util.c
index b11742a7ae..859742a126 100644
--- a/src/boot/bootctl-util.c
+++ b/src/boot/bootctl-util.c
@@ -6,6 +6,7 @@
#include "bootctl-util.h"
#include "fileio.h"
#include "os-util.h"
+#include "path-util.h"
#include "stat-util.h"
#include "sync-util.h"
#include "utf8.h"
@@ -118,10 +119,13 @@ int settle_entry_token(void) {
switch (arg_entry_token_type) {
case ARG_ENTRY_TOKEN_AUTO: {
- _cleanup_free_ char *buf = NULL;
- r = read_one_line_file("/etc/kernel/entry-token", &buf);
+ _cleanup_free_ char *buf = NULL, *p = NULL;
+ p = path_join(etc_kernel(), "entry-token");
+ if (!p)
+ return log_oom();
+ r = read_one_line_file(p, &buf);
if (r < 0 && r != -ENOENT)
- return log_error_errno(r, "Failed to read /etc/kernel/entry-token: %m");
+ return log_error_errno(r, "Failed to read %s: %m", p);
if (!isempty(buf)) {
free_and_replace(arg_entry_token, buf);