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;
-1
View File
@@ -85,7 +85,6 @@ int find_binary(const char *name, char **filename);
bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
int fsck_exists(const char *fstype);
int mkfs_exists(const char *fstype);
/* Iterates through the path prefixes of the specified path, going up
* the tree, to root. Also returns "" (and not "/"!) for the root