build-buildroot: add the --no-overlay option

Initial motivation: modprobe. More to come most likely.
This commit is contained in:
Ciro Santilli 六四事件 法轮功
2018-11-06 00:00:00 +00:00
parent 72167f9f68
commit 753cbe68ff
4 changed files with 23 additions and 12 deletions

View File

@@ -3172,9 +3172,7 @@ We are not installing out custom `./build-modules` modules there, because:
* we don't know the right way. Why is there no `install` or `install_modules` target for kernel modules?
+
This can of course be solved by running Buildroot in verbose mode, and copying whatever it is doing.
+
See also: https://askubuntu.com/questions/299676/how-to-install-3rd-party-module-so-that-it-is-loaded-on-boot
This can of course be solved by running Buildroot in verbose mode, and copying whatever it is doing, initial exploration at: https://stackoverflow.com/questions/22783793/how-to-install-kernel-modules-from-source-code-error-while-make-process/53169078#53169078
* we would have to think how to not have to include the kernel modules twice in the root filesystem, but still have <<9p>> working for fast development as described at: <<your-first-kernel-module-hack>>
=== kmod
@@ -11322,17 +11320,15 @@ A custom build script can give you more flexibility: e.g. the package can be mad
Source: link:buildroot_packages/kernel_modules/[]
An example of how to kernel modules in Buildroot.
Procedure described in detail at: https://stackoverflow.com/questions/40307328/how-to-add-a-linux-kernel-driver-module-as-a-buildroot-package/43874273#43874273
An example of how to use kernel modules in Buildroot.
Usage:
....
rm -rf "$(./getvar out_rootfs_overlay_dir)/lib/modules"
./build-buildroot \
--build-linux \
--config 'BR2_PACKAGE_KERNEL_MODULES=y' \
--no-overlay \
-- \
kernel_modules-reconfigure \
;
@@ -11346,10 +11342,14 @@ Then test one of the modules with:
Source: link:buildroot_packages/kernel_modules/buildroot_hello.c[]
The `rm -rf` is required otherwise our `modules.order` generated by `./build-linux` and installed with `BR2_ROOTFS_OVERLAY` overwrites the Buildroot generated one.
As you have just seen, this sets up everything so that <<modprobe>> can conrrectly 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.
The `--no-overlay` is required otherwise our `modules.order` generated by `./build-linux` and installed with `BR2_ROOTFS_OVERLAY` overwrites the Buildroot generated one.
Implementattion described at: https://stackoverflow.com/questions/40307328/how-to-add-a-linux-kernel-driver-module-as-a-buildroot-package/43874273#43874273
==== patches directory
===== patches/global