]> code.ossystems Code Review - openembedded-core.git/commitdiff
modutils-initscripts: Bail out when no module is installed
authorKevin Hao <kexin.hao@windriver.com>
Wed, 7 Apr 2021 12:18:10 +0000 (20:18 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 18 Apr 2021 10:29:05 +0000 (11:29 +0100)
Fix the following warning when boot with a core-image-minimal rootfs:
  depmod: can't change directory to 'lib/modules/5.10.25-yocto-standard': No such file or directory

Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-kernel/modutils-initscripts/files/modutils.sh

index 28fe6f92d77f20086f1d974dcddd4bb48e7f8653..67e1dcd9907e2a0fe09641f3bd125bbb89571864 100755 (executable)
@@ -13,6 +13,7 @@
 
 LOAD_MODULE=modprobe
 [ -f /proc/modules ] || exit 0
+[ -d /lib/modules/`uname -r` ] || exit 0
 
 # Test if modules.dep exists and has a size greater than zero
 if [ ! -s /lib/modules/`uname -r`/modules.dep ]; then