#!/bin/bash
###############################################################################################
#
# Check kernel module type
#
# Show whether a feature is compiled into kernel or supported as a loadable module.
#
# Based on: http://www.cyberciti.biz/faq/linux-kernel-driver-feature-compiled/
#
# Written into script form by:  ajaaskel, forum.ubuntu-fi.org
#
# v1.0 2013-02-07 
#
############################################################################################### 

if [ -z "$1" ]; then
echo -e "\nShow whether a feature is compiled into kernel or supported as a loadable module.\n"
echo -e "  modstat <feature_to_search>\n"
echo -e "Example: modstat SATA\n"
exit 1
fi
echo -e "\ny=compiled into kernel, m=loadable module, n=no support\n"
grep -i "$1" "/boot/config-$(uname -r)"*

