summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-03-17 16:56:52 +0100
committerLennart Poettering <lennart@poettering.net>2022-03-21 23:50:17 +0100
commitea29abece9c80e56f6fd72abd041f274f1f687de (patch)
treed85cb1ee4cc07bd51cba27904b67794e8a3c108c
parenta321e0e4630518c547b42a1854d076a9fbe19a91 (diff)
downloadsystemd-ea29abece9c80e56f6fd72abd041f274f1f687de.tar.gz
bootctl: $KERNEL_INSTALL_MACHINE_ID + $KERNEL_INSTALL_LAYOUT are deprecated
Let's add a comment about this, and generate log messages if these fields are actually used.
-rw-r--r--src/boot/bootctl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index a1d5af8c21..b1fdd69294 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -145,11 +145,10 @@ static int acquire_xbootldr(
}
static int load_install_machine_id_and_layout(void) {
- /* Figure out the right machine-id for operations. If KERNEL_INSTALL_MACHINE_ID is configured in
- * /etc/machine-info, let's use that. Otherwise, just use the real machine-id.
- *
- * Also load KERNEL_INSTALL_LAYOUT.
- */
+ /* systemd v250 added support to store the kernel-install layout setting and the machine ID to use
+ * for setting up the ESP in /etc/machine-info. The newer /etc/kernel/entry-token file, as well as
+ * the $layout field in /etc/kernel/install.conf are better replacements for this though, hence this
+ * has been deprecated and is only returned for compatibility. */
_cleanup_free_ char *s = NULL, *layout = NULL;
int r;
@@ -164,6 +163,8 @@ static int load_install_machine_id_and_layout(void) {
if (r < 0 && !IN_SET(r, -ENOENT, -ENOMEDIUM))
return log_error_errno(r, "Failed to get machine-id: %m");
} else {
+ log_notice("Read $KERNEL_INSTALL_MACHINE_ID from /etc/machine-info. Please move it to /etc/kernel/entry-token.");
+
r = sd_id128_from_string(s, &arg_machine_id);
if (r < 0)
return log_error_errno(r, "Failed to parse KERNEL_INSTALL_MACHINE_ID=%s in /etc/machine-info: %m", s);
@@ -174,6 +175,8 @@ static int load_install_machine_id_and_layout(void) {
isempty(s) ? "/etc/machine_id" : "KERNEL_INSTALL_MACHINE_ID in /etc/machine-info");
if (!isempty(layout)) {
+ log_notice("Read $KERNEL_INSTALL_LAYOUT from /etc/machine-info. Please move it to the layout= setting of /etc/kernel/install.conf.");
+
log_debug("KERNEL_INSTALL_LAYOUT=%s is specified in /etc/machine-info.", layout);
arg_install_layout = TAKE_PTR(layout);
}