Compiling WireGuard (and other things requiring linux-headers) on Debian+Mate
So ayufan's kernels have a corresponding linux-headers package for download but MrFixIt's do not? Any chance of getting one, or do we have to clone the git repo & build the whole kernel, just to build WireGuard?

What about including WireGuard in the next update? It's small and easy to build, IF you have the headers. Smaller than some of those desktop background images. Remember to optipng -o7 before releasing.

OpenVPN is a pain on a laptop. Every time you suspend & resume it, you have to kill & restart openvpn, while wireguard just doesn't care.
Finally got this working.

The kernel is arm64 and the userland is armhf, so anything to do with the kernel has to be cross-compiled.

First compile the aarch64 cross-compiling binutils & gcc from source, as they're not available in Debian stretch for armhf.
Follow this howto:
(Add any other packages it needs; I needed texinfo.)

Next get the source for your running kernel.
$ uname -a
Linux Debian-Desktop 4.4.213 #1 SMP Fri Feb 7 13:03:55 EST 2020 aarch64 GNU/Linux

Look at and find the corresponding commit.
Currently that's 209da1a which is 15th from the top.

$ mkdir kernel-out
$ gunzip -c /proc/config.gz | sed s/CONFIG_LOCALVERSION_AUTO=y/CONFIG_LOCALVERSION_AUTO=n/ > kernel-out/.config

Make the output directory & copy the config from the running kernel into it ("As a generated output, the .config file must be in $KBUILD_OUTPUT") with one change. The change is necessary to get the kernel version number to exactly line up so the module can be loaded.

Now we get the kernel sources.
$ git clone --depth=15
$ cd rockchip-kernel
$ git checkout 209da1a

It only needs modules_prepare, we don't need to build the whole kernel.
$ LOCALVERSION="" make -j6 O=../kernel-out ARCH=arm64 CROSS_COMPILE=/opt/aarch64/bin/aarch64-linux-gnu- modules_prepare

Create the symlink that the linux-headers package normally does.
$ sudo ln -s /home/rock/build-area/kernel-out/ /lib/modules/$(uname -r)/build

(Using the actual pathname of your output directory.)

Now get the WireGuard source & build it according to the usual instructions, with one change.

The kernel module needs to be cross-compiled:
$ make -C wireguard-linux-compat/src -j$(nproc) ARCH=arm64 CROSS_COMPILE=/opt/aarch64/bin/aarch64-linux-gnu-

The rest of the make lines are the same.

Possibly Related Threads…
Thread Author Replies Views Last Post
  Unable to install Debian Bullseye because of missing wifi firmware Pino64 1 143 05-13-2022, 06:52 PM
Last Post: wdt
  PBP won’t boot from eMMC after Debian update / Tow-Boot installer won’t boot from SD Pino64 21 681 05-12-2022, 05:00 AM
Last Post: Pino64
  Dual boot Manjaro and Debian? dieselnutjob 3 350 03-26-2022, 07:17 AM
Last Post: dieselnutjob
  Unsuccessful using danielt's unofficial Debian installer on the PBP joeDoe 1 441 03-25-2022, 08:15 AM
Last Post: danielt
  Problems installing/ booting a different Linux on PinebookPro v-man 3 585 03-22-2022, 06:37 PM
Last Post: pentamassiv
  Kali Linux for Pinebook Pro Luke 90 88,190 03-04-2022, 01:43 AM
Last Post: Tazdevl
  Installing debian on pinebook pro (deb installer/emmc) ljones 14 2,716 02-08-2022, 02:47 AM
Last Post: Humid Stylus
  Debian GPU Support Atton 5 2,832 12-02-2021, 05:37 PM
Last Post: cobratbq
  Official Debian support moonwalkers 62 22,290 11-19-2021, 09:49 AM
Last Post: alpopa
  How to mainline kernel on daniel thompson's debian installer? hellojack 6 1,746 11-16-2021, 02:41 PM
Last Post: TRS-80

Forum Jump:

Users browsing this thread: 1 Guest(s)