summaryrefslogtreecommitdiff
path: root/src/shared/fstab-util.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2015-09-30 22:24:52 +0200
committerKay Sievers <kay@vrfy.org>2015-09-30 22:24:52 +0200
commit0b6b6787e3f0ae8906ce0212bd629edbe931b73d (patch)
treebe369ade314597718c186461b38ebe26fee06d1c /src/shared/fstab-util.c
parenta19c7a4a4b773e25671a5fa874e7c421685d1bde (diff)
gpt-auto-generator: check fstab for /boot entries
We need to prevent the creation of the gpt automount unit, which will not get overridden by the fstab mount unit. https://github.com/systemd/systemd/issues/1378
Diffstat (limited to 'src/shared/fstab-util.c')
-rw-r--r--src/shared/fstab-util.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index e231a0ff80..db2146f8c1 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -20,9 +20,26 @@
***/
#include "fstab-util.h"
+#include "path-util.h"
#include "strv.h"
#include "util.h"
+bool fstab_is_mount_point(const char *mount) {
+ _cleanup_free_ char *device = NULL;
+ _cleanup_endmntent_ FILE *f = NULL;
+ struct mntent *m;
+
+ f = setmntent("/etc/fstab", "r");
+ if (!f)
+ return false;
+
+ while ((m = getmntent(f)))
+ if (path_equal(m->mnt_dir, mount))
+ return true;
+
+ return false;
+}
+
int fstab_filter_options(const char *opts, const char *names,
const char **namefound, char **value, char **filtered) {
const char *name, *n = NULL, *x;