summaryrefslogtreecommitdiffstats
path: root/meta/recipes-kernel/modutils/files/modutils.sh
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-kernel/modutils/files/modutils.sh')
-rwxr-xr-xmeta/recipes-kernel/modutils/files/modutils.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/meta/recipes-kernel/modutils/files/modutils.sh b/meta/recipes-kernel/modutils/files/modutils.sh
new file mode 100755
index 0000000000..9049bbb8aa
--- /dev/null
+++ b/meta/recipes-kernel/modutils/files/modutils.sh
@@ -0,0 +1,36 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: module-init-tools
4# Required-Start:
5# Required-Stop:
6# Should-Start: checkroot
7# Should-stop:
8# Default-Start: S
9# Default-Stop:
10# Short-Description: Process /etc/modules.
11# Description: Load the modules listed in /etc/modules.
12### END INIT INFO
13
14LOAD_MODULE=modprobe
15[ -f /proc/modules ] || exit 0
16[ -f /etc/modules ] || exit 0
17[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
18
19if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then
20 [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
21 depmod -Ae
22fi
23
24[ "$VERBOSE" != no ] && echo -n "Loading modules: "
25(cat /etc/modules; echo; ) |
26while read module args
27do
28 case "$module" in
29 \#*|"") continue ;;
30 esac
31 [ "$VERBOSE" != no ] && echo -n "$module "
32 eval "$LOAD_MODULE $module $args >/dev/null 2>&1"
33done
34[ "$VERBOSE" != no ] && echo
35
36exit 0