Building Linux API Headers

It's best to use real Raspberry Pi device with Raspberry Pi OS 10 "Buster" for this purpose.

Log in via SSH, enter root shell and run the following commands:

# mkdir /root/build-linux
# cd /root/build-linux
# tar zxf linux-5.4.51.tar.gz
# cd /root/build-linux/linux-5.4.51
# mkdir -p /root/linux-api-headers/arm-linux-gnueabi/usr
# make ARCH=arm \
  INSTALL_HDR_PATH=/root/linux-api-headers/arm-linux-gnueabi/usr \
  headers_install
# cd /root/linux-api-headers/
# find arm-linux-gnueabi -name '.install' -delete
# find arm-linux-gnueabi -name '..install.cmd' -delete
# cp -R arm-linux-gnueabi arm-linux-gnueabihf
# cd ..
# tar zcf linux-api-headers.tar.gz linux-api-headers
# rm -rf /root/linux-api-headers /root/build-linux

Then download linux-api-headers.tar.gz from Raspberry Pi to your PC.


>> Read next section or buy already prepared cross-compiler (€10) to save your time.