libkmod-module: probe: check if module exists for install cmds
authorLucas De Marchi <lucas.demarchi@profusion.mobi>
Sun, 19 Feb 2012 06:20:30 +0000 (04:20 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 22 Feb 2012 15:06:56 +0000 (13:06 -0200)
commitabd5557bd178a1813faace87b585a316892c60ee
tree869f707b785f382bd0ab306033ba48aef5803472
parent050db08c57c10cb964d337c5668c4dce309b8d41
libkmod-module: probe: check if module exists for install cmds

Mimic what module-init-tools was doing before running install commands:
check if a module with the same name is already loaded in kerne, and if
it is, bail out.

This fixes the issue with some install commands used in Debian with
alsa-base package:

install snd /sbin/modprobe --ignore-install snd && { /sbin/modprobe --quiet snd-ioctl32 ; /sbin/modprobe --quiet snd-seq ; }
install snd_rawmidi /sbin/modprobe --ignore-install snd-rawmidi && { /sbin/modprobe --quiet snd-seq-midi ; : ; }
install snd_emu10k1 /sbin/modprobe --ignore-install snd-emu10k1 && { /sbin/modprobe --quiet snd-emu10k1-synth ; : ; }
install snd_pcm modprobe --ignore-install snd-pcm $CMDLINE_OPTS && { modprobe --quiet snd-pcm-oss ; : ; }
install snd_mixer modprobe --ignore-install snd-mixer $CMDLINE_OPTS && { modprobe --quiet snd-mixer-oss ; : ; }
install snd_seq modprobe --ignore-install snd-seq $CMDLINE_OPTS && { modprobe --quiet snd-seq-midi ; modprobe --quiet snd-seq-oss ; : ; }
libkmod/libkmod-module.c