#!/bin/sh
# modprobe post-install script for alsa

kernel_is_2_6_or_above()
{
	case "$(uname -r)" in
		1.*|2.[012345]*) return 1 ;;
		*) return 0 ;;
	esac
}

udev_is_active()
{
	test -e /dev/.udev.tdb || test -d /dev/.udevdb || return 1
	kernel_is_2_6_or_above || return 1
	return 0
}

if udev_is_active ; then
	# Stuff is done in a /etc/dev.d/ script instead
	exit 0
fi

if [ -d /etc/alsa/modprobe-post-install.d ] ; then
	run-parts ${1:+--arg="$1"} /etc/alsa/modprobe-post-install.d
fi

[ -f /var/lib/alsa/asound.state ] && alsactl restore
