From 811c1005d2caf8e395e22a16ea202cb230999a3d Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> Date: Sun, 8 Nov 2015 16:01:01 +0000 Subject: [PATCH] Do no include fsck, for filesystems that are non-fsckable (passno 0) Organization: Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ btrfs and xfs are examples of filesystems that do not have an fsck. Or well, they do have repair/restore utilities, but they are not fsck(8) compatible nor required to be run periodically on boot. Both packages currently ship fsck(8) compatible scripts, which do nothing. That's not useful at all. partman-xfs & partman-btrfs have been just fixed to set passno in fstab to 0 on new installations, as indeed it makes no sense to run no-op scripts for those filesystems. This patch makes fsck hook to be passno aware, and if it is set to zero, to decide not to include an fsck script for requested filesystem. It is expected that repair/recovery utilities for passno == 0 filesystems are included in the initramfs, via filesystem in question specific initramfs-hooks (e.g. xfs_repair and `btrfs check') Signed-off-by: Dimitri John Ledkov <dimitri.j.ledkov@intel.com> --- hooks/fsck | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/hooks/fsck b/hooks/fsck index 6c90996..44292b9 100755 --- a/hooks/fsck +++ b/hooks/fsck @@ -23,6 +23,7 @@ _read_fstab_entry () { echo "MNT_FSNAME=" echo "MNT_DIR=" echo "MNT_TYPE=" + echo "MNT_PASS=" fstab_files | while read file; do if [ -f "$file" ]; then @@ -39,6 +40,7 @@ _read_fstab_entry () { echo "MNT_FSNAME=$MNT_FSNAME" echo "MNT_DIR=$MNT_DIR" echo "MNT_TYPE=$MNT_TYPE" + echo "MNT_PASS=$MNT_PASS" break 2 fi MNT_DIR="" @@ -52,6 +54,11 @@ _read_fstab_entry () { get_fstype_fstab () { eval "$(_read_fstab_entry "$1")" + # Do not include fsck for non-fsckable filesystems + if [ "$MNT_PASS" = "0" ]; then + return + fi + # Not found by default. if [ "$1" = "$MNT_DIR" ]; then case "$MNT_TYPE" in -- 2.5.0