Depmod could not open directory


here is my problems, using those commands:

root@colibri-imx7:~# depmod
depmod: ERROR: could not open
/lib/modules/4.1.39+gba2f75f: No such
file or directory
depmod: FATAL: could not search
modules: No such file or directory


root@colibri-imx7:~# modprobe
modprobe: FATAL: Module imx_rpmsg_tty
not found in directory

The cause is directory path : /lib/modules/4.1.39+gba2f75f is wrong.
The correct directory path is : /lib/modules/4.1.39-2.7.2+gba2f75f.
-2.7.2 is missing

How can i change this path?

When deploying custom kernel you also need to compile and deploy modules e.g. as explained in the following section of this article on our developer website.

Search for “kernel module” in the article Dominik referenced.

And then compile and deploy the kernel modules into the rootfs.

Yes, you forgot the part about deploying the Linux kernel modules as well just like my two previous speakers @max.tx and @dominik.tx already pointed out.

Thanks dominik.tx for your answer and max.tx for your help.

I forgot to do:

make -j3 modules
sudo -E make INSTALL_MOD_PATH="path-for-modules" modules_install
cd "path-for-modules"
tar cjvf kernel-modules.tar.bz2 lib/modules/*

copy kernel-modules.tar.bz2 to target in directory “path-for-file” then :

cd /
tar xjvf "path-for-file"/kernel-modules.tar.bz2


That’s what i did.
This is a list of my actions :

  1. Build of a BSP (bitbake -k console-tdx-image)
  2. In source files, modify files for device tree
  3. In source files, modify a driver
  4. Modify configuration using :
    make colibri_imx7_defconfig
    make nconfig
  5. Compile the kernel using :
    make -j3 zImage LD=${CROSS_COMPILE}ld.bfd | tee build.log
  6. Compile the device tree using :
    make imx7d-colibri-eval-v3.dtb
  7. Prepare an SD card as described in this article
  8. Replace zImage and imx7d-colibri-eval-v3.dtb on the SD card
  9. Boot the module to the U-Boot prompt and update U-Boot using :
    run setupdate
    run update

After that, depmod could not open directory

Do i forgot a step?

Thanks for the update, glad you could resolve the issue!

Note that ideally you reintegrate your changes into OpenEmbedded layers and build a complete, coherent image with modules.