From: Lennart Poettering Date: Thu, 17 Mar 2022 15:56:52 +0000 (+0100) Subject: bootctl: $KERNEL_INSTALL_MACHINE_ID + $KERNEL_INSTALL_LAYOUT are deprecated X-Git-Tag: v251-rc1~77^2~7 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea29abece9c80e56f6fd72abd041f274f1f687de;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index a1d5af8c21f..b1fdd69294d 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); }