diff options
author | chayleaf <chayleaf-git@pavluk.org> | 2024-07-14 04:15:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-07-15 10:18:18 +0200 |
commit | 21aa180b4a92dac862af85f1278ae08bdef9d3fb (patch) | |
tree | 10ccb9d163c0ceff844e1de3e563269128d2bf66 /src/fstab-generator | |
parent | kernel-install: Remove existing loader entries and UKIs (diff) | |
download | systemd-21aa180b4a92dac862af85f1278ae08bdef9d3fb.tar.xz systemd-21aa180b4a92dac862af85f1278ae08bdef9d3fb.zip |
fstab-generator: add x-systemd.wants
This is an analog of x-systemd.requires that adds a Wants dependency
instead. This is useful for filesystems that support mounting in
degraded states (such as multi-device filesystems).
Diffstat (limited to 'src/fstab-generator')
-rw-r--r-- | src/fstab-generator/fstab-generator.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index b4df9d23c2..6b7445b201 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -416,6 +416,11 @@ static int write_requires_after(FILE *f, const char *where, const char *opts) { "x-systemd.requires\0", STRV_MAKE_CONST("Requires", "After")); } +static int write_wants_after(FILE *f, const char *where, const char *opts) { + return write_dependency(f, where, opts, + "x-systemd.wants\0", STRV_MAKE_CONST("Wants", "After")); +} + static int write_before(FILE *f, const char *where, const char *opts) { return write_dependency(f, where, opts, "x-systemd.before\0", STRV_MAKE_CONST("Before")); @@ -469,6 +474,10 @@ static int write_extra_dependencies(FILE *f, const char *where, const char *opts if (r < 0) return r; + r = write_wants_after(f, where, opts); + if (r < 0) + return r; + r = write_before(f, where, opts); if (r < 0) return r; |