Now that we know the revision of the Linux headers used, we can download and extract the kernel source tree by executing:
From the repository containing the pre-compiled binaries, we also fetch the `Module.symvers’ (or `Module7.symvers’ for RaspberryPi 2 and 3) which contains a list of all exported symbols from the kernel build.
Edit 2016-11-04: Updated that Module7.symvers is used for RaspberryPi 2 and 3.
Edit 2018-11-30: Updated that Module7.symvers is also used for RaspberryPi 3B+.
Edit 2019-09-26: Updated that Module71.symvers is used for RaspberryPi 4B.
Now we can setup kernel configuration and build the headers.
The two `make’ commands took about three minutes to execute on our Raspberry Pi Model B.