[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#767471: [PATCH initramfs-tools 4/4] Pass filesystem type from /etc/fstab to fsck when checking /usr



Unlike root, the types of all other filesystems in /etc/fstab have
historically been honoured and we should continue to do so.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/functions | 6 +++++-
 scripts/local     | 4 ++--
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/functions b/scripts/functions
index 2c36ed2..990fe6c 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -306,17 +306,21 @@ resolve_device() {
 # Check a file system.
 # $1=device
 # $2=mountpoint (for diagnostics only)
+# $3=type (may be "auto")
 _checkfs_once()
 {
 	DEV="$1"
 	NAME="$2"
+	TYPE="$3"
 	if [ "$NAME" = "/" ] ; then
 		NAME="root"
 	fi
 	FSCK_LOGFILE=/run/initramfs/fsck.log
 	FSCK_STAMPFILE=/run/initramfs/fsck-${NAME#/}
 
-	TYPE=$(get_fstype "$1")
+	if [ "${TYPE}" = "auto" ]; then
+		TYPE="$(get_fstype "${DEV}")"
+	fi
 
 	FSCKCODE=0
 	if ! command -v fsck >/dev/null 2>&1; then
diff --git a/scripts/local b/scripts/local
index af56e66..3558f7a 100644
--- a/scripts/local
+++ b/scripts/local
@@ -136,7 +136,7 @@ local_mount_root()
 	# FIXME This has no error checking
 	modprobe ${FSTYPE}
 
-	checkfs ${ROOT} root
+	checkfs ${ROOT} root "${FSTYPE}"
 
 	# FIXME This has no error checking
 	# Mount root
@@ -166,7 +166,7 @@ local_mount_fs()
 	modprobe "${MNT_TYPE}"
 
 	if [ "$MNT_PASS" != 0 ]; then
-		checkfs "$MNT_FSNAME" "$MNT_DIR"
+		checkfs "$MNT_FSNAME" "$MNT_DIR" "${MNT_TYPE}"
 	fi
 
 	# FIXME This has no error checking

Attachment: signature.asc
Description: Digital signature


Reply to: