Newer versions of initramfs-tools already fsck and mount / and /usr in
the initramfs. Skip the filesystem check in this case.
Based on a previous patch by Michael Biebl <biebl@debian.org>.
Closes: #782522
Closes: #810748
Gbp-Pq: Topic debian
Gbp-Pq: Name Skip-filesystem-check-if-already-done-by-the-initram.patch
*where_escaped = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
+ struct stat sb;
assert(what);
assert(where);
}
if (passno != 0) {
- r = generator_write_fsck_deps(f, dest, what, where, fstype);
- if (r < 0)
- return r;
+ if (streq(where, "/usr") && stat("/run/initramfs/fsck-usr", &sb) == 0)
+ ; /* skip /usr fsck if it has already been checked in the initramfs */
+ else {
+ r = generator_write_fsck_deps(f, dest, what, where, fstype);
+ if (r < 0)
+ return r;
+ }
}
fprintf(f, "\n[Mount]\n");
Wants=systemd-fsckd.socket
After=systemd-fsckd.socket
ConditionPathIsReadWrite=!/
+ConditionPathExists=!/run/initramfs/fsck-root
[Service]
Type=oneshot