chiark / gitweb /
generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 2 May 2015 17:01:29 +0000 (12:01 -0500)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 07:21:10 +0000 (08:21 +0100)
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.

src/shared/generator.c
src/shared/generator.h

index 8f48ac4fee23d23c7997cf725cc7fd3bcecdeccc..2dc34bf738a55e23aeacf509e5506ddeb7b84f65 100644 (file)
@@ -32,7 +32,7 @@
 
 int generator_write_fsck_deps(
                 FILE *f,
-                const char *dest,
+                const char *dir,
                 const char *what,
                 const char *where,
                 const char *fstype) {
@@ -40,7 +40,7 @@ int generator_write_fsck_deps(
         int r;
 
         assert(f);
-        assert(dest);
+        assert(dir);
         assert(what);
         assert(where);
 
@@ -59,10 +59,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)
@@ -76,17 +76,20 @@ int generator_write_fsck_deps(
                         return log_error_errno(r, "Failed to create fsck service name: %m");
 
                 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
index 64bd28f596f32127ac5d9e3d7d15de1846f304e9..6c3f38abbae517d19a8ea549672b34d518acbafd 100644 (file)
 
 #include <stdio.h>
 
-int generator_write_fsck_deps(FILE *f, const char *dest, const char *what, const char *where, const char *type);
-
-int generator_write_timeouts(const char *dir, const char *what, const char *where,
-                             const char *opts, char **filtered);
+int generator_write_fsck_deps(
+        FILE *f,
+        const char *dir,
+        const char *what,
+        const char *where,
+        const char *type);
+
+int generator_write_timeouts(
+        const char *dir,
+        const char *what,
+        const char *where,
+        const char *opts,
+        char **filtered);