Building Image with official .config fail

I've managed to compile my x86 image following the build system guide, but then I discovered that I can't install any kernel module kmod packages even with the stable release.
So I've found that I can build the image using the official .config file in order to have the same vermagic code.
The problem is that I am getting lots of error building packages:

 make[3] -C package/kernel/gpio-nct5104d compile
 make[3] -C package/kernel/trelay clean-build
    ERROR: package/kernel/gpio-button-hotplug failed to build.
    ERROR: package/feeds/packages/siit failed to build.
    ERROR: package/feeds/packages/mdio-netlink failed to build.
    ERROR: package/kernel/gpio-nct5104d failed to build.
 make[3] -C package/kernel/trelay compile
    ERROR: package/kernel/trelay failed to build.
 make[2] buildinfo
 make[3] diffconfig buildversion feedsversion
 make[4] scripts/config/conf
make -r world: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/home/lele/openwrt-stable/openwrt/include/toplevel.mk:232: world] Error 1

Why do I have this error in stable release v23.05.3 buildroot?
I am using a Debian 12 VM as build system.

You should include the needed/wanted new kmods & other packages into the image that you are compiling, and not try adding them later.

Yes, but if I use the same kernel (same vermagic) as the stable releases it should be possible to install all kernel module even at runtime with opkg

While that is possible, it needs quite a bit of attention - and a lot of unnecessary build time. It's just much easier and faster not to bother and to build- and include only (but everything-) you need. Recompiling (if needed for new kmods) is quicker than the steps necessary.

Yes, there are reasons to do it nevertheless, e.g. if you want to publish updated kmods for a specific hardware to a wider audience, but in almost all other cases you're wasting your time and efforts (and watts needed on the buildhost) for an unnecessary vanity project.

4 Likes

So your advice is to build in the image only the kmod I need. If in the future I have to install new kmod I need to compile a new image with the new kmod.

Yes, build only what you need/ want (everything, kernel modules and userspace packages), rebuild if necessary.

Maybe asking for the obvious, but how can one easily select what is needed (without equally wasteful trial-and-error cycles) ? Is it possible to feed the official manifest file through some config parser ?

The default package selection for your router is the one that you really need.
Everything else is optional and depends on your wishes and feature needs.

2 Likes

Indeed, only that + luci-ssl (for most users).

And we are indeed talking about 20 minutes build time and 15 GB scratch space, vs multiple hours and well over 100 GB scratch space. So even if you had to rebuild a dozen times to get your 'ideal' package selection in, it would still save you a lot of effort compared to building 'everything' and then having to host those packages and change the opkg configs to use them). It just dozen make sense to build everything but the kitchen sink for your ~half a dozen systems at home (this might be different if you wanted to publish a community build, but not for yourself).

1 Like