summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2007-09-07 18:29:36 +0200
committermaximilian attems <max@stro.at>2007-09-07 18:29:36 +0200
commit41f9c1621e502a4af2f00f063d42e0f4ac53d6c2 (patch)
tree72d603039430cda6443ed57c09d0a15431c2fd6b /hook-functions
parentc559ab5d603454e9d3281e4e399bf5cc9f0f1ce3 (diff)
downloadinitramfs-tools-41f9c1621e502a4af2f00f063d42e0f4ac53d6c2.tar.gz
initramfs-tools-41f9c1621e502a4af2f00f063d42e0f4ac53d6c2.zip
hook-functions: probe rootfs on auto type
fix dep_add_modules(), as bonus check rootfs output so that eventual unkown rootfs get reported.
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions19
1 files changed, 16 insertions, 3 deletions
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}