diff --git a/README.adoc b/README.adoc index a690551..3840da2 100644 --- a/README.adoc +++ b/README.adoc @@ -1268,7 +1268,7 @@ http://nairobi-embedded.org/initramfs_tutorial.html shows a full manual setup. == Linux kernel -=== Use your own .config +=== Use your own kernel config By default, we use a `.config` that is a mixture of: @@ -2483,6 +2483,44 @@ rmmod hello.ko dmesg .... +== Buildroot + +=== ccache + +We have link:https://buildroot.org/downloads/manual/manual.html#ccache[enabled ccached] builds by default. + +`BR2_CCACHE_USE_BASEDIR=n` is used, which means that: + +* absolute paths are used and GDB can find source files +* but builds are not reused across separated LKMC directories + +ccache can considerably speed up builds when you: + +* are switching between multiple configurations for a given package to bisect something out, as mentioned at: <> +* clean the build because things stopped working. We store the cache outside of this repository, so you can nuke away without fear + +The ccache directory we use is different from your system one because Buildroot builds its own ccache which could be different from you system ccache. + +You can increase the size of your cache with: + +.... +make -C buildroot/output.x86_64~/ CCACHE_OPTIONS="--max-size=20G" ccache-options +.... + +This can be done for any architecture you have already built for previously, and affects all architectures permanently, since the cache is shared for all architectures and stored outside of this repo, see: + +.... +cat ~/.buildroot-ccache/ccache.conf +.... + +I find it very relaxing to watch ccache at work with: + +.... +watch -n1 'make -C buildroot/output.x86_64~/ ccache-stats' +.... + +while a build is going on in another terminal and my cooler is humming. Especially when the hit count goes up ;-) The joys of system programming. + == Conversation === kmod diff --git a/buildroot_config_fragment b/buildroot_config_fragment index 67009ba..b822a4d 100644 --- a/buildroot_config_fragment +++ b/buildroot_config_fragment @@ -1,6 +1,9 @@ # Custom packages BR2_PACKAGE_KERNEL_MODULE=y +BR2_CCACHE=y +# Otherwise our precious debug would break! +BR2_CCACHE_USE_BASEDIR=n BR2_GCC_ENABLE_GRAPHITE=y BR2_GCC_ENABLE_LTO=y BR2_GCC_ENABLE_OPENMP=y