- bool noauto, nofail, automount, isbind, isnetwork;
-
- noauto = !!hasmntopt(me, "noauto");
- nofail = !!hasmntopt(me, "nofail");
- automount =
- hasmntopt(me, "comment=systemd.automount") ||
- hasmntopt(me, "x-systemd.automount");
- isbind = mount_is_bind(me);
- isnetwork = mount_is_network(me);
-
- k = add_mount(what, where, me->mnt_type, me->mnt_opts,
- me->mnt_passno, false, noauto, nofail,
- automount, isbind, isnetwork,
- "/etc/fstab");
+ bool automount;
+ const char *post;
+
+ automount = fstab_test_option(me->mnt_opts,
+ "comment=systemd.automount\0"
+ "x-systemd.automount\0");
+ if (initrd)
+ post = SPECIAL_INITRD_FS_TARGET;
+ else if (mount_in_initrd(me))
+ post = SPECIAL_INITRD_ROOT_FS_TARGET;
+ else if (mount_is_network(me))
+ post = SPECIAL_REMOTE_FS_TARGET;
+ else
+ post = SPECIAL_LOCAL_FS_TARGET;
+
+ k = add_mount(what,
+ where,
+ me->mnt_type,
+ me->mnt_opts,
+ me->mnt_passno,
+ noauto,
+ nofail,
+ automount,
+ post,
+ fstab_path);