diff options
author | maximilian attems <maks@debian.org> | 2010-03-28 15:57:33 +0200 |
---|---|---|
committer | maximilian attems <maks@debian.org> | 2010-03-28 15:58:49 +0200 |
commit | 87d45befb832480954c8c025aee823f1627b9526 (patch) | |
tree | 2e6d096a1c3a0741d47b564918863949aa31d445 | |
parent | 9588c32006983fda80f393458e36fe3d7e590598 (diff) | |
download | initramfs-tools-87d45befb832480954c8c025aee823f1627b9526.tar.gz initramfs-tools-87d45befb832480954c8c025aee823f1627b9526.zip |
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 <tbm@cyrius.com>
Signed-off-by: maximilian attems <maks@debian.org>
-rw-r--r-- | hook-functions | 15 |
1 files changed, 8 insertions, 7 deletions
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 |