summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions17
-rw-r--r--scripts/local4
2 files changed, 9 insertions, 12 deletions
diff --git a/scripts/functions b/scripts/functions
index a6687c1..531d1bd 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -152,10 +152,8 @@ get_fstype ()
# but fstype is more robust
FSTYPE="unknown"
eval $(fstype "${FS}" 2> /dev/null)
- if [ "$FSTYPE" = "unknown" ] && command -v blkid >/dev/null 2>&1 ; then
+ if [ "$FSTYPE" = "unknown" ]; then
FSTYPE=$(blkid -o value -s TYPE "${FS}")
- elif [ "$FSTYPE" = "unknown" ] && [ -x /lib/udev/vol_id ]; then
- FSTYPE=$(/lib/udev/vol_id -t "${FS}" 2> /dev/null)
fi
RET=$?
@@ -308,12 +306,7 @@ resolve_device() {
case "$DEV" in
LABEL=* | UUID=* | PARTLABEL=* | PARTUUID=*)
- if command -v blkid >/dev/null 2>&1; then
- DEV="$(blkid -l -t "$DEV" -o device)" || return 1
- else
- log_warning_msg "blkid not present, so cannot resolve $DEV"
- return 1
- fi
+ DEV="$(blkid -l -t "$DEV" -o device)" || return 1
;;
esac
[ -e "$DEV" ] && echo "$DEV"
@@ -322,17 +315,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