From: Nis Martensen Date: Tue, 19 Jan 2016 21:01:43 +0000 (+0100) Subject: Skip filesystem check if already done by the initramfs X-Git-Tag: archive/raspbian/254.5-1+rpi1^2^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=51cefd2fc703ea3d2063e2da35b4ef9d6e574317;p=systemd.git Skip filesystem check if already done by the initramfs 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 . Closes: #782522 Closes: #810748 Gbp-Pq: Topic debian Gbp-Pq: Name Skip-filesystem-check-if-already-done-by-the-initram.patch --- diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c index 7ff5db14..8a5c2f08 100644 --- a/src/fstab-generator/fstab-generator.c +++ b/src/fstab-generator/fstab-generator.c @@ -486,6 +486,7 @@ static int add_mount( _cleanup_strv_free_ char **wanted_by = NULL, **required_by = NULL; _cleanup_fclose_ FILE *f = NULL; int r; + struct stat sb; assert(what); assert(where); @@ -573,9 +574,13 @@ static int add_mount( fprintf(f, "Before=%s\n", target_unit); 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; + } } r = generator_write_blockdev_dependency(f, what); diff --git a/units/systemd-fsck-root.service.in b/units/systemd-fsck-root.service.in index 4b38a82c..34670668 100644 --- a/units/systemd-fsck-root.service.in +++ b/units/systemd-fsck-root.service.in @@ -16,6 +16,7 @@ Before=local-fs.target shutdown.target Wants=systemd-fsckd.socket After=systemd-fsckd.socket ConditionPathIsReadWrite=!/ +ConditionPathExists=!/run/initramfs/fsck-root OnFailure=emergency.target OnFailureJobMode=replace-irreversibly