diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2023-03-09 20:33:04 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2023-03-10 09:33:39 +0100 |
commit | 4b8ce14f6c68e5fd75a71fdb7bb998f070940ef1 (patch) | |
tree | 019e0245cd0fc45019b2a01179aac46f1487a1c6 /src/home/homework-luks.c | |
parent | Merge pull request #26741 from poettering/acquire-fd-fixes (diff) | |
download | systemd-4b8ce14f6c68e5fd75a71fdb7bb998f070940ef1.tar.xz systemd-4b8ce14f6c68e5fd75a71fdb7bb998f070940ef1.zip |
repart: Add support for reading mkfs options from environment
Diffstat (limited to 'src/home/homework-luks.c')
-rw-r--r-- | src/home/homework-luks.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/src/home/homework-luks.c b/src/home/homework-luks.c index 8912b3df52..ac3d2b417c 100644 --- a/src/home/homework-luks.c +++ b/src/home/homework-luks.c @@ -2119,25 +2119,6 @@ static int home_truncate( return !trunc; /* Return == 0 if we managed to truncate, > 0 if we managed to allocate */ } -static int mkfs_options_for_fstype(const char *fstype, char ***ret) { - _cleanup_(strv_freep) char **l = NULL; - const char *e; - char *n; - - assert(fstype); - - n = strjoina("SYSTEMD_HOME_MKFS_OPTIONS_", fstype); - e = getenv(ascii_strupper(n)); - if (e) { - l = strv_split(e, NULL); - if (!l) - return -ENOMEM; - } - - *ret = TAKE_PTR(l); - return 0; -} - int home_create_luks( UserRecord *h, HomeSetup *setup, @@ -2371,9 +2352,10 @@ int home_create_luks( log_info("Setting up LUKS device %s completed.", setup->dm_node); - r = mkfs_options_for_fstype(fstype, &extra_mkfs_options); + r = mkfs_options_from_env("HOME", fstype, &extra_mkfs_options); if (r < 0) return log_error_errno(r, "Failed to determine mkfs command line options for '%s': %m", fstype); + r = make_filesystem(setup->dm_node, fstype, user_record_user_name_and_realm(h), NULL, fs_uuid, user_record_luks_discard(h), 0, extra_mkfs_options); if (r < 0) return r; |