summaryrefslogtreecommitdiffstats
path: root/src/shared/generator.c
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2022-09-29 18:51:03 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2022-09-30 16:01:41 +0200
commit13556724379a52951eb1977c2b7989a0159fd77c (patch)
tree88784b2757be7edb5e80af6716d8c344dab585b9 /src/shared/generator.c
parentportablectl: add --force attach/detach (diff)
downloadsystemd-13556724379a52951eb1977c2b7989a0159fd77c.tar.xz
systemd-13556724379a52951eb1977c2b7989a0159fd77c.zip
generator: skip fsck if fsck command is missing
This is useful for systems which don't have any fsck. We already skip emitting the fsck dependency when the fsck.$fstype helper is missing, but fstab-generator doesn't necessarily know the fstype when handling the root= parameter. Previously, systemd-fsck was started for these mounts and then exited immediately because it couldn't find the fsck.$fstype helper.
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r--src/shared/generator.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 681b97c6bd..bba8e1eaae 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -167,7 +167,7 @@ int generator_write_fsck_deps(
}
if (!isempty(fstype) && !streq(fstype, "auto")) {
- r = fsck_exists(fstype);
+ r = fsck_exists_for_fstype(fstype);
if (r < 0)
log_warning_errno(r, "Checking was requested for %s, but couldn't detect if fsck.%s may be used, proceeding: %m", what, fstype);
else if (r == 0) {
@@ -175,6 +175,15 @@ int generator_write_fsck_deps(
log_debug("Checking was requested for %s, but fsck.%s does not exist.", what, fstype);
return 0;
}
+ } else {
+ r = fsck_exists();
+ if (r < 0)
+ log_warning_errno(r, "Checking was requested for %s, but couldn't detect if the fsck command may be used, proceeding: %m", what);
+ else if (r == 0) {
+ /* treat missing fsck as essentially OK */
+ log_debug("Checking was requested for %s, but the fsck command does not exist.", what);
+ return 0;
+ }
}
if (path_equal(where, "/")) {