#!/bin/sh

kernelRelease=$(uname -r)
d=/lib/modules/$kernelRelease/kernel/drivers
s=/lib/modules/$kernelRelease/kernel/sound
x=/lib/modules/$kernelRelease/extra

[% IF CONFIG_USB_MASS_STORAGE_MODULES -%]
	echo "Loading USB Mass storage module..."
insmod $d/usb/storage/usb-storage.ko
[% END -%]

[% IF CONFIG_ALSA_MODULES -%]
echo "Loading sound modules..."
for m in soundcore core/snd core/oss/snd-mixer-oss core/snd-page-alloc core/snd-timer core/snd-pcm core/oss/snd-pcm-oss core/seq/snd-seq-device core/snd-rawmidi core/snd-hwdep
do
	[ -f $s/$m.ko ] && insmod $s/$m.ko
done
insmod $x/phStbAlsa.ko
[% END -%]

[% IF CONFIG_ALSA_USB_MODULES -%]
echo "Loading USB sound modules..."
insmod $s/usb/snd-usb-lib.ko
insmod $s/usb/snd-usb-audio.ko
[% END -%]

[% IF CONFIG_USB_HID_MODULES -%]
echo "Loading USB HID modules..."
insmod $d/hid/hid.ko
insmod $d/hid/usbhid/usbhid.ko
[% END -%]

[% IF CONFIG_WATCHDOG_MODULE -%]
[% IF CONFIG_WATCHDOG_DAEMON -%]
echo "Starting softdog..."
/sbin/softdog
[% END -%]
[% END -%]
