Skip to content

Commit

Permalink
Merge pull request #21329 from poettering/homed-compress-default
Browse files Browse the repository at this point in the history
homed: default to btrfs compression
  • Loading branch information
poettering committed Nov 12, 2021
2 parents 423de19 + db42f01 commit 0881991
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/ENVIRONMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,9 @@ SYSTEMD_HOME_DEBUG_SUFFIX=foo \
SYSTEMD_HOME_RECORD_DIR=/var/lib/systemd/home.foo/ \
/home/lennart/projects/systemd/build/systemd-homed
```

* `$SYSTEMD_HOME_MOUNT_OPTIONS_BTRFS`, `$SYSTEMD_HOME_MOUNT_OPTIONS_EXT4`,
`$SYSTEMD_HOME_MOUNT_OPTIONS_XFS` – configure the default mount options to
use for LUKS home directories, overriding the built-in default mount
options. There's one variable for each of the supported file systems for the
LUKS home directory backend.
13 changes: 12 additions & 1 deletion src/home/homework-mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,23 @@
#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"))
return "noquota";
if (streq(fstype, "btrfs"))
return "noacl";
return "noacl,compress=zstd:1";
return NULL;
}

Expand Down

0 comments on commit 0881991

Please sign in to comment.