参考:
https://www.wireguard.com/compilation/
https://blog.kelu.org/tech/2020/03/09/raspberrypi-install-wireguard.html
- 安装依赖库和编译所需工具
$ sudo apt install libmnl-dev git
$ sudo apt install libelf-dev build-essential pkg-config
- 安装内核头文件
$ sudo apt install raspberrypi-kernel-headers
- 克隆
cd /usr/local/src
$ git clone https://git.zx2c4.com/wireguard-linux-compat
$ git clone https://git.zx2c4.com/wireguard-tools
- 编译安装module
$ make -C wireguard-linux-compat/src -j$(nproc)
$ sudo make -C wireguard-linux-compat/src install
# 你可以使用 `make debug` 查看更多信息
- 编译安装wg
$ make -C wireguard-tools/src -j$(nproc)
$ sudo make -C wireguard-tools/src install