AC_SUBST([LIBMOUNT_VERSION_INFO])
AC_DEFINE_UNQUOTED([LIBMOUNT_VERSION], ["$LIBMOUNT_VERSION"], [libmount version string])
+AC_ARG_ENABLE([libmount-force-mountinfo],
+ AS_HELP_STRING([--enable-libmount-force-mountinfo], [ignore /etc/mtab in all situations (recommended for systemd)]),
+ [], [enable_libmount_force_mountinfo=no]
+)
+
+AS_IF([test "x$enable_libmount_force_mountinfo" == xyes], [
+ AC_DEFINE([USE_LIBMOUNT_FORCE_MOUNTINFO], [1], [Define to 1 if want to ignore mtab in all situations.])
+])
+
dnl
dnl libsmartcols
DBG(CXT, ul_debugobj(cxt, "checking for writable tab files"));
+#ifdef USE_LIBMOUNT_FORCE_MOUNTINFO
+ cxt->mtab_writable = 0;
+#else
mnt_has_regular_mtab(&cxt->mtab_path, &cxt->mtab_writable);
+#endif
if (!cxt->mtab_writable)
/* use /run/mount/utab if /etc/mtab is useless */
assert(tb);
+#ifdef USE_LIBMOUNT_FORCE_MOUNTINFO
+ DBG(TAB, ul_debugobj(tb, "mtab parse: ignore %s", filename ? filename : "mtab"));
+#else
if (mnt_has_regular_mtab(&filename, NULL)) {
DBG(TAB, ul_debugobj(tb, "force mtab usage [filename=%s]", filename));
return 0;
filename = NULL; /* failed */
}
-
+#endif
DBG(TAB, ul_debugobj(tb, "mtab parse: #1 read mountinfo"));
/*