#!/bin/bash

KVER=$1

if [ -z $KVER ]; then
    KVER=`uname -r`
fi

MODPATH=/lib/modules/$KVER

for mod in `find $MODPATH -name "*.ko"`; do
    for fw in `modinfo -F firmware $mod`; do
        if [ ! -e "/lib/firmware/$fw" ]; then
            echo "`basename $mod` requires $fw which is missing."
        fi
    done
done
