Harald Hoyer 2e2e24
From 700e07ffd53083114e91bb4ba646ed26d0463f67 Mon Sep 17 00:00:00 2001
Harald Hoyer 2e2e24
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2e2e24
Date: Mon, 4 Mar 2013 19:01:05 +0100
Harald Hoyer 2e2e24
Subject: [PATCH] add initrd-fs.target and root-fs.target
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
Instead of using local-fs*.target in the initrd, use root-fs.target for
Harald Hoyer 2e2e24
sysroot.mount and initrd-fs.target for /sysroot/usr and friends.
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
Using local-fs.target would mean to carry over the activated
Harald Hoyer 2e2e24
local-fs.target to the isolated initrd-switch-root.target and thus in
Harald Hoyer 2e2e24
the real root. Having local-fs.target already active after
Harald Hoyer 2e2e24
deserialization causes ordering problems with the real root services and
Harald Hoyer 2e2e24
targets.
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
We better isolate to targets for initrd-switch-root.target, which are
Harald Hoyer 2e2e24
only available in the initrd.
Harald Hoyer 2e2e24
---
Harald Hoyer 2e2e24
 Makefile.am                           |  2 +
Harald Hoyer 2e2e24
 man/systemd.special.xml               | 30 +++++++++++++
Harald Hoyer 2e2e24
 src/core/special.h                    |  2 +
Harald Hoyer 2e2e24
 src/fstab-generator/fstab-generator.c | 79 ++++++++++++++++++++---------------
Harald Hoyer 2e2e24
 units/initrd-cleanup.service.in       |  4 +-
Harald Hoyer 2e2e24
 units/initrd-fs.target                | 13 ++++++
Harald Hoyer 2e2e24
 units/initrd-parse-etc.service.in     |  6 +--
Harald Hoyer 2e2e24
 units/initrd-switch-root.target       |  4 +-
Harald Hoyer 2e2e24
 units/root-fs.target                  | 11 +++++
Harald Hoyer 2e2e24
 9 files changed, 110 insertions(+), 41 deletions(-)
Harald Hoyer 2e2e24
 create mode 100644 units/initrd-fs.target
Harald Hoyer 2e2e24
 create mode 100644 units/root-fs.target
Harald Hoyer 2e2e24
Harald Hoyer 2e2e24
diff --git a/Makefile.am b/Makefile.am
Harald Hoyer 2e2e24
index b6d3306..2a010c7 100644
Harald Hoyer 2e2e24
--- a/Makefile.am
Harald Hoyer 2e2e24
+++ b/Makefile.am
Harald Hoyer 2e2e24
@@ -347,6 +347,8 @@ dist_systemunit_DATA = \
Harald Hoyer 2e2e24
 	units/kexec.target \
Harald Hoyer 2e2e24
 	units/local-fs.target \
Harald Hoyer 2e2e24
 	units/local-fs-pre.target \
Harald Hoyer 2e2e24
+	units/initrd-fs.target \
Harald Hoyer 2e2e24
+	units/root-fs.target \
Harald Hoyer 2e2e24
 	units/remote-fs.target \
Harald Hoyer 2e2e24
 	units/remote-fs-pre.target \
Harald Hoyer 2e2e24
 	units/network.target \
Harald Hoyer 2e2e24
diff --git a/man/systemd.special.xml b/man/systemd.special.xml
Harald Hoyer 2e2e24
index 0d1df84..7b78099 100644
Harald Hoyer 2e2e24
--- a/man/systemd.special.xml
Harald Hoyer 2e2e24
+++ b/man/systemd.special.xml
Harald Hoyer 2e2e24
@@ -64,6 +64,7 @@
Harald Hoyer 2e2e24
                 <filename>halt.target</filename>,
Harald Hoyer 2e2e24
                 <filename>hibernate.target</filename>,
Harald Hoyer 2e2e24
                 <filename>hybrid-sleep.target</filename>,
Harald Hoyer 2e2e24
+                <filename>initrd-fs.target</filename>,
Harald Hoyer 2e2e24
                 <filename>kbrequest.target</filename>,
Harald Hoyer 2e2e24
                 <filename>kexec.target</filename>,
Harald Hoyer 2e2e24
                 <filename>local-fs.target</filename>,
Harald Hoyer 2e2e24
@@ -78,6 +79,7 @@
Harald Hoyer 2e2e24
                 <filename>remote-fs.target</filename>,
Harald Hoyer 2e2e24
                 <filename>remote-fs-pre.target</filename>,
Harald Hoyer 2e2e24
                 <filename>rescue.target</filename>,
Harald Hoyer 2e2e24
+                <filename>root-fs.target</filename>,
Harald Hoyer 2e2e24
                 <filename>rpcbind.target</filename>,
Harald Hoyer 2e2e24
                 <filename>runlevel2.target</filename>,
Harald Hoyer 2e2e24
                 <filename>runlevel3.target</filename>,
Harald Hoyer 2e2e24
@@ -296,6 +298,22 @@
Harald Hoyer 2e2e24
                                 </listitem>
Harald Hoyer 2e2e24
                         </varlistentry>
Harald Hoyer 2e2e24
                         <varlistentry>
Harald Hoyer 2e2e24
+                                <term><filename>initrd-fs.target</filename></term>
Harald Hoyer 2e2e24
+                                <listitem>
Harald Hoyer 2e2e24
+                                        <para>systemd automatically
Harald Hoyer 2e2e24
+                                        adds dependencies of type
Harald Hoyer 2e2e24
+                                        Before to sysroot-usr.mount and
Harald Hoyer 2e2e24
+                                        all mount points fround in
Harald Hoyer 2e2e24
+                                        <filename>/etc/fstab</filename>
Harald Hoyer 2e2e24
+                                        that have the
Harald Hoyer 2e2e24
+                                        <option>auto</option> and
Harald Hoyer 2e2e24
+                                        <option>x-initrd.mount</option>
Harald Hoyer 2e2e24
+                                        mount options set.
Harald Hoyer 2e2e24
+                                        See also <literal>systemd-fstab-generator</literal>.
Harald Hoyer 2e2e24
+                                        </para>
Harald Hoyer 2e2e24
+                                </listitem>
Harald Hoyer 2e2e24
+                        </varlistentry>
Harald Hoyer 2e2e24
+                        <varlistentry>
Harald Hoyer 2e2e24
                                 <term><filename>kbrequest.target</filename></term>
Harald Hoyer 2e2e24
                                 <listitem>
Harald Hoyer 2e2e24
                                         <para>systemd starts this
Harald Hoyer 2e2e24
@@ -505,6 +523,17 @@
Harald Hoyer 2e2e24
                                 </listitem>
Harald Hoyer 2e2e24
                         </varlistentry>
Harald Hoyer 2e2e24
                         <varlistentry>
Harald Hoyer 2e2e24
+                                <term><filename>root-fs.target</filename></term>
Harald Hoyer 2e2e24
+                                <listitem>
Harald Hoyer 2e2e24
+                                        <para>systemd automatically
Harald Hoyer 2e2e24
+                                        adds dependencies of type
Harald Hoyer 2e2e24
+                                        Before to the sysroot.mount unit,
Harald Hoyer 2e2e24
+                                        which is generated from the kernel command
Harald Hoyer 2e2e24
+                                        line by the <literal>systemd-fstab-generator</literal>.
Harald Hoyer 2e2e24
+                                        </para>
Harald Hoyer 2e2e24
+                                </listitem>
Harald Hoyer 2e2e24
+                        </varlistentry>
Harald Hoyer 2e2e24
+                        <varlistentry>
Harald Hoyer 2e2e24
                                 <term><filename>rpcbind.target</filename></term>
Harald Hoyer 2e2e24
                                 <listitem>
Harald Hoyer 2e2e24
                                         <para>systemd automatically
Harald Hoyer 2e2e24
@@ -760,6 +789,7 @@
Harald Hoyer 2e2e24
                           <citerefentry><refentrytitle>systemd.socket</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
Harald Hoyer 2e2e24
                           <citerefentry><refentrytitle>systemd.target</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
Harald Hoyer 2e2e24
                           <citerefentry><refentrytitle>bootup</refentrytitle><manvolnum>7</manvolnum></citerefentry>
Harald Hoyer 2e2e24
+                          <citerefentry><refentrytitle>systemd-fstab-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>
Harald Hoyer 2e2e24
                   </para>
Harald Hoyer 2e2e24
         </refsect1>
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
diff --git a/src/core/special.h b/src/core/special.h
Harald Hoyer 2e2e24
index 99c0e12..52e593b 100644
Harald Hoyer 2e2e24
--- a/src/core/special.h
Harald Hoyer 2e2e24
+++ b/src/core/special.h
Harald Hoyer 2e2e24
@@ -48,6 +48,8 @@
Harald Hoyer 2e2e24
 #define SPECIAL_SOCKETS_TARGET "sockets.target"
Harald Hoyer 2e2e24
 #define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
Harald Hoyer 2e2e24
 #define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
Harald Hoyer 2e2e24
+#define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
Harald Hoyer 2e2e24
+#define SPECIAL_ROOT_FS_TARGET "root-fs.target"
Harald Hoyer 2e2e24
 #define SPECIAL_REMOTE_FS_TARGET "remote-fs.target"       /* LSB's $remote_fs */
Harald Hoyer 2e2e24
 #define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target"
Harald Hoyer 2e2e24
 #define SPECIAL_SWAP_TARGET "swap.target"
Harald Hoyer 2e2e24
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
Harald Hoyer 2e2e24
index 910bbc1..b4fb134 100644
Harald Hoyer 2e2e24
--- a/src/fstab-generator/fstab-generator.c
Harald Hoyer 2e2e24
+++ b/src/fstab-generator/fstab-generator.c
Harald Hoyer 2e2e24
@@ -200,14 +200,13 @@ static bool mount_in_initrd(struct mntent *me) {
Harald Hoyer 2e2e24
 }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
 static int add_mount(const char *what, const char *where, const char *type, const char *opts,
Harald Hoyer 2e2e24
-                     int passno, bool noauto, bool nofail, bool automount, bool isbind, bool isnetwork,
Harald Hoyer 2e2e24
-                     const char *source) {
Harald Hoyer 2e2e24
+                     int passno, bool noauto, bool nofail, bool automount, bool isbind,
Harald Hoyer 2e2e24
+                     const char *pre, const char *post, const char *source) {
Harald Hoyer 2e2e24
         char _cleanup_free_
Harald Hoyer 2e2e24
                 *name = NULL, *unit = NULL, *lnk = NULL, *device = NULL,
Harald Hoyer 2e2e24
                 *automount_name = NULL, *automount_unit = NULL;
Harald Hoyer 2e2e24
         FILE _cleanup_fclose_ *f = NULL;
Harald Hoyer 2e2e24
         int r;
Harald Hoyer 2e2e24
-        const char *post, *pre;
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
         assert(what);
Harald Hoyer 2e2e24
         assert(where);
Harald Hoyer 2e2e24
@@ -227,14 +226,6 @@ static int add_mount(const char *what, const char *where, const char *type, cons
Harald Hoyer 2e2e24
             mount_point_ignore(where))
Harald Hoyer 2e2e24
                 return 0;
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
-        if (isnetwork) {
Harald Hoyer 2e2e24
-                post = SPECIAL_REMOTE_FS_TARGET;
Harald Hoyer 2e2e24
-                pre = SPECIAL_REMOTE_FS_PRE_TARGET;
Harald Hoyer 2e2e24
-        } else {
Harald Hoyer 2e2e24
-                post = SPECIAL_LOCAL_FS_TARGET;
Harald Hoyer 2e2e24
-                pre = SPECIAL_LOCAL_FS_PRE_TARGET;
Harald Hoyer 2e2e24
-        }
Harald Hoyer 2e2e24
-
Harald Hoyer 2e2e24
         name = unit_name_from_path(where, ".mount");
Harald Hoyer 2e2e24
         if (!name)
Harald Hoyer 2e2e24
                 return log_oom();
Harald Hoyer 2e2e24
@@ -259,17 +250,19 @@ static int add_mount(const char *what, const char *where, const char *type, cons
Harald Hoyer 2e2e24
               "DefaultDependencies=no\n",
Harald Hoyer 2e2e24
               source);
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
-        if (!path_equal(where, "/"))
Harald Hoyer 2e2e24
+        if (!path_equal(where, "/")) {
Harald Hoyer 2e2e24
+                if (pre)
Harald Hoyer 2e2e24
+                        fprintf(f,
Harald Hoyer 2e2e24
+                                "After=%s\n"
Harald Hoyer 2e2e24
+                                "Wants=%s\n",
Harald Hoyer 2e2e24
+                                pre,
Harald Hoyer 2e2e24
+                                pre);
Harald Hoyer 2e2e24
                 fprintf(f,
Harald Hoyer 2e2e24
-                        "After=%s\n"
Harald Hoyer 2e2e24
-                        "Wants=%s\n"
Harald Hoyer 2e2e24
                         "Conflicts=" SPECIAL_UMOUNT_TARGET "\n"
Harald Hoyer 2e2e24
-                        "Before=" SPECIAL_UMOUNT_TARGET "\n",
Harald Hoyer 2e2e24
-                        pre,
Harald Hoyer 2e2e24
-                        pre);
Harald Hoyer 2e2e24
-
Harald Hoyer 2e2e24
+                        "Before=" SPECIAL_UMOUNT_TARGET "\n");
Harald Hoyer 2e2e24
+        }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
-        if (!noauto && !nofail && !automount)
Harald Hoyer 2e2e24
+        if (post && !noauto && !nofail && !automount)
Harald Hoyer 2e2e24
                 fprintf(f,
Harald Hoyer 2e2e24
                         "Before=%s\n",
Harald Hoyer 2e2e24
                         post);
Harald Hoyer 2e2e24
@@ -299,14 +292,16 @@ static int add_mount(const char *what, const char *where, const char *type, cons
Harald Hoyer 2e2e24
         }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
         if (!noauto) {
Harald Hoyer 2e2e24
-                lnk = strjoin(arg_dest, "/", post, nofail || automount ? ".wants/" : ".requires/", name, NULL);
Harald Hoyer 2e2e24
-                if (!lnk)
Harald Hoyer 2e2e24
-                        return log_oom();
Harald Hoyer 2e2e24
+                if (post) {
Harald Hoyer 2e2e24
+                        lnk = strjoin(arg_dest, "/", post, nofail || automount ? ".wants/" : ".requires/", name, NULL);
Harald Hoyer 2e2e24
+                        if (!lnk)
Harald Hoyer 2e2e24
+                                return log_oom();
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
-                mkdir_parents_label(lnk, 0755);
Harald Hoyer 2e2e24
-                if (symlink(unit, lnk) < 0) {
Harald Hoyer 2e2e24
-                        log_error("Failed to create symlink %s: %m", lnk);
Harald Hoyer 2e2e24
-                        return -errno;
Harald Hoyer 2e2e24
+                        mkdir_parents_label(lnk, 0755);
Harald Hoyer 2e2e24
+                        if (symlink(unit, lnk) < 0) {
Harald Hoyer 2e2e24
+                                log_error("Failed to create symlink %s: %m", lnk);
Harald Hoyer 2e2e24
+                                return -errno;
Harald Hoyer 2e2e24
+                        }
Harald Hoyer 2e2e24
                 }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
                 if (!isbind &&
Harald Hoyer 2e2e24
@@ -353,12 +348,17 @@ static int add_mount(const char *what, const char *where, const char *type, cons
Harald Hoyer 2e2e24
                         "SourcePath=%s\n"
Harald Hoyer 2e2e24
                         "DefaultDependencies=no\n"
Harald Hoyer 2e2e24
                         "Conflicts=" SPECIAL_UMOUNT_TARGET "\n"
Harald Hoyer 2e2e24
-                        "Before=" SPECIAL_UMOUNT_TARGET " %s\n"
Harald Hoyer 2e2e24
-                        "\n"
Harald Hoyer 2e2e24
+                        "Before=" SPECIAL_UMOUNT_TARGET "\n",
Harald Hoyer 2e2e24
+                        source);
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+                if (post)
Harald Hoyer 2e2e24
+                        fprintf(f,
Harald Hoyer 2e2e24
+                                "Before= %s\n",
Harald Hoyer 2e2e24
+                                post);
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+                fprintf(f,
Harald Hoyer 2e2e24
                         "[Automount]\n"
Harald Hoyer 2e2e24
                         "Where=%s\n",
Harald Hoyer 2e2e24
-                        source,
Harald Hoyer 2e2e24
-                        post,
Harald Hoyer 2e2e24
                         where);
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
                 fflush(f);
Harald Hoyer 2e2e24
@@ -421,7 +421,8 @@ static int parse_fstab(const char *prefix, bool initrd) {
Harald Hoyer 2e2e24
                 if (streq(me->mnt_type, "swap"))
Harald Hoyer 2e2e24
                         k = add_swap(what, me);
Harald Hoyer 2e2e24
                 else {
Harald Hoyer 2e2e24
-                        bool noauto, nofail, automount, isbind, isnetwork;
Harald Hoyer 2e2e24
+                        bool noauto, nofail, automount, isbind;
Harald Hoyer 2e2e24
+                        const char *pre, *post;
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
                         noauto = !!hasmntopt(me, "noauto");
Harald Hoyer 2e2e24
                         nofail = !!hasmntopt(me, "nofail");
Harald Hoyer 2e2e24
@@ -429,11 +430,21 @@ static int parse_fstab(const char *prefix, bool initrd) {
Harald Hoyer 2e2e24
                                   hasmntopt(me, "comment=systemd.automount") ||
Harald Hoyer 2e2e24
                                   hasmntopt(me, "x-systemd.automount");
Harald Hoyer 2e2e24
                         isbind = mount_is_bind(me);
Harald Hoyer 2e2e24
-                        isnetwork = mount_is_network(me);
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+                        if (initrd) {
Harald Hoyer 2e2e24
+                                post = SPECIAL_INITRD_FS_TARGET;
Harald Hoyer 2e2e24
+                                pre = NULL;
Harald Hoyer 2e2e24
+                        } else if (mount_is_network(me)) {
Harald Hoyer 2e2e24
+                                post = SPECIAL_REMOTE_FS_TARGET;
Harald Hoyer 2e2e24
+                                pre = SPECIAL_REMOTE_FS_PRE_TARGET;
Harald Hoyer 2e2e24
+                        } else {
Harald Hoyer 2e2e24
+                                post = SPECIAL_LOCAL_FS_TARGET;
Harald Hoyer 2e2e24
+                                pre = SPECIAL_LOCAL_FS_PRE_TARGET;
Harald Hoyer 2e2e24
+                        }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
                         k = add_mount(what, where, me->mnt_type, me->mnt_opts,
Harald Hoyer 2e2e24
                                      me->mnt_passno, noauto, nofail, automount,
Harald Hoyer 2e2e24
-                                     isbind, isnetwork, fstab_path);
Harald Hoyer 2e2e24
+                                     isbind, pre, post, fstab_path);
Harald Hoyer 2e2e24
                 }
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
                 if (k < 0)
Harald Hoyer 2e2e24
@@ -514,7 +525,7 @@ static int parse_new_root_from_proc_cmdline(void) {
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
         log_debug("Found entry what=%s where=/sysroot type=%s", what, type);
Harald Hoyer 2e2e24
         r = add_mount(what, "/sysroot", type, opts, 0, false, false, false,
Harald Hoyer 2e2e24
-                      false, false, "/proc/cmdline");
Harald Hoyer 2e2e24
+                      false, NULL, SPECIAL_ROOT_FS_TARGET, "/proc/cmdline");
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
         return (r < 0) ? r : 0;
Harald Hoyer 2e2e24
 }
Harald Hoyer 2e2e24
diff --git a/units/initrd-cleanup.service.in b/units/initrd-cleanup.service.in
Harald Hoyer 2e2e24
index e926a1e..5bef090 100644
Harald Hoyer 2e2e24
--- a/units/initrd-cleanup.service.in
Harald Hoyer 2e2e24
+++ b/units/initrd-cleanup.service.in
Harald Hoyer 2e2e24
@@ -10,8 +10,8 @@ Description=Cleaning Up and Shutting Down Daemons
Harald Hoyer 2e2e24
 DefaultDependencies=no
Harald Hoyer 2e2e24
 ConditionPathExists=/etc/initrd-release
Harald Hoyer 2e2e24
 OnFailure=emergency.target
Harald Hoyer 2e2e24
-Requires=local-fs.target swap.target
Harald Hoyer 2e2e24
-After=local-fs.target swap.target
Harald Hoyer 2e2e24
+Wants=root-fs.target initrd-fs.target
Harald Hoyer 2e2e24
+After=root-fs.target initrd-fs.target
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
 [Service]
Harald Hoyer 2e2e24
 Type=oneshot
Harald Hoyer 2e2e24
diff --git a/units/initrd-fs.target b/units/initrd-fs.target
Harald Hoyer 2e2e24
new file mode 100644
Harald Hoyer 2e2e24
index 0000000..6ba1758
Harald Hoyer 2e2e24
--- /dev/null
Harald Hoyer 2e2e24
+++ b/units/initrd-fs.target
Harald Hoyer 2e2e24
@@ -0,0 +1,13 @@
Harald Hoyer 2e2e24
+#  This file is part of systemd.
Harald Hoyer 2e2e24
+#
Harald Hoyer 2e2e24
+#  systemd is free software; you can redistribute it and/or modify it
Harald Hoyer 2e2e24
+#  under the terms of the GNU Lesser General Public License as published by
Harald Hoyer 2e2e24
+#  the Free Software Foundation; either version 2.1 of the License, or
Harald Hoyer 2e2e24
+#  (at your option) any later version.
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+[Unit]
Harald Hoyer 2e2e24
+Description=Initrd File Systems
Harald Hoyer 2e2e24
+Documentation=man:systemd.special(7)
Harald Hoyer 2e2e24
+OnFailure=emergency.target
Harald Hoyer 2e2e24
+OnFailureIsolate=yes
Harald Hoyer 2e2e24
+ConditionPathExists=/etc/initrd-release
Harald Hoyer 2e2e24
diff --git a/units/initrd-parse-etc.service.in b/units/initrd-parse-etc.service.in
Harald Hoyer 2e2e24
index 1a2711a..44fee7b 100644
Harald Hoyer 2e2e24
--- a/units/initrd-parse-etc.service.in
Harald Hoyer 2e2e24
+++ b/units/initrd-parse-etc.service.in
Harald Hoyer 2e2e24
@@ -8,13 +8,13 @@
Harald Hoyer 2e2e24
 [Unit]
Harald Hoyer 2e2e24
 Description=Reload Configuration from the Real Root
Harald Hoyer 2e2e24
 DefaultDependencies=no
Harald Hoyer 2e2e24
-Requires=local-fs.target swap.target
Harald Hoyer 2e2e24
-After=local-fs.target swap.target
Harald Hoyer 2e2e24
+Requires=root-fs.target
Harald Hoyer 2e2e24
+After=root-fs.target
Harald Hoyer 2e2e24
 OnFailure=emergency.target
Harald Hoyer 2e2e24
 ConditionPathExists=/etc/initrd-release
Harald Hoyer 2e2e24
 
Harald Hoyer 2e2e24
 [Service]
Harald Hoyer 2e2e24
 Type=oneshot
Harald Hoyer 2e2e24
 ExecStartPre=@rootbindir@/systemctl daemon-reload
Harald Hoyer 2e2e24
-ExecStart=@rootbindir@/systemctl start local-fs.target
Harald Hoyer 2e2e24
+ExecStart=@rootbindir@/systemctl start initrd-fs.target
Harald Hoyer 2e2e24
 ExecStart=@rootbindir@/systemctl --no-block start initrd-cleanup.service
Harald Hoyer 2e2e24
diff --git a/units/initrd-switch-root.target b/units/initrd-switch-root.target
Harald Hoyer 2e2e24
index f706d29..cf646c4 100644
Harald Hoyer 2e2e24
--- a/units/initrd-switch-root.target
Harald Hoyer 2e2e24
+++ b/units/initrd-switch-root.target
Harald Hoyer 2e2e24
@@ -12,5 +12,5 @@ DefaultDependencies=no
Harald Hoyer 2e2e24
 Requires=initrd-switch-root.service
Harald Hoyer 2e2e24
 Before=initrd-switch-root.service
Harald Hoyer 2e2e24
 AllowIsolate=yes
Harald Hoyer 2e2e24
-Wants=initrd-udevadm-cleanup-db.service local-fs.target swap.target systemd-journald.service
Harald Hoyer 2e2e24
-After=initrd-udevadm-cleanup-db.service local-fs.target swap.target emergency.service emergency.target
Harald Hoyer 2e2e24
+Wants=initrd-udevadm-cleanup-db.service root-fs.target initrd-fs.target systemd-journald.service
Harald Hoyer 2e2e24
+After=initrd-udevadm-cleanup-db.service root-fs.target initrd-fs.target emergency.service emergency.target
Harald Hoyer 2e2e24
diff --git a/units/root-fs.target b/units/root-fs.target
Harald Hoyer 2e2e24
new file mode 100644
Harald Hoyer 2e2e24
index 0000000..1351534
Harald Hoyer 2e2e24
--- /dev/null
Harald Hoyer 2e2e24
+++ b/units/root-fs.target
Harald Hoyer 2e2e24
@@ -0,0 +1,11 @@
Harald Hoyer 2e2e24
+#  This file is part of systemd.
Harald Hoyer 2e2e24
+#
Harald Hoyer 2e2e24
+#  systemd is free software; you can redistribute it and/or modify it
Harald Hoyer 2e2e24
+#  under the terms of the GNU Lesser General Public License as published by
Harald Hoyer 2e2e24
+#  the Free Software Foundation; either version 2.1 of the License, or
Harald Hoyer 2e2e24
+#  (at your option) any later version.
Harald Hoyer 2e2e24
+
Harald Hoyer 2e2e24
+[Unit]
Harald Hoyer 2e2e24
+Description=Initrd Root File System
Harald Hoyer 2e2e24
+Documentation=man:systemd.special(7)
Harald Hoyer 2e2e24
+ConditionPathExists=/etc/initrd-release
Harald Hoyer 2e2e24
-- 
Harald Hoyer 2e2e24
1.8.1
Harald Hoyer 2e2e24