diff options
author | maximilian attems <max@stro.at> | 2007-09-08 22:33:12 +0200 |
---|---|---|
committer | maximilian attems <max@stro.at> | 2007-09-08 22:33:12 +0200 |
commit | c371cfa72e473518a9ff0540b0b1d2eae83dd7aa (patch) | |
tree | a901dd3cbbb23c8c9868f0438692decc47c6672e /hook-functions | |
parent | 937188e01273de536b02f7fa782a8bb4045a009c (diff) | |
download | initramfs-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 ;)
Diffstat (limited to 'hook-functions')
-rw-r--r-- | hook-functions | 24 |
1 files changed, 20 insertions, 4 deletions
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 |