#!/bin/sh -e
# initramfs local-top script for udev

PREREQ=""

# Output pre-requisites
prereqs()
{
	echo "$PREREQ"
}

case "$1" in
    prereqs)
	prereqs
	exit 0
	;;
esac


# Each call to udevplug can take up to three minutes
if [ -x /sbin/usplash_write ]; then
    /sbin/usplash_write "TIMEOUT 540"
    trap "/sbin/usplash_write 'TIMEOUT 15'" 0
fi

# Load drivers for storage controllers found on the PCI bus; these
# show up the same for both IDE and SCSI so there's no point
# differentiating between the two.  Do it in serial to try and
# provide some predictability for which wins each time.
/sbin/udevtrigger -s -Bpci -Iclass=0x01*

# We also need to load drivers for bridges (0x06), docking stations
# (0x0a), input devices (0x09), serial devices (0x0c) and "intelligent"
# devices (0x0e).  This is both to support filesystems on the end and
# just in case there's a keyboard on the end and things go wrong.
/sbin/udevtrigger -Bpci -Iclass=0x0[69ace]*

# If we're booting from IDE, it might not be a PCI controller,
# but might be an old fashioned ISA controller; in which case
# we need to load ide-generic.
/sbin/modprobe -Qb ide-generic
/sbin/udevsettle
