So something like this will work! # If the kernel has module support, recreate modules.dep using depmod # since the contents of modules.dep do not have a consistent format across # releases. If depmod does not exist, let shell report it. if [ -d /lib/modules/$KERNEL_VERSION ]; then depmod $KERNEL_VERSION; fi