summaryrefslogtreecommitdiff
path: root/src/libshared/generator.c
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-12 08:43:34 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-12 08:43:34 -0400
commit670b77ddfab0f4eddbe539964aba83d446d48129 (patch)
tree5b159fe9bd52169e05cdc60db5a48a5c5ac9602a /src/libshared/generator.c
parent23708daf3ba69ba9880102b4f720a3842883332e (diff)
parent34dbdee3b2f122d2ef903a368b172e75f962b66a (diff)
Merge branch 'lukeshu/postmove' into 'lukeshu/master'
Diffstat (limited to 'src/libshared/generator.c')
-rw-r--r--src/libshared/generator.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/libshared/generator.c b/src/libshared/generator.c
index cd3c35cd55..70afc6a285 100644
--- a/src/libshared/generator.c
+++ b/src/libshared/generator.c
@@ -65,7 +65,7 @@ static int write_fsck_sysroot_service(const char *dir, const char *what) {
"Description=File System Check on %2$s\n"
"DefaultDependencies=no\n"
"BindsTo=%3$s\n"
- "After=%3$s local-fs-pre.target\n"
+ "After=initrd-root-device.target local-fs-pre.target\n"
"Before=shutdown.target\n"
"\n"
"[Service]\n"
@@ -191,3 +191,17 @@ int generator_write_timeouts(
"[Unit]\nJobTimeoutSec=%s",
program_invocation_short_name, timeout);
}
+
+int generator_write_initrd_root_device_deps(const char *dir, const char *what) {
+ _cleanup_free_ char *unit = NULL;
+ int r;
+
+ r = unit_name_from_path(what, ".device", &unit);
+ if (r < 0)
+ return log_error_errno(r, "Failed to make unit name from path: %m");
+
+ return write_drop_in_format(dir, SPECIAL_INITRD_ROOT_DEVICE_TARGET, 50, "root-device",
+ "# Automatically generated by %s\n\n"
+ "[Unit]\nRequires=%s\nAfter=%s",
+ program_invocation_short_name, unit, unit);
+}