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.sue...@arm.com>
---
 .../recipes-kernel/modutils-initscripts/files/modutils.sh | 8 +++++---
 1 file 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 a78adf5729..3274c25a69 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() {
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#145195): 
https://lists.openembedded.org/g/openembedded-core/message/145195
Mute This Topic: https://lists.openembedded.org/mt/78682160/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to