summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-27 13:26:01 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-10-27 13:36:22 +0100
commit6bdcb72086b681a0d42521169fdadb65ef2ac539 (patch)
treec0b45576efe3afe073fbc9437b9a6429f6f22caa
parentd5816b6138be788f3d3ea72359bb28dc239c3235 (diff)
downloadsystemd-6bdcb72086b681a0d42521169fdadb65ef2ac539.tar.gz
Revert "units: add initrd-cryptsetup.target"
This reverts commit 6c5496c492a8d74e54d22bf8824160cab1e63c10. sysinit.target is shared between the initrd and the host system. Pulling in initrd-cryptsetup.target into sysinit.target causes the following warning at boot: Oct 27 10:42:30 workstation-uefi systemd[1]: initrd-cryptsetup.target: Starting requested but asserts failed. Oct 27 10:42:30 workstation-uefi systemd[1]: Assertion failed for initrd-cryptsetup.target.
-rw-r--r--man/systemd.special.xml21
-rw-r--r--src/cryptsetup/cryptsetup-generator.c15
-rw-r--r--units/initrd-cryptsetup.target17
-rw-r--r--units/meson.build2
4 files changed, 9 insertions, 46 deletions
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
index fe40da7fbe..1434ead7d5 100644
--- a/man/systemd.special.xml
+++ b/man/systemd.special.xml
@@ -41,7 +41,6 @@
<filename>hybrid-sleep.target</filename>,
<filename>suspend-then-hibernate.target</filename>,
<filename>initrd.target</filename>,
- <filename>initrd-cryptsetup.target</filename>,
<filename>initrd-fs.target</filename>,
<filename>initrd-root-device.target</filename>,
<filename>initrd-root-fs.target</filename>,
@@ -183,10 +182,8 @@
<varlistentry>
<term><filename>cryptsetup.target</filename></term>
<listitem>
- <para>A target that pulls in setup services for local encrypted block devices.
- See <filename>remote-cryptsetup.target</filename> below for the equivalent target for remote
- volumes, and <filename>initrd-cryptsetup.target</filename> below for the equivalent target in the
- initrd.</para>
+ <para>A target that pulls in setup services for all
+ encrypted block devices.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -355,21 +352,13 @@
<varlistentry>
<term><filename>initrd.target</filename></term>
<listitem>
- <para>This is the default target in the initrd, similar to <filename>default.target</filename>
+ <para>This is the default target in the initramfs, similar to <filename>default.target</filename>
in the main system. It is used to mount the real root and transition to it. See
<citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
more discussion.</para>
</listitem>
</varlistentry>
<varlistentry>
- <term><filename>initrd-cryptsetup.target</filename></term>
- <listitem>
- <para>A target that pulls in setup services for all encrypted block devices. See
- <filename>cryptsetup.target</filename> and <filename>remote-cryptsetup.target</filename> for the
- equivalent targets in the real root.</para>
- </listitem>
- </varlistentry>
- <varlistentry>
<term><filename>initrd-fs.target</filename></term>
<listitem>
<para><citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>3</manvolnum></citerefentry>
@@ -560,9 +549,7 @@
<para>Similar to <filename>cryptsetup.target</filename>, but for encrypted
devices which are accessed over the network. It is used for
<citerefentry><refentrytitle>crypttab</refentrytitle><manvolnum>8</manvolnum></citerefentry>
- entries marked with <option>_netdev</option>.
- See <filename>cryptsetup.target</filename> for the equivalent target for local volumes, and
- <filename>initrd-cryptsetup.target</filename> for the equivalent target in the initrd.</para>
+ entries marked with <option>_netdev</option>.</para>
</listitem>
</varlistentry>
<varlistentry>
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 13e9f3aedd..df589ec3e4 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -455,16 +455,10 @@ static int create_disk(
}
}
- const char *target;
- if (in_initrd())
- target = "initrd-cryptsetup.target";
- else if (netdev)
- target = "remote-cryptsetup.target";
- else
- target = "cryptsetup.target";
-
if (!nofail)
- fprintf(f, "Before=%s\n", target);
+ fprintf(f,
+ "Before=%s\n",
+ netdev ? "remote-cryptsetup.target" : "cryptsetup.target");
if (password && !keydev) {
r = print_dependencies(f, password);
@@ -527,7 +521,8 @@ static int create_disk(
return log_error_errno(r, "Failed to write unit file %s: %m", n);
if (!noauto) {
- r = generator_add_symlink(arg_dest, target,
+ r = generator_add_symlink(arg_dest,
+ netdev ? "remote-cryptsetup.target" : "cryptsetup.target",
nofail ? "wants" : "requires", n);
if (r < 0)
return r;
diff --git a/units/initrd-cryptsetup.target b/units/initrd-cryptsetup.target
deleted file mode 100644
index 2a2938c895..0000000000
--- a/units/initrd-cryptsetup.target
+++ /dev/null
@@ -1,17 +0,0 @@
-# SPDX-License-Identifier: LGPL-2.1+
-#
-# This file is part of systemd.
-#
-# systemd is free software; you can redistribute it and/or modify it
-# under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation; either version 2.1 of the License, or
-# (at your option) any later version.
-
-[Unit]
-Description=Initrd Encrypted Volumes
-Documentation=man:systemd.special(7)
-OnFailure=emergency.target
-OnFailureJobMode=replace-irreversibly
-AssertPathExists=/etc/initrd-release
-DefaultDependencies=no
-Conflicts=shutdown.target
diff --git a/units/meson.build b/units/meson.build
index 670f366b92..a8c52e96a7 100644
--- a/units/meson.build
+++ b/units/meson.build
@@ -28,8 +28,6 @@ units = [
['hybrid-sleep.target', 'ENABLE_HIBERNATE'],
['suspend-then-hibernate.target', 'ENABLE_HIBERNATE'],
['initrd-cleanup.service', 'ENABLE_INITRD'],
- ['initrd-cryptsetup.target', 'HAVE_LIBCRYPTSETUP ENABLE_INITRD',
- 'sysinit.target.wants/'],
['initrd-fs.target', 'ENABLE_INITRD'],
['initrd-parse-etc.service', 'ENABLE_INITRD'],
['initrd-root-device.target', 'ENABLE_INITRD'],