alsaconf - prefer /etc/modprobe.d/sound/50-sound.conf

For recent module-init-tools, prefer /etc/modprobe.d/50-sound.conf
instead of /etc/modprobe.d/sound.  The latest m-i-t version will
complain (and can ignore) files that don't follow the format.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2009-03-18 12:10:55 +01:00
parent ba38c92e69
commit 3924a249dd

View file

@ -291,6 +291,8 @@ esac
# cfgfile = base config file to remove/update the sound setting # cfgfile = base config file to remove/update the sound setting
# cfgout = new config file to write the sound setting (if different from $cfgfile) # cfgout = new config file to write the sound setting (if different from $cfgfile)
cfgout=""
cfgoldout=""
if [ -n "$cfgfile" ]; then if [ -n "$cfgfile" ]; then
if [ ! -r "$cfgfile" ]; then if [ ! -r "$cfgfile" ]; then
xecho "ERROR: The config file doesn't exist: " xecho "ERROR: The config file doesn't exist: "
@ -301,10 +303,22 @@ else
if [ "$distribution" = "gentoo" ]; then if [ "$distribution" = "gentoo" ]; then
cfgfile="/etc/modules.d/alsa" cfgfile="/etc/modules.d/alsa"
elif [ "$kernel" = "new" ]; then elif [ "$kernel" = "new" ]; then
if [ -d /etc/modprobe.d ]; then
cfgout="/etc/modprobe.d/sound"
fi
cfgfile="/etc/modprobe.conf" cfgfile="/etc/modprobe.conf"
if [ -d /etc/modprobe.d ]; then
cfgout="/etc/modprobe.d/50-sound.conf"
cfgoldout="/etc/modprobe.d/sound"
if [ ! -f $cfgout ]; then
modver=$(modprobe -V | sed -e's/^module-init-tools version //')
case "$modver" in
3.[789]*)
;;
*)
cfgout="/etc/modprobe.d/sound"
cfgoldout=""
;;
esac
fi
fi
elif [ "$distribution" = "debian" ]; then elif [ "$distribution" = "debian" ]; then
cfgfile="/etc/modutils/sound" cfgfile="/etc/modutils/sound"
elif [ -e /etc/modules.conf ]; then elif [ -e /etc/modules.conf ]; then
@ -818,7 +832,7 @@ ac_config_card () {
msg=$(xmsg " msg=$(xmsg "
Configuring %s Configuring %s
Do you want to modify %s (and %s if present)?" $CARD_DRIVER $cfgout $cfgfile) Do you want to modify %s (and %s if present)?" $CARD_DRIVER $cfgout $cfgfile)
$DIALOG --yesno "$msg" 8 50 || acex 0 $DIALOG --yesno "$msg" 10 50 || acex 0
else else
msg=$(xmsg " msg=$(xmsg "
Configuring %s Configuring %s
@ -875,6 +889,7 @@ alias sound-slot-0 $CARD_DRIVER" >> $addcfg
if [ -n "$cfgout" ]; then if [ -n "$cfgout" ]; then
[ ! -r "$cfgfile" ] || cmp -s "$TMP" "$cfgfile" || cat "$TMP" > "$cfgfile" [ ! -r "$cfgfile" ] || cmp -s "$TMP" "$cfgfile" || cat "$TMP" > "$cfgfile"
cmp -s "$addcfg" "$cfgout" || cat "$addcfg" > "$cfgout" cmp -s "$addcfg" "$cfgout" || cat "$addcfg" > "$cfgout"
test -n "$cfgoldout" && rm -f "$cfgoldout"
else else
echo "$ACB echo "$ACB
# --- ALSACONF version $version ---" >> $TMP # --- ALSACONF version $version ---" >> $TMP