Unable to install kmod package even though it was set to CONFIG_ALL_KMODS=y before compile

Hi. Sorry for my English ability. I compile my own openwt for router. But when installing kmod related packages, I get the message 'cannot find dependency kernel'. Although before compile I set it to CONFIG_ALL_KMODS=y. Can someone come up with a solution. Thanks


CONFIG_ALL_KMODS=y means you will build all kmods. I am guessing that you are trying to install kmods from https://downloads.openwrt.org (e.g. using opkg update; opkg install kmod-fs-xfs`).

What you should do instead is to take the kmods you compiled when you built your image, and actually copy them over to the OpenWrt device as a tree of files on the filesystem. You then mark up that filepath in /etc/opkg/customfeeds.conf and then run opkg update.

The problem you are facing is that your kernel version magic ('vermagic') is wrong. The vermagic is defined by the kernel version and the build symbols used. If you use the same options / same .config as the OpenWrt developers do -- that is, usually, build multiple targets, select all targets, select all kmods -- then you should end up with the same vermagic, and so you will be able to use OpenWrt's pre-build kernel modules.

You may also find luck searching online for "kernel version magic" or "vermagic" in the context of OpenWrt for how others achieve this

Thanks for the reply. I found a workaround using vermagic. 1- use OpenWrt developers config file, edit device, add packages but don't fix kmod related options. 2 - edit vermagic file same as vermagic kernel OpenWrt developers

Additionally it's always easier to explicitly include the module packages you (know you will) need (=y), rather than installing them later on at runtime.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.