AC_SUBST([sysusersdir], [$with_sysusersdir])
])
+
+AC_ARG_WITH([ntfs-mounttype],
+ AS_HELP_STRING([--with-ntfs-mounttype=TYPE], [overwrite default ntfs3 mount type for NTFS]),
+ [], [with_ntfs_mounttype=no]
+)
+AS_IF([test "x$with_ntfs_mounttype" != "xno"], [
+ AC_DEFINE_UNQUOTED([CONFIG_UL_NTFS_MOUNTTYPE], ["$with_ntfs_mounttype"], [NTFS mounttype])
+])
+
+
AC_ARG_WITH([smack],
AS_HELP_STRING([--with-smack], [build with SMACK support]),
[], [with_smack=no]
}
}
+ if (rc == 0 && *type) {
+ const char *x = mnt_fstype_to_mounttype(*type);
+
+ if (x) {
+ free(*type);
+ *type = strdup(x);
+ if (!*type)
+ rc = -ENOMEM;
+ }
+ }
+
return rc;
}
close(fd);
}
if (type) {
- int rc = mnt_fs_set_fstype(cxt->fs, type);
+ const char *x = mnt_fstype_to_mounttype(type);
+ int rc = mnt_fs_set_fstype(cxt->fs, x ? x : type);
+
if (rc)
return rc;
}
extern int mnt_valid_tagname(const char *tagname);
extern const char *mnt_statfs_get_fstype(struct statfs *vfs);
+extern const char *mnt_fstype_to_mounttype(const char *fstype);
extern int is_file_empty(const char *name);
extern int mnt_is_readonly(const char *path)
case STATFS_NCP_MAGIC: return "ncp";
case STATFS_NFS_MAGIC: return "nfs";
case STATFS_NILFS_MAGIC: return "nilfs2";
- case STATFS_NTFS_MAGIC: return "ntfs3";
+ case STATFS_NTFS_MAGIC: return "ntfs";
case STATFS_OCFS2_MAGIC: return "ocfs2";
case STATFS_OMFS_MAGIC: return "omfs";
case STATFS_OPENPROMFS_MAGIC: return "openpromfs";
return NULL;
}
+/*
+ * Default NTFS mount type (used by libmount and libblkid)
+ */
+#ifndef CONFIG_UL_NTFS_MOUNTTYPE
+# define CONFIG_UL_NTFS_MOUNTTYPE "ntfs3"
+#endif
+
+/*
+ * Convert FS-type (as provided by libblkid or udev) to the preferred
+ * kernel FS driver (type used to mount the FS).
+ *
+ * This is a temporary solution; the final solution should be
+ * based on config files like /etc/mount/fs.d/<name> (from lib/configs.c).
+ */
+const char *mnt_fstype_to_mounttype(const char *fstype)
+{
+ if (!fstype)
+ return NULL;
+
+ if (strcmp(fstype, "ntfs") == 0)
+ return CONFIG_UL_NTFS_MOUNTTYPE;
+
+ return NULL;
+}
+
/**
* mnt_match_fstype:
* @type: filesystem type
endif
conf.set_quoted('FS_SEARCH_PATH', fs_search_path)
+ntfs_mounttype = get_option('ntfs-mounttype')
+if ntfs_mounttype != ''
+ conf.set_quoted('CONFIG_UL_NTFS_MOUNTTYPE', ntfs_mounttype)
+endif
+
systemdsystemunitdir = ''
if systemd.found()
systemdsystemunitdir = systemd.get_variable(pkgconfig : 'systemdsystemunitdir')
type : 'feature',
description : 'support reading from udev in libmount')
+option('ntfs-mounttype',
+ type : 'string',
+ description : 'overwrite default ntfs3 mount type for NTFS')
+
option('vendordir',
type: 'string',
description : 'directory for distribution provided econf files')