amnezia-vpn / amneziawg-linux-kernel-module

AmneziaWG Linux kernel module
https://www.wireguard.com
GNU General Public License v2.0
45 stars 9 forks source link

Missing net/gso.h on Raspberry Pi Debian 11 Bullseye - dependency problem? #18

Open 1Godhell opened 3 weeks ago

1Godhell commented 3 weeks ago

Can’t compile kernel module on Raspberry Pi - missing net/gso.h from sources, although it's in place.

Operating System: Debian GNU/Linux 11 (bullseye) Kernel: Linux 6.1.21-v8+ Architecture: arm64

apt-get full-upgrade

cd /home/***/***
git clone --depth=1 https://github.com/raspberrypi/linux
sudo apt install -y software-properties-common python3-launchpadlib gnupg2 linux-headers
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 57290828
echo "deb https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
echo "deb-src https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update

sudo apt-get install -y amneziawg

##SKIPPED##
Removing old amneziawg-1.0.0 DKMS files...

------------------------------
Deleting module version: 1.0.0
completely from the DKMS tree.
------------------------------
Done.
Loading new amneziawg-1.0.0 DKMS files...
It is likely that 6.1.21-v8+ belongs to a chroot's host
Building for 6.1.21-v8+
Building initial module for 6.1.21-v8+
Error! Bad return status for module build on kernel: 6.1.21-v8+ (aarch64)
Consult /var/lib/dkms/amneziawg/1.0.0/build/make.log for more information.
dpkg: error processing package amneziawg-dkms (--configure):
 installed amneziawg-dkms package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of amneziawg:
 amneziawg depends on amneziawg-dkms (>= 0.0.20200121-2) | amneziawg-modules (>= 0.0.20191219); however:
  Package amneziawg-dkms is not configured yet.
  Package amneziawg-modules is not installed.

dpkg: error processing package amneziawg (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 amneziawg-dkms
 amneziawg
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

Looking into the log file:

cat /var/lib/dkms/amneziawg/1.0.0/build/make.log

DKMS make.log for amneziawg-1.0.0 for kernel 6.1.21-v8+ (aarch64)
Tue Aug 20 12:05:59 MSK 2024
make: Entering directory '/var/lib/dkms/amneziawg/1.0.0/build'
CWD=$(pwd); \
cd /var/lib/dkms/amneziawg/1.0.0/build/generated; \
for patch in /var/lib/dkms/amneziawg/1.0.0/build/patches/000-initial-amneziawg.patch; do \
    patch -F3 -t -p0 -i $patch; \
done; \
cd $CWD; \
date > /var/lib/dkms/amneziawg/1.0.0/build/generated/.patches.stamp
patching file cookie.c
patching file cookie.h
patching file device.c
Hunk #1 succeeded at 380 (offset 3 lines).
Hunk #2 succeeded at 482 with fuzz 1 (offset 4 lines).
patching file device.h
patching file main.c
Hunk #1 succeeded at 9 with fuzz 3.
Hunk #2 succeeded at 43 (offset -7 lines).
Hunk #3 succeeded at 69 (offset -7 lines).
patching file messages.h
patching file netlink.c
Hunk #4 succeeded at 518 (offset -1 lines).
Hunk #5 succeeded at 563 (offset -1 lines).
Hunk #6 succeeded at 665 (offset 3 lines).
patching file noise.c
Hunk #1 succeeded at 515 (offset 31 lines).
Hunk #2 succeeded at 532 (offset 31 lines).
Hunk #3 succeeded at 665 (offset 31 lines).
Hunk #4 succeeded at 681 (offset 31 lines).
patching file noise.h
patching file receive.c
Hunk #1 succeeded at 25 (offset -8 lines).
Hunk #2 succeeded at 105 (offset -8 lines).
Hunk #3 succeeded at 128 (offset -8 lines).
Hunk #4 succeeded at 158 (offset -8 lines).
Hunk #5 succeeded at 178 (offset -8 lines).
Hunk #6 succeeded at 210 (offset -8 lines).
Hunk #7 succeeded at 566 (offset -16 lines).
Hunk #8 succeeded at 582 (offset -16 lines).
patching file send.c
Hunk #1 succeeded at 14 (offset -1 lines).
Hunk #2 succeeded at 42 (offset -1 lines).
Hunk #3 succeeded at 119 (offset -1 lines).
Hunk #4 succeeded at 135 (offset -1 lines).
Hunk #5 succeeded at 158 (offset -1 lines).
Hunk #6 succeeded at 201 (offset -1 lines).
Hunk #7 succeeded at 245 (offset -1 lines).
Hunk #8 succeeded at 332 with fuzz 3 (offset -1 lines).
Hunk #9 succeeded at 337 with fuzz 3 (offset -4 lines).
patching file socket.c
patching file socket.h
patching file uapi/wireguard.h
  CC [M]  /var/lib/dkms/amneziawg/1.0.0/build/generated/main.o
  CC [M]  /var/lib/dkms/amneziawg/1.0.0/build/generated/noise.o
  CC [M]  /var/lib/dkms/amneziawg/1.0.0/build/generated/device.o
  CC [M]  /var/lib/dkms/amneziawg/1.0.0/build/generated/peer.o
/var/lib/dkms/amneziawg/1.0.0/build/generated/device.c:23:10: fatal error: net/gso.h: No such file or directory
   23 | #include <net/gso.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:250: /var/lib/dkms/amneziawg/1.0.0/build/generated/device.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:2012: /var/lib/dkms/amneziawg/1.0.0/build/generated] Error 2
make: *** [Makefile:93: module] Error 2
make: Leaving directory '/var/lib/dkms/amneziawg/1.0.0/build'

Attempted to build manually:

git clone https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
cd amneziawg-linux-kernel-module/src
ln -s /home/***/***/linux kernel
cd /home/***/***/linux
make oldconfig && make prepare
cd /home/***/***/amneziawg-linux-kernel-module/src/
make

## SKIPPED ##
patching file uapi/wireguard.h
  CC [M]  /home/***/***/amneziawg-linux-kernel-module/src/generated/main.o
  CC [M]  /home/***/***/amneziawg-linux-kernel-module/src/generated/noise.o
  CC [M]  /home/***/***/amneziawg-linux-kernel-module/src/generated/device.o
/home/***/***/amneziawg-linux-kernel-module/src/generated/device.c:23:10: fatal error: net/gso.h: No such file or directory
   23 | #include <net/gso.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:250: /home/***/***/amneziawg-linux-kernel-module/src/generated/device.o] Error 1
make[1]: *** [Makefile:2012: /home/***/***/amneziawg-linux-kernel-module/src/generated] Error 2
make: *** [Makefile:93: module] Error 2

Of course net/gso.h is in its place inside the kernel source tree.

Thank you!

myanshin commented 2 weeks ago

The same problem here. Raspberry PI, Debian 12. Is amneziawg supposed to work on Arm 64?

ntoskernel commented 1 week ago

same here

leninalive commented 20 hours ago

@1Godhell you seems to be building against kernel version higher than installed (current branch in https://github.com/raspberrypi/linux repo is rpi-6.6.y while you are building on 6.1 kernel).

Obtain relevant kernel source by specifying branch in git clone command like -b rpi-6.1.y.