summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJeff Bailey <jbailey@ubuntu.com>2005-07-27 00:45:18 -0400
committerJeff Bailey <jbailey@ubuntu.com>2005-07-27 00:45:18 -0400
commit9ba23f790a81b3e5f017e1a293e16e593ff9ccc9 (patch)
treec4312e42e7f436da0993303783eb038e606e8637 /scripts
parent56fb010842d4ffa9bd5ff7491eeb8e12ee475006 (diff)
downloadinitramfs-tools-9ba23f790a81b3e5f017e1a293e16e593ff9ccc9.tar.gz
initramfs-tools-9ba23f790a81b3e5f017e1a293e16e593ff9ccc9.zip
initramfs-tools (0.14) breezy; urgency=low
The
Diffstat (limited to 'scripts')
-rw-r--r--scripts/functions27
1 files changed, 23 insertions, 4 deletions
diff --git a/scripts/functions b/scripts/functions
index d4e9ece..cf9f4a7 100644
--- a/scripts/functions
+++ b/scripts/functions
@@ -144,14 +144,17 @@ run_scripts()
}
ide_boot_events() {
- [ "$(echo /proc/ide/*/media)" = "/proc/ide/*/media" ] && return
+ [ -e /proc/ide ] || return
- for drive in /proc/ide/*/media; do
+ modprobe -q ide-generic
+
+ for drive in /proc/ide/*; do
+ [ -e ${drive}/media ] || continue
# nothing to do if the device has already been took in charge
- unit=${drive#/proc/ide/}; unit=${unit%/media}
+ unit=${drive#/proc/ide/}
[ -d /sys/block/$unit ] && continue
- read media < $drive
+ read media < $drive/media
case "$media" in
disk) MODULE=ide-disk ;;
cdrom) MODULE=ide-cd ;;
@@ -164,6 +167,20 @@ ide_boot_events() {
done
}
+scsi_boot_events()
+{
+ [ -e /sys/bus/scsi/devices/ ] || return
+
+ for device in /sys/bus/scsi/devices/*; do
+ read media < ${device}/type
+ case "$media" in
+ 0) modprobe -q sd_mod;
+ esac
+
+ done
+
+}
+
load_modules()
{
depmod -a
@@ -198,6 +215,8 @@ load_modules()
done
ide_boot_events
+
+ scsi_boot_events
}