#!/bin/bash

echo "Updating module dependencies..."
/sbin/depmod

if [ -e /etc/boot.conf ]; then 
        . /etc/boot.conf
	echo "Loading modules listed in /etc/boot.conf..."
else
        . /etc/boot.conf.guinnux
	echo "Board specific boot.conf not found in /etc"
	echo "Loading modules listed in /etc/boot.conf.guinnux..."
fi

for module in ${MODULES[*]}; do
	probe_out=`/sbin/modprobe $module 2>&1`
	modprobe_res=$?
	echo -n "    $module"
	if [ $modprobe_res -ne 0 ]; then
		echo -e "\t \e[31m failed \e[0m -->  $probe_out"
	else
		echo -e "\t \e[32m ok \e[0m"
	fi
done
