The typical target system for using this approach is a desktop or server Linux system.
This third approach we consider is a good one to use when the goal is to begin with a kernel config that is based on your existing system and is thus (usually) relatively compact compared to the typical default config on a desktop or server Linux system. Here, we provide the kbuild system with a snapshot of the kernel modules currently running on the system by simply redirecting the output of lsmod(8) into a temporary file, and then providing that file to the build. This can be achieved as follows:
lsmod > /tmp/lsmod.now
cd ${LLKD_KSRC}
make LSMOD=/tmp/lsmod.now localmodconfig
The lsmod(8) utility simply lists all the kernel modules currently residing in system (kernel) memory. We will see (a lot) more on this in Chapter 4, Writing Your First Kernel Module – LKMs Part 1. We save its output in a temporary file, which we pass within the...