shared: introduce mkfs-util.c/.h

Let's move the "mkfs" code from homed there, plus other related code.

This way we can easily reuse it from other places.
This commit is contained in:
Lennart Poettering
2020-08-24 21:59:49 +02:00
parent 8dbc208cc1
commit c95f9a2351
6 changed files with 128 additions and 79 deletions
-12
View File
@@ -726,18 +726,6 @@ int fsck_exists(const char *fstype) {
return binary_is_good(checker);
}
int mkfs_exists(const char *fstype) {
const char *mkfs;
assert(fstype);
if (streq(fstype, "auto"))
return -EINVAL;
mkfs = strjoina("mkfs.", fstype);
return binary_is_good(mkfs);
}
int parse_path_argument_and_warn(const char *path, bool suppress_root, char **arg) {
char *p;
int r;