aboutsummaryrefslogtreecommitdiff
path: root/files/sound/devices.sh
blob: 00d9168745ad4069361239bab7d6cfad06e4f4df (plain)
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
#!/bin/sh

VSERVER="$1"

if [ -z "$VSERVER" ]; then
  ROOT="/"
else
  ROOT="/var/vservers/$1"
fi

if [ "$2" == "--check" ]; then
  if [ -e "$ROOT/dev/snd/controlC0" ]; then
    exit 0
  else
    exit 1
  fi
fi

mkdir $ROOT/dev/snd
mknod $ROOT/dev/snd/controlC0 c 116 7
mknod $ROOT/dev/snd/hwC0D2    c 116 6
mknod $ROOT/dev/snd/pcmC0D0c  c 116 5
mknod $ROOT/dev/snd/pcmC0D0p  c 116 4
mknod $ROOT/dev/snd/seq       c 116 3
mknod $ROOT/dev/snd/timer     c 116 2

if [ -z "$VSERVER" ]; then
  chown -R root:audio /dev/snd
else
  vserver $VSERVER exec chown -R root:audio /dev/snd
fi

chmod 660 $ROOT/dev/snd/*