Implement SYSTEMD_HOME_MKFS_OPTIONS_* envvars to configure mkfs options for homed LUKS directories

This commit is contained in:
Aidan Dang
2022-12-15 22:22:10 +01:00
committed by Lennart Poettering
parent 15cad3a2ab
commit 8f30c00c50
7 changed files with 46 additions and 11 deletions
+8 -1
View File
@@ -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);
+1 -1
View File
@@ -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);