dev/bash/kernel/delMods.sh

11 lines
332 B
Bash
Raw Normal View History

2011-04-09 19:06:44 +04:00
#!/bin/bash
allneedmodnames=`lsmod | tail -n +2 | cut -d ' ' -f1`
allneedfnames=`for m in \`echo $allneedmodnames\` ; do /sbin/modinfo -F filename $m ; done`
for file in `find /lib/modules/\`uname -r\`/kernel/sound | grep "\.ko"` ; do
if [[ ! `echo $allneedfnames | grep $file 2>/dev/null` ]] ; then
rm -f $file
fi
done