chiark / gitweb /
generators: make automatic discovery generators work correctly when reloading
authorLennart Poettering <lennart@poettering.net>
Thu, 6 Mar 2014 17:26:35 +0000 (18:26 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 6 Mar 2014 17:48:22 +0000 (18:48 +0100)
In addition to checking whether the diestination mount point is
populated, check whether it is already a mount point.

If it is already a mount point, or if it is unpopulated, let's create
the unit.

src/efi-boot-generator/efi-boot-generator.c
src/gpt-auto-generator/gpt-auto-generator.c

index cf9ff73b12d55c67ccd6f4fcf15f2cb834d1f3b6..66d85bd204adad644e80c6f1763774941e3a50b4 100644 (file)
@@ -58,6 +58,7 @@ int main(int argc, char *argv[]) {
                 log_debug("In initrd, exiting.");
                 return EXIT_SUCCESS;
         }
+
         if (detect_container(NULL) > 0) {
                 log_debug("In a container, exiting.");
                 return EXIT_SUCCESS;
@@ -68,7 +69,8 @@ int main(int argc, char *argv[]) {
                 return EXIT_SUCCESS;
         }
 
-        if (dir_is_empty("/boot") <= 0) {
+        if (path_is_mount_point("/boot", true) <= 0 &&
+            dir_is_empty("/boot") <= 0) {
                 log_debug("/boot already populated, exiting.");
                 return EXIT_SUCCESS;
         }
index eb900b126395afa5beebdd9b71880f50c32e1968..3b7bc212d95ac628684e0f6e609e5d76e2e58af1 100644 (file)
@@ -298,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;
         }