#!/bin/sh -e

PREREQS=""

prereqs() { echo "$PREREQS"; }

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

if [ -w /sys/kernel/uevent_helper ]; then
	echo > /sys/kernel/uevent_helper
fi

/lib/systemd/systemd-udevd --daemon --resolve-names=never

udevadm trigger --action=add
udevadm settle || true

if [ -d /sys/bus/scsi ]; then
	modprobe -q scsi_wait_scan && modprobe -r scsi_wait_scan || true
	udevadm settle || true
fi

# If the rootdelay parameter has been set, we wait a bit for devices
# like usb/firewire disks to settle.
if [ "$ROOTDELAY" ]; then
	sleep $ROOTDELAY
fi

# Leave udev running to process events that come in out-of-band (like USB
# connections)
