Make repart more user-friendly (#42345)

This commit is contained in:
Luca Boccassi
2026-06-03 20:22:48 +01:00
committed by GitHub
5 changed files with 131 additions and 59 deletions
+16
View File
@@ -485,6 +485,22 @@ bool fstype_can_fmask_dmask(const char *fstype) {
return streq(fstype, "vfat") || (mount_option_supported(fstype, "fmask", "0177") > 0 && mount_option_supported(fstype, "dmask", "0077") > 0);
}
bool fstype_can_ownership(const char *fstype) {
/* File systems which are not known to not support uid/gid ownership.
* For some types, this can be a bit murky. So just exclude the ones that for sure
* don't support with the current implementations in Linux. */
return !STR_IN_SET(ASSERT_PTR(fstype),
"adfs",
"exfat",
"fat",
"hfs",
"hpfs",
"msdos",
"ntfs",
"vfat");
}
bool fstype_can_uid_gid(const char *fstype) {
/* All file systems that have a uid=/gid= mount option that fixates the owners of all files and
* directories, current and future. Note that this does *not* ask the kernel via
+1
View File
@@ -66,6 +66,7 @@ bool fstype_is_api_vfs(const char *fstype);
bool fstype_is_blockdev_backed(const char *fstype);
bool fstype_is_ro(const char *fsype);
bool fstype_can_discard(const char *fstype);
bool fstype_can_ownership(const char *fstype);
bool fstype_can_uid_gid(const char *fstype);
bool fstype_can_fmask_dmask(const char *fstype);