diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh')
-rwxr-xr-x | poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh new file mode 100755 index 000000000..a78adf572 --- /dev/null +++ b/poky/meta/recipes-kernel/modutils-initscripts/files/modutils.sh @@ -0,0 +1,52 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: module-init-tools +# Required-Start: +# Required-Stop: +# Should-Start: checkroot +# Should-stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Process /etc/modules. +# Description: Load the modules listed in /etc/modules. +### END INIT INFO + +LOAD_MODULE=modprobe +[ -f /proc/modules ] || exit 0 +[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0 +[ -e /sbin/modprobe ] || LOAD_MODULE=insmod + +if [ ! -f /lib/modules/`uname -r`/modules.dep ]; then + [ "$VERBOSE" != no ] && echo "Calculating module dependencies ..." + depmod -Ae +fi + +loaded_modules=" " + +process_file() { + file=$1 + + (cat $file; echo; ) | + while read module args + do + case "$module" in + \#*|"") continue ;; + esac + [ -n "$(echo $loaded_modules | grep " $module ")" ] && continue + [ "$VERBOSE" != no ] && echo -n "$module " + eval "$LOAD_MODULE $module $args >/dev/null 2>&1" + loaded_modules="${loaded_modules}${module} " + done +} + +[ "$VERBOSE" != no ] && echo -n "Loading modules: " +[ -f /etc/modules ] && process_file /etc/modules + +[ -d /etc/modules-load.d ] || exit 0 + +for f in /etc/modules-load.d/*.conf; do + process_file $f +done +[ "$VERBOSE" != no ] && echo + +exit 0 |