From 41f9c1621e502a4af2f00f063d42e0f4ac53d6c2 Mon Sep 17 00:00:00 2001 From: maximilian attems Date: Fri, 7 Sep 2007 18:29:36 +0200 Subject: hook-functions: probe rootfs on auto type fix dep_add_modules(), as bonus check rootfs output so that eventual unkown rootfs get reported. --- debian/changelog | 4 +++- hook-functions | 19 ++++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/debian/changelog b/debian/changelog index 78a6922..6d8b335 100644 --- a/debian/changelog +++ b/debian/changelog @@ -17,8 +17,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low Thanks Vagrant Cascadian for the patch. * update-initramfs: Don't check for ro /boot inside of a chroot. * debian/script: Fix syntax of MODULES=dep block. + * hook-functions: Add rootfs detection for the "auto" mount output. + Thanks martin f krafft for report. (closes: #441211) - -- maximilian attems Fri, 07 Sep 2007 15:10:11 +0200 + -- maximilian attems Fri, 07 Sep 2007 18:24:40 +0200 initramfs-tools (0.90a) unstable; urgency=high diff --git a/hook-functions b/hook-functions index 61af0a5..cb2c75d 100644 --- a/hook-functions +++ b/hook-functions @@ -203,10 +203,23 @@ sys_walk_mod_add() # find and only copy root relevant modules dep_add_modules() { - local block minor root rootfs root_dev_path x + local block minor root FSTYPE root_dev_path x # findout root block device + fstype - eval "$(mount | awk '/ \/ / {print "root=" $1 "\nrootfs=" $5; exit}')" + eval "$(mount | awk '/ \/ / {print "root=" $1 "\nFSTYPE=" $5; exit}')" + + # find out real rootfs on auto type + if [ "${FSTYPE}" = "auto" ]; then + eval "$(/usr/lib/klibc/bin/fstype ${root})" + fi + + # check that fstype rootfs recognition + if [ "${FSTYPE}" = "unknown" ]; then + echo "mkinitramfs: unkown fstype on root ${root}" + echo "mkinitramfs: workaround is MODULES=most" + echo "mkinitramfs: Error please report bug against klibc" + exit 1 + fi # lvm luks root if [ "${root#/dev/mapper/}" != "${root}" ]; then @@ -236,7 +249,7 @@ dep_add_modules() fi # Add rootfs - force_load "${rootfs}" + force_load "${FSTYPE}" root_dev_path=$(readlink -f /sys/block/${block}/device) sys_walk_mod_add ${root_dev_path} -- cgit v1.2.3