Here is a version of the script that is udev-compatible.  On a udev
system device files are dynamically created after modules initialize;
consequently, on a udev system, actions like asfxload cannot be done
from a modprobe-post-install script; they must be done instead from a
dev script.  I'll leave the writing of a dev script as an exercise for
the awesfx maintainer for now.  :)  To prepare such a script one needs
to know what device files asfxload accesses.


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

[ -x /usr/bin/asfxload ] || exit 0
[ -f /etc/default/asfxload ] || exit 0
. /etc/default/asfxload
[ -f "$SOUNDFONT_FILE" ] || exit 0

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
}

udev_is_active && exit 0

case "$1" in
snd-emu8000-synth)
        echo -n "Loading SoundFonts..."
        /usr/bin/asfxload $ASFXLOAD_OPTS "$SOUNDFONT_FILE" && echo "done." || 
echo "failed."
        ;;
esac
exit 0

-- 
Thomas Hood <[EMAIL PROTECTED]>



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to