38.15.2.1. kernel_modules buildroot package

An example of how to use kernel modules in Buildroot.

Usage:

./build-buildroot \
  --build-linux \
  --config 'BR2_PACKAGE_KERNEL_MODULES=y' \
  --no-overlay \
  -- \
  kernel_modules-reconfigure \
;

Then test one of the modules with:

./run --buildroot-linux --eval-after 'modprobe buildroot_hello'

As you have just seen, this sets up everything so that modprobe can correctly find the module.

./build-buildroot --build-linux and ./run --buildroot-linux are needed because the Buildroot kernel modules must use the Buildroot Linux kernel at build and run time, see also: Buildroot vanilla kernel.

The --no-overlay is required otherwise our modules.order generated by ./build-linux and installed with BR2_ROOTFS_OVERLAY overwrites the Buildroot generated one.