User Tools

Site Tools


Sidebar

linux:scripts:show-tainted-modules.sh

This Script isn't from me, but it's quite nice to find out which modules tainted your kernel.

if [ $UID -ne 0 ] ; then
	echo "Need to be root"
	exit 1
fi

echo "****** Taint modules will be shown ******"

for MODULE in $(cat /proc/modules | awk '{print $1}')
                do
                        LIST_MODULE=0
                        modinfo -l $MODULE &>/dev/null
                        if [ $? -gt 0 ]; then
                                echo "$(printf "%-25s %-25s %-25s" module=$MODULE ERROR "Module info unavailable")"
                        else
                                LIC=$(modinfo -l $MODULE | head -1)
                                SUP=$(modinfo -F supported $MODULE | head -1)
                                test -z "$LIC" && LIC=None
                                test -z "$SUP" && SUP=no
                                GPLTEST=$(echo $LIC | grep GPL)
                                test -z "$GPLTEST" && ((LIST_MODULE++))
                                test "$SUP" != "yes" && ((LIST_MODULE++))
                                test $LIST_MODULE -gt 0 && echo "$(printf "%-25s %-25s %-25s" "module=$MODULE" "license=$LIC" "supported=$SUP")"
                                LIST_MODULES_ANY=$((LIST_MODULES_ANY + LIST_MODULE))
                        fi
                done
exit 0

linux/scripts/show-tainted-modules.sh.txt · Last modified: 2014/12/02 12:22 (external edit)