summaryrefslogtreecommitdiffstats
path: root/src/fstab-generator
diff options
context:
space:
mode:
authorThomas Blume <tblume@suse.com>2022-09-19 16:57:48 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-03-09 20:32:09 +0100
commitfc5c6eccb4bdd5fa22c2f1118fc57a230409470a (patch)
tree69a9f3c38c332cd133d66359fae672e9ec47115a /src/fstab-generator
parentcore/exec-invoke: Fix missing arguments for PR_SET_MEMORY_MERGE call (diff)
downloadsystemd-fc5c6eccb4bdd5fa22c2f1118fc57a230409470a.tar.xz
systemd-fc5c6eccb4bdd5fa22c2f1118fc57a230409470a.zip
units: make templates for quotaon and systemd-quotacheck service
Diffstat (limited to 'src/fstab-generator')
-rw-r--r--src/fstab-generator/fstab-generator.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 4d65289bef..e4c8c9674c 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -46,6 +46,7 @@ typedef enum MountPointFlags {
MOUNT_GROWFS = 1 << 4,
MOUNT_RW_ONLY = 1 << 5,
MOUNT_PCRFS = 1 << 6,
+ MOUNT_QUOTA = 1 << 7,
} MountPointFlags;
typedef struct Mount {
@@ -717,6 +718,18 @@ static int add_mount(
}
}
+ if (flags & MOUNT_QUOTA) {
+ r = generator_hook_up_quotacheck(dest, what, where, target_unit, fstype);
+ if (r < 0) {
+ if (r != -EOPNOTSUPP)
+ return r;
+ } else {
+ r = generator_hook_up_quotaon(dest, where, target_unit);
+ if (r < 0)
+ return r;
+ }
+ }
+
if (FLAGS_SET(flags, MOUNT_AUTOMOUNT)) {
r = unit_name_from_path(where, ".automount", &automount_name);
if (r < 0)
@@ -858,6 +871,8 @@ static MountPointFlags fstab_options_to_flags(const char *options, bool is_swap)
flags |= MOUNT_GROWFS;
if (fstab_test_option(options, "x-systemd.pcrfs\0"))
flags |= MOUNT_PCRFS;
+ if (fstab_test_option(options, "usrquota\0" "grpquota\0" "quota\0" "usrjquota\0" "grpjquota\0" "prjquota\0"))
+ flags |= MOUNT_QUOTA;
if (fstab_test_yes_no_option(options, "noauto\0" "auto\0"))
flags |= MOUNT_NOAUTO;
if (fstab_test_yes_no_option(options, "nofail\0" "fail\0"))
@@ -1210,7 +1225,7 @@ static int add_sysroot_mount(void) {
fstype,
opts,
is_device_path(what) ? 1 : 0, /* passno */
- flags, /* makefs off, pcrfs off, noauto off, nofail off, automount off */
+ flags, /* makefs off, pcrfs off, quota off, noauto off, nofail off, automount off */
SPECIAL_INITRD_ROOT_FS_TARGET);
}