modprobe: don't run remove commands for modules which are not loaded
commita23b80e3d3f18a88630a6f01f06d4e5ba6acec43
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Wed, 30 Sep 2009 16:22:11 +0000 (30 17:22 +0100)
committerAlan Jenkins <alan-jenkins@tuffmail.co.uk>
Thu, 1 Oct 2009 09:15:40 +0000 (1 10:15 +0100)
treecdced8c6fa4f0c977fe9c67ba0dbab188f0c7afe
parenta1babd3e7560d88209367bc7e3daa1cc43c96fcc
modprobe: don't run remove commands for modules which are not loaded

modprobe.d(5) strongly suggests you can use remove commands like this:

    remove snd-pcm /sbin/modprobe -r --ignore-remove snd-pcm-oss && \
/sbin/modprobe -r snd-pcm

Unfortunately, given that snd-pcm-oss depends on snd-pcm, this causes
an infinite fork-loop.

The solution is an exact parallel of the approach taken for install
commands.  AFAIK no-one uses remove commands, but it's good to make
the insmod() and rmmod() functions consistent.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
modprobe.c