summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormaximilian attems <max@stro.at>2007-09-08 22:33:12 +0200
committermaximilian attems <max@stro.at>2007-09-08 22:33:12 +0200
commitc371cfa72e473518a9ff0540b0b1d2eae83dd7aa (patch)
treea901dd3cbbb23c8c9868f0438692decc47c6672e
parent937188e01273de536b02f7fa782a8bb4045a009c (diff)
downloadinitramfs-tools-c371cfa72e473518a9ff0540b0b1d2eae83dd7aa.tar.gz
initramfs-tools-c371cfa72e473518a9ff0540b0b1d2eae83dd7aa.zip
hook-functions: Add sys_walk_modalias() for IDE
instead of searching non matching sysfs modules strings PIIX_IDE != piix, just look up the modalias. modprobe likes it too ;)
-rw-r--r--debian/changelog5
-rw-r--r--hook-functions24
2 files changed, 23 insertions, 6 deletions
diff --git a/debian/changelog b/debian/changelog
index c7f7ea1..431cf50 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,9 +21,10 @@ initramfs-tools (0.91) UNRELEASED; urgency=low
Thanks martin f krafft <madduck@debian.org> for report. (closes: #441211)
* init: Disable quiet on debug bootarg. Fix new init error message.
Thanks Michael Prokop <mika@grml.org> for the patches.
- * hook-functions: MODULES=dep fix I2O detection.
+ * hook-functions: MODULES=dep fix I2O detection. Add sys_walk_modalias()
+ to catch old style IDE.
- -- maximilian attems <maks@debian.org> Sat, 08 Sep 2007 22:01:15 +0200
+ -- maximilian attems <maks@debian.org> Sat, 08 Sep 2007 22:29:42 +0200
initramfs-tools (0.90a) unstable; urgency=high
diff --git a/hook-functions b/hook-functions
index 628811b..9becfe2 100644
--- a/hook-functions
+++ b/hook-functions
@@ -200,6 +200,20 @@ sys_walk_mod_add()
done
}
+# walk /sys for relevant modalias
+sys_walk_modalias()
+{
+ local device_path modalias
+
+ device_path="$(dirname "${1}")"
+ device_path="$(dirname "${device_path}")"
+ modalias=$(cat "${device_path}/modalias")
+
+ if [ -n "${modalias}" ]; then
+ force_load "${modalias}"
+ fi
+}
+
# find and only copy root relevant modules
dep_add_modules()
{
@@ -251,13 +265,15 @@ dep_add_modules()
exit 1
fi
+ # sys walk ATA
root_dev_path=$(readlink -f /sys/block/${block}/device)
sys_walk_mod_add ${root_dev_path}
- if [ -e /proc/ide ]; then
- for x in ide-generic ide-disk ide-cd; do
- manual_add_modules "${x}"
- done
+ # catch old-style IDE
+ if [ -e /sys/bus/ide/devices/ ]; then
+ sys_walk_modalias ${root_dev_path}
+ manual_add_modules ide-disk
+ manual_add_modules ide-cd
fi
if [ -e /sys/bus/scsi/devices/ ]; then