summaryrefslogtreecommitdiff
path: root/src/fsck
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 15:01:41 +0100
commit13556724379a52951eb1977c2b7989a0159fd77c (patch)
tree88784b2757be7edb5e80af6716d8c344dab585b9 /src/fsck
parentace212f577572bcbab5a464d13bf09418a6e7fa4 (diff)
downloadsystemd-13556724379a52951eb1977c2b7989a0159fd77c.tar.gz
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/fsck')
-rw-r--r--src/fsck/fsck.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index f5f8a10c57..595434ab57 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -324,13 +324,21 @@ static int run(int argc, char *argv[]) {
}
if (sd_device_get_property_value(dev, "ID_FS_TYPE", &type) >= 0) {
- r = fsck_exists(type);
+ r = fsck_exists_for_fstype(type);
if (r < 0)
log_device_warning_errno(dev, r, "Couldn't detect if fsck.%s may be used, proceeding: %m", type);
else if (r == 0) {
log_device_info(dev, "fsck.%s doesn't exist, not checking file system.", type);
return 0;
}
+ } else {
+ r = fsck_exists();
+ if (r < 0)
+ log_device_warning_errno(dev, r, "Couldn't detect if the fsck command may be used, proceeding: %m");
+ else if (r == 0) {
+ log_device_info(dev, "The fsck command does not exist, not checking file system.");
+ return 0;
+ }
}
console = fopen("/dev/console", "we");