Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for homed LUKS directories
This commit is contained in:
committed by
Lennart Poettering
parent
15cad3a2ab
commit
8f30c00c50
@@ -302,7 +302,8 @@ int make_filesystem(
|
||||
const char *label,
|
||||
const char *root,
|
||||
sd_id128_t uuid,
|
||||
bool discard) {
|
||||
bool discard,
|
||||
char * const *extra_mkfs_args) {
|
||||
|
||||
_cleanup_free_ char *mkfs = NULL, *mangled_label = NULL;
|
||||
_cleanup_strv_free_ char **argv = NULL;
|
||||
@@ -522,6 +523,12 @@ int make_filesystem(
|
||||
if (!argv)
|
||||
return log_oom();
|
||||
|
||||
if (extra_mkfs_args) {
|
||||
r = strv_extend_strv(&argv, extra_mkfs_args, false);
|
||||
if (r < 0)
|
||||
return log_oom();
|
||||
}
|
||||
|
||||
if (root && stat(root, &st) < 0)
|
||||
return log_error_errno(errno, "Failed to stat %s: %m", root);
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ int mkfs_exists(const char *fstype);
|
||||
|
||||
int mkfs_supports_root_option(const char *fstype);
|
||||
|
||||
int make_filesystem(const char *node, const char *fstype, const char *label, const char *root, sd_id128_t uuid, bool discard);
|
||||
int make_filesystem(const char *node, const char *fstype, const char *label, const char *root, sd_id128_t uuid, bool discard, char * const *extra_mkfs_args);
|
||||
|
||||
Reference in New Issue
Block a user