8
# There are three points to consider when upgrading or installing:
9
# - current versions of module-init-tools require configuration
10
# files to have a .conf suffix;
11
# - policy requires changes to configuration to be preserved
12
# - policy forbids including configuration outside of /etc
8
# Pre-wheezy versions of the package shipped a symlink from
9
# /etc/modprobe.d to /lib/oss-compat, so when upgrading and
10
# finding a symlink we must replace the link with a copy.
11
# The wheezy version of the package shipped a configuration
12
# file with md5sum 88222606b0a3ba8b0825c5000c754e6f which
13
# should be replaced with the new file.
14
# Anything else must be left alone (policy requires changes
15
# to configuration to be preserved).
13
16
curconffile=/etc/modprobe.d/oss-compat.conf
14
17
oldconffile=/etc/modprobe.d/oss-compat
15
18
if [ ! -f ${curconffile} -o -L ${curconffile} ]; then
16
19
if [ -L ${curconffile} ]; then
17
# Upgrading from previous testing/unstable version
20
# Upgrading from .conf link
18
21
curlinktgt=$(readlink -f ${curconffile})
19
22
rm -f ${curconffile}
20
23
cp ${curlinktgt} ${curconffile}
21
24
elif [ -L ${oldconffile} ]; then
22
# Upgrading from stable, link
25
# Upgrading from extension-less link
23
26
curlinktgt=$(readlink -f ${oldconffile})
24
27
cp ${curlinktgt} ${curconffile}
25
28
elif [ -f ${oldconffile} ]; then
26
# Upgrading from stable, file
29
# Upgrading from extension-less file
27
30
cp ${oldconffile} ${curconffile}
29
32
# Installing from scratch
30
33
cp /lib/oss-compat/linux ${curconffile}
33
# Cleanup stable configuration link
36
# Cleanup extension-less configuration link
34
37
[ -L ${oldconffile} ] && rm -f ${oldconffile}
38
# Wheezy configuration file (using install directives)
39
[ -f ${curconffile} ] && [ "$(md5sum ${curconffile} | cut -d\ -f1)" = "88222606b0a3ba8b0825c5000c754e6f" ] && cp /lib/oss-compat/linux ${curconffile}
36
41
if lsmod | grep -q "^snd " ; then
37
42
modprobe snd || true