chiark / gitweb /
generators: make automatic discovery generators work correctly when reloading
[elogind.git] / src / gpt-auto-generator / gpt-auto-generator.c
index c4109f39b71eb2bde28d35ba34effe0f7d8b4567..3b7bc212d95ac628684e0f6e609e5d76e2e58af1 100644 (file)
@@ -145,7 +145,8 @@ static int add_swap(const char *path, const char *fstype) {
         fprintf(f,
                 "# Automatically generated by systemd-gpt-auto-generator\n\n"
                 "[Unit]\n"
-                "Description=Swap Partition\n\n"
+                "Description=Swap Partition\n"
+                "Documentation=man:systemd-gpt-auto-generator(8)\n\n"
                 "[Swap]\n"
                 "What=%s\n",
                 path);
@@ -205,7 +206,7 @@ static int add_cryptsetup(const char *id, const char *what, char **device) {
                 "# Automatically generated by systemd-gpt-auto-generator\n\n"
                 "[Unit]\n"
                 "Description=Cryptography Setup for %%I\n"
-                "Documentation=man:systemd-cryptsetup@.service(8)\n"
+                "Documentation=man:systemd-gpt-auto-generator(8) man:systemd-cryptsetup@.service(8)\n"
                 "DefaultDependencies=no\n"
                 "Conflicts=umount.target\n"
                 "BindsTo=dev-mapper-%%i.device %s\n"
@@ -297,7 +298,8 @@ static int add_mount(const char *id, const char *what, const char *where, const
         assert(fstype);
         assert(description);
 
-        if (dir_is_empty(where) <= 0) {
+        if (path_is_mount_point(where, true) <= 0 &&
+            dir_is_empty(where) <= 0) {
                 log_debug("%s already populated, ignoring.", where);
                 return 0;
         }
@@ -331,7 +333,8 @@ static int add_mount(const char *id, const char *what, const char *where, const
         fprintf(f,
                 "# Automatically generated by systemd-gpt-auto-generator\n\n"
                 "[Unit]\n"
-                "Description=%s\n",
+                "Description=%s\n"
+                "Documentation=man:systemd-gpt-auto-generator(8)\n",
                 description);
 
         r = generator_write_fsck_deps(f, arg_dest, what, where, fstype);