summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/special.h2
-rw-r--r--src/fstab-generator/fstab-generator.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/core/special.h b/src/core/special.h
index 52e593b690..c7b856e2bd 100644
--- a/src/core/special.h
+++ b/src/core/special.h
@@ -49,7 +49,7 @@
#define SPECIAL_LOCAL_FS_TARGET "local-fs.target"
#define SPECIAL_LOCAL_FS_PRE_TARGET "local-fs-pre.target"
#define SPECIAL_INITRD_FS_TARGET "initrd-fs.target"
-#define SPECIAL_ROOT_FS_TARGET "root-fs.target"
+#define SPECIAL_INITRD_ROOT_FS_TARGET "initrd-root-fs.target"
#define SPECIAL_REMOTE_FS_TARGET "remote-fs.target" /* LSB's $remote_fs */
#define SPECIAL_REMOTE_FS_PRE_TARGET "remote-fs-pre.target"
#define SPECIAL_SWAP_TARGET "swap.target"
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index b4fb1344e6..cf85d3189a 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -199,6 +199,12 @@ static bool mount_in_initrd(struct mntent *me) {
streq(me->mnt_dir, "/usr");
}
+static bool mount_is_rootfs(struct mntent *me) {
+ assert(me);
+
+ return hasmntopt(me, "x-initrd-rootfs.mount");
+}
+
static int add_mount(const char *what, const char *where, const char *type, const char *opts,
int passno, bool noauto, bool nofail, bool automount, bool isbind,
const char *pre, const char *post, const char *source) {
@@ -434,6 +440,9 @@ static int parse_fstab(const char *prefix, bool initrd) {
if (initrd) {
post = SPECIAL_INITRD_FS_TARGET;
pre = NULL;
+ } else if (mount_is_rootfs(me)) {
+ post = SPECIAL_INITRD_ROOT_FS_TARGET;
+ pre = NULL;
} else if (mount_is_network(me)) {
post = SPECIAL_REMOTE_FS_TARGET;
pre = SPECIAL_REMOTE_FS_PRE_TARGET;
@@ -525,7 +534,7 @@ static int parse_new_root_from_proc_cmdline(void) {
log_debug("Found entry what=%s where=/sysroot type=%s", what, type);
r = add_mount(what, "/sysroot", type, opts, 0, false, false, false,
- false, NULL, SPECIAL_ROOT_FS_TARGET, "/proc/cmdline");
+ false, NULL, SPECIAL_INITRD_ROOT_FS_TARGET, "/proc/cmdline");
return (r < 0) ? r : 0;
}