]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/gpt-auto-generator/gpt-auto-generator.c
util-lib: split our string related calls from util.[ch] into its own file string...
[thirdparty/systemd.git] / src / gpt-auto-generator / gpt-auto-generator.c
index c97be2dabf49ea6475d762653909ecfb4e9247f9..3e8c745238864dd882c5e4b9e9e93b4900394649 100644 (file)
 #include <sys/statfs.h>
 #include <blkid/blkid.h>
 
-#include "sd-id128.h"
 #include "libudev.h"
-#include "path-util.h"
-#include "util.h"
-#include "mkdir.h"
+#include "sd-id128.h"
+
+#include "blkid-util.h"
+#include "btrfs-util.h"
+#include "efivars.h"
+#include "fileio.h"
+#include "fstab-util.h"
+#include "generator.h"
+#include "gpt.h"
 #include "missing.h"
-#include "udev-util.h"
+#include "mkdir.h"
+#include "path-util.h"
 #include "special.h"
+#include "string-util.h"
+#include "udev-util.h"
 #include "unit-name.h"
+#include "util.h"
 #include "virt.h"
-#include "generator.h"
-#include "gpt.h"
-#include "fileio.h"
-#include "efivars.h"
-#include "blkid-util.h"
-#include "btrfs-util.h"
 
 static const char *arg_dest = "/tmp";
 static bool arg_enabled = true;
@@ -465,6 +468,12 @@ static int add_boot(const char *what) {
                 return 0;
         }
 
+        /* We create an .automount which is not overridden by the .mount from the fstab generator. */
+        if (fstab_is_mount_point("/boot")) {
+                log_debug("/boot specified in fstab, ignoring.");
+                return 0;
+        }
+
         if (path_is_busy("/boot")) {
                 log_debug("/boot already populated, ignoring.");
                 return 0;
@@ -526,9 +535,9 @@ static int add_boot(const char *what) {
                        what,
                        "/boot",
                        "vfat",
-                       "EFI System Partition Automount",
-                       false,
+                       true,
                        "umask=0077",
+                       "EFI System Partition Automount",
                        120 * USEC_PER_SEC);
 
         return r;
@@ -864,7 +873,6 @@ static int get_block_device_harder(const char *path, dev_t *dev) {
                         goto fallback;
 
                 found = de;
-                break;
         }
 
         if (!found)