summaryrefslogtreecommitdiff
path: root/src/shared/generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-02 12:01:29 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-05-04 08:45:07 -0400
commit2e8522767e27d5686206794c69e0aa95da6e798b (patch)
tree33ff13a9602c6f2bec66bc35febfa63c54b75275 /src/shared/generator.c
parentbe3a09b7ffe62b52658e77ae4d6638d1b0dae654 (diff)
generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount
This makes it obvious that those functions are only usable in the initramfs. Also, add a warning when noauto, nofail, or automount is used for the root fs, instead of silently ignoring. Using those options would be a sign of significant misconfiguration, and if we bother to check for them, than let's go all the way and complain. Other various small cleanups and reformattings elsewhere.
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r--src/shared/generator.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 569b25bb7c..7b2f846175 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -32,13 +32,13 @@
int generator_write_fsck_deps(
FILE *f,
- const char *dest,
+ const char *dir,
const char *what,
const char *where,
const char *fstype) {
assert(f);
- assert(dest);
+ assert(dir);
assert(what);
assert(where);
@@ -58,10 +58,10 @@ int generator_write_fsck_deps(
return log_warning_errno(r, "Checking was requested for %s, but fsck.%s cannot be used: %m", what, fstype);
}
- if (streq(where, "/")) {
+ if (path_equal(where, "/")) {
char *lnk;
- lnk = strjoina(dest, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service");
+ lnk = strjoina(dir, "/" SPECIAL_LOCAL_FS_TARGET ".wants/systemd-fsck-root.service");
mkdir_parents(lnk, 0755);
if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-fsck-root.service", lnk) < 0)
@@ -75,17 +75,20 @@ int generator_write_fsck_deps(
return log_oom();
fprintf(f,
- "RequiresOverridable=%s\n"
- "After=%s\n",
- fsck,
+ "RequiresOverridable=%1$s\n"
+ "After=%1$s\n",
fsck);
}
return 0;
}
-int generator_write_timeouts(const char *dir, const char *what, const char *where,
- const char *opts, char **filtered) {
+int generator_write_timeouts(
+ const char *dir,
+ const char *what,
+ const char *where,
+ const char *opts,
+ char **filtered) {
/* Allow configuration how long we wait for a device that
* backs a mount point to show up. This is useful to support