From 75f2c0002581e8ce2abfaec2f6837ec3493f3399 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 20 Jan 2017 17:33:37 +0100 Subject: [PATCH] recovery init: pass filesystem type to mount command For block devices we can get the filesystem in the partition using the 'blkid' command. This cleans up some warnings on mounting: EXT4-fs (sda2): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (sda2): couldn't mount as ext2 due to feature incompatibilities EXT4-fs (mmcblk0p4): couldn't mount as ext3 due to feature incompatibilities EXT4-fs (mmcblk0p4): couldn't mount as ext2 due to feature incompatibilities Signed-off-by: Javier Viguera --- .../recovery/recovery-initramfs/recovery-initramfs-init | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init index eb70e699e..dbaf970b5 100644 --- a/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init +++ b/meta-digi-dey/recipes-core/recovery/recovery-initramfs/recovery-initramfs-init @@ -161,7 +161,8 @@ mount_external_disks() { local dev_name=$(basename "${i}") local mount_dir="${USB_MOUNT_DIR}/${dev_name}" mkdir -p "${mount_dir}" - mount "/dev/${dev_name}" "${mount_dir}" 2>/dev/null + FSTYPE="$(blkid /dev/${dev_name} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')" + mount -r ${FSTYPE:+-t ${FSTYPE}} "/dev/${dev_name}" "${mount_dir}" done done } @@ -226,7 +227,8 @@ mount_emmc_block() { local partition_block="/dev/mmcblk0p$(parted -s /dev/mmcblk0 print | sed -ne "s,^[^0-9]*\([0-9]\+\).*\<${1}\>.*,\1,g;T;p")" # Mount the volume. mkdir -p "${2}" - mount -t auto "${partition_block}" "${2}" >/dev/null 2>&1 + FSTYPE="$(blkid ${partition_block} | sed -e 's,.*TYPE="\([^"]\+\)".*,\1,g')" + mount -r ${FSTYPE:+-t ${FSTYPE}} "${partition_block}" "${2}" if [ "$?" != "0" ]; then log_warning "Could not mount '${1}' partition (${partition_block})" fi