Skip to content

Commit

Permalink
homed: add env var for overriding default mount options
Browse files Browse the repository at this point in the history
This adds an esay way to override the default mount options to use for
LUKS home dirs via the env vars SYSTEMD_HOME_MOUNT_OPTIONS_EXT4,
SYSTEMD_HOME_MOUNT_OPTIONS_BTRFS, SYSTEMD_HOME_MOUNT_OPTIONS_XFS.

See: #15120
  • Loading branch information
poettering committed Nov 12, 2021
1 parent a428a45 commit 6309512
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/home/homework-mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
#include "user-util.h"

static const char *mount_options_for_fstype(const char *fstype) {
const char *e;
char *n;

assert(fstype);

/* Allow overriding our built-in defaults with an environment variable */
n = strjoina("SYSTEMD_HOME_MOUNT_OPTIONS_", fstype);
e = getenv(ascii_strupper(n));
if (e)
return e;

if (streq(fstype, "ext4"))
return "noquota,user_xattr";
if (streq(fstype, "xfs"))
Expand Down

0 comments on commit 6309512

Please sign in to comment.