]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: deprecate --make-machine-id-directory=auto 21807/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 17 Dec 2021 17:37:08 +0000 (18:37 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 17 Dec 2021 17:48:08 +0000 (18:48 +0100)
Now that kernel-install creates the machine-id directory, we don't need to do
this is 'bootctl install', and in fact it's better not to do this since it
might never be necessary. So let's change the default behaviour to 'no'.

I kept support for 'auto' to maintain backwards compatibility, even though the
default was changed. Previous behaviour can be requested by specifying
--make-machine-id-directory=auto.

man/bootctl.xml
src/boot/bootctl.c

index 91dbb3a6e864b630b7f6ed515f7decb2b3a58973..16c498579680d5819ea69f02c2bd30be2d399394 100644 (file)
       </varlistentry>
 
       <varlistentry>
-        <term><option>--make-machine-id-directory=yes|no|auto</option></term>
+        <term><option>--make-machine-id-directory=yes|no</option></term>
         <listitem><para>Control creation and deletion of the top-level machine ID directory on the file
         system containing boot loader entries (i.e. beneath the file system returned by the
         <option>--print-boot-path</option> option, see above) during <option>install</option> and
-        <option>remove</option>, respectively.  <literal>auto</literal> is equivalent to
-        <literal>yes</literal> if <filename>/etc/machine-id</filename> resides on a filesystem other than
-        tmpfs and <literal>no</literal> otherwise (in the latter case the machine ID is likely transient and
-        hence should not be used persistently in the ESP). Defaults to <literal>auto</literal>. See
+        <option>remove</option>, respectively. Defaults to <literal>no</literal>. See
         <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> for
         details about the machine ID concept and file.</para>
 
index 8f89a309e8230bc6c45238f133b4ec40e39f3796..e1e56cf923e9dbb2040a69138fcf6b7e389312c4 100644 (file)
@@ -55,7 +55,7 @@ static bool arg_print_dollar_boot_path = false;
 static bool arg_touch_variables = true;
 static PagerFlags arg_pager_flags = 0;
 static bool arg_graceful = false;
-static int arg_make_machine_id_directory = -1;
+static int arg_make_machine_id_directory = 0;
 static sd_id128_t arg_machine_id = SD_ID128_NULL;
 static char *arg_install_layout = NULL;
 
@@ -1347,8 +1347,8 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case ARG_MAKE_MACHINE_ID_DIRECTORY:
-                        if (streq(optarg, "auto"))
-                                arg_make_machine_id_directory = -1;  /* default */
+                        if (streq(optarg, "auto"))  /* retained for backwards compatibility */
+                                arg_make_machine_id_directory = -1; /* yes if machine-id is permanent */
                         else {
                                 r = parse_boolean_argument("--make-machine-id-directory=", optarg, &b);
                                 if (r < 0)