]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: $KERNEL_INSTALL_MACHINE_ID + $KERNEL_INSTALL_LAYOUT are deprecated
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Mar 2022 15:56:52 +0000 (16:56 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 21 Mar 2022 22:50:17 +0000 (23:50 +0100)
Let's add a comment about this, and generate log messages if these
fields are actually used.

src/boot/bootctl.c

index a1d5af8c21f0381353573995578c76770a41e7ab..b1fdd69294d91f971245b4d36bb25adb49b48860 100644 (file)
@@ -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);
         }