aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Sueiro <diego.sueiro@arm.com>2020-12-03 11:18:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-12-06 23:16:50 +0000
commit572f3045faa0a937947fbd56bcfef7bad55e9da6 (patch)
treea2e7d54517b11311f13724a16b52fa2719a5939f
parenta2bf422cc498bebfbeedc9382b2cc1533f78bbfd (diff)
downloadopenembedded-core-contrib-572f3045faa0a937947fbd56bcfef7bad55e9da6.tar.gz
openembedded-core-contrib-572f3045faa0a937947fbd56bcfef7bad55e9da6.tar.bz2
openembedded-core-contrib-572f3045faa0a937947fbd56bcfef7bad55e9da6.zip
modutils-initscripts: Fix modules.dep creation when USE_DEPMOD="0"
When having USE_DEPMOD="0" it is expected that in the first boot that the modules.dep is generated. To achieve this we need to check if modules.dep exists and has a size greater than zero. This verification also needs to be done regardless of whether the /etc/modules or /etc/modules-load.d directories exist. Signed-off-by: Diego Sueiro <diego.sueiro@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xmeta/recipes-kernel/modutils-initscripts/files/modutils.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
index a78adf5729b..3274c25a690 100755
--- a/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
+++ b/meta/recipes-kernel/modutils-initscripts/files/modutils.sh
@@ -13,14 +13,16 @@
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
+# Test if modules.dep exists and has a size greater than zero
+if [ ! -s /lib/modules/`uname -r`/modules.dep ]; then
[ "$VERBOSE" != no ] && echo "Calculating module dependencies ..."
depmod -Ae
fi
+[ -f /etc/modules ] || [ -d /etc/modules-load.d ] || exit 0
+[ -e /sbin/modprobe ] || LOAD_MODULE=insmod
+
loaded_modules=" "
process_file() {