From 87d45befb832480954c8c025aee823f1627b9526 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Sun, 28 Mar 2010 15:57:33 +0200 Subject: MODULES=DEP: Check superblock on initramfs block do not trust mount as this is not the thing we look at on boot. (closes: #519800) as bonus run blkid if fstype has no idea. Reported-by: Martin Michlmayr Signed-off-by: maximilian attems --- hook-functions | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'hook-functions') diff --git a/hook-functions b/hook-functions index 60bc2e9..cf8ea54 100644 --- a/hook-functions +++ b/hook-functions @@ -263,17 +263,18 @@ dep_add_modules() fi root="$(readlink -f ${root})" - # find out real rootfs on auto type - if [ "${FSTYPE}" = "auto" ]; then - eval "$(/usr/lib/klibc/bin/fstype ${root})" - fi + # do not trust mount, check superblock + eval "$(/usr/lib/klibc/bin/fstype ${root})" # check that fstype rootfs recognition if [ "${FSTYPE}" = "unknown" ]; then - echo "mkinitramfs: unknown fstype on root ${root}" - echo "mkinitramfs: workaround is MODULES=most" - echo "mkinitramfs: Error please report bug on initramfs-tools" + FSTYPE=$(blkid -o value -s TYPE "${root}") + if [ -z "${FSTYPE}" ]; then + echo "mkinitramfs: unknown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "Error please report bug on initramfs-tools" exit 1 + fi fi # Add rootfs -- cgit v1.2.3