Building Linux API Headers

  1. Install Debian 10.5.0 for amd64 via NetInst ISO file into the separate virtual machine.
  2. Download linux-4.19.tar.gz to your home directory.
  3. Open the terminal, and run following commands:
    $ cd ~
    $ make build-linux
    $ cd build-linux
    $ mkdir -p gcc-8.3.0-glibc-2.28/i586-linux-gnu/usr
    $ mkdir -p gcc-8.3.0-glibc-2.28/x86_64-linux-gnu/usr
    $ tar zxf ../linux-4.19.tar.gz
    $ cd linux-4.19
    $ make ARCH=x86 \
        INSTALL_HDR_PATH=~/build-linux/gcc-8.3.0-glibc-2.28/i586-linux-gnu/usr headers_install
    $ cd ..
    $ rm -rf linux-4.19
    $ tar zxf ../linux-4.19.tar.gz
    $ cd linux-4.19
    $ make ARCH=x86_64 \
        INSTALL_HDR_PATH=~/build-linux/gcc-8.3.0-glibc-2.28/x86_64-linux-gnu/usr headers_install
    $ cd ..
    $ rm -rf linux-4.19
    $ find . -name '.install' -delete
    $ find . -name '..install.cmd' -delete
    $ tar zcf ~/linux-api-headers-4.19.tar.gz \
        gcc-8.3.0-glibc-2.28
    $ cd ~
    $ rm -rf build-linux
    Then copy linux-api-headers-4.19.tar.gz from your virtual machine to the host. You can use small USB thumbdrive with FAT filesystem for that purpose. Use df command in Linux to see where it was mounted, and cp command to copy files.


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