summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2016-01-21 00:26:44 +0000
committerBen Hutchings <ben@decadent.org.uk>2016-01-21 01:19:34 +0000
commite7986291017fc111d96801aac0d0d0117ec76862 (patch)
tree758dd10a6b35a9a5fbb4b1aadd813e15cfbf0520 /scripts
parenta8ed874f39a325e3d915d2aaddeb02b4ef93765b (diff)
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions6
-rw-r--r--scripts/local4
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