1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
|
#!/bin/sh
set -e
OWNER=root.audio
PERM=0660
MAXCARDS=4
create_device1() {
if [ ! -c $1 ]; then
mknod -m $PERM $1 c 14 $2
chown $OWNER $1
fi
}
create_devices() {
tmp=0
while [ $tmp -lt $MAXCARDS ]; do
minor=`expr $2 + $tmp`
create_device1 "$1$tmp" $minor
tmp=`expr $tmp + 1`
done
}
create_devices2() {
tmp=0
while [ $tmp -lt $MAXCARDS ]; do
tmp2=0
while [ $tmp2 -lt $3 ]; do
minor=`expr $tmp \* $3`
minor=`expr $2 + $minor + $tmp2`
create_device1 "$1$tmp$tmp2" $minor
tmp2=`expr $tmp2 + 1`
done
tmp=`expr $tmp + 1`
done
}
case "$1" in
configure)
# continue as normal
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0;
;;
*)
echo "postinst called with unknown argument \`$1'" >&2;
exit 0;
;;
esac
update-rc.d alsa defaults
if [ -x /usr/bin/update-menus ]; then
update-menus
fi
if [ ! -c /dev/dsp ]; then
echo "Normal audio devices don't exist, creating them"
/dev/MAKEDEV audio
fi
|