Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1Godhell opened this issue Aug 22, 2024 · 10 comments
Open

Comments

@1Godhell
Copy link

1Godhell commented Aug 22, 2024

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
  • same make output, missing net/gso.h.

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

Thank you!

@1Godhell 1Godhell changed the title Can't compile on Raspberry Pi Bullseye Doesn't compile on Raspberry Pi Bullseye Aug 22, 2024
@1Godhell 1Godhell changed the title Doesn't compile on Raspberry Pi Bullseye Doesn't compile on Raspberry Pi Debian 11 Bullseye Aug 22, 2024
@1Godhell 1Godhell changed the title Doesn't compile on Raspberry Pi Debian 11 Bullseye Missing net/gso.h on Raspberry Pi Debian 11 Bullseye - dependency problem? Aug 26, 2024
@myanshin
Copy link

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

@ntoskernel
Copy link

same here

@leninalive
Copy link

@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.

@int-0x03
Copy link

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

Tried to do this, got the same problem: net/gso.h No such file or directory. Raspberry Pi OS

@NikitaCartes
Copy link

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

It works with vanilla Debian on Hetzner. So problem in Raspbian I think

@int-0x03
Copy link

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

It works with vanilla Debian on Hetzner. So problem in Raspbian I think

I tried to use legacy (user mode) implemetation and this works ok. It sufficient for my goals, no required super fast connection.

At the same time, I was'nt notice difference between kernel and usermode iplementation.

@NikitaCartes
Copy link

NikitaCartes commented Nov 26, 2024

I found a way to install it.

  1. Review Required Repositories
    Check the following repositories:
  1. Download Your Kernel Source Code
    a) Check your kernel version:
uname -r

b) Search for the correct version of the kernel source:

sudo apt-cache search linux-source

c) Install the source code:

sudo apt install linux-source-<version>

d) Verify where the source code is saved:

dpkg -L linux-source-<version>

Usually, it will be located at:

/usr/src/linux-source-<version>.tar.xz
  1. Build and Install the AmneziaWG Kernel Module and Tools
    Execute the following steps:

Notes

  • Replace <version> with the actual kernel version or package name.
  • Ensure all prerequisites (e.g., build-essential, gcc) are installed before building the module.
# Create a working directory
mkdir amnezia-build
cd amnezia-build

# Clone required repositories
git clone https://github.com/amnezia-vpn/amneziawg-linux-kernel-module.git
git clone https://github.com/amnezia-vpn/amneziawg-tools.git

# Prepare and extract kernel source
mkdir linux-source
tar xf /usr/src/linux-source-<version>.tar.xz -C linux-source

# Link kernel source to the AmneziaWG module
ln -s linux-source amneziawg-linux-kernel-module/src/kernel

# Build and install the kernel module
cd amneziawg-linux-kernel-module/src
make
sudo make install

# Build and install the AmneziaWG tools
cd ../../amneziawg-tools/src
make
sudo make install

# Return to the main directory
cd ../../

@vanyasem
Copy link

vanyasem commented Dec 10, 2024

Here's what I used to install amneziawg Debian package on RPi:

sudo apt -y install raspberrypi-kernel-headers # Required by amneziawg
sudo apt -y install resolvconf # Required by amneziawg

# Uncomment deb-src sources for amneziawg-dkms
sudo sed '/deb-src http/s/^#//g' -i /etc/apt/sources.list
sudo sed '/deb-src http/s/^#//g' -i /etc/apt/sources.list.d/raspi.list 
sudo apt update

sudo apt -y install gnupg2. apt-transport-https ca-certificates
gpg --keyserver keyserver.ubuntu.com --recv-keys 75c9dd72c799870e310542e24166f2c257290828
gpg --export 75c9dd72c799870e310542e24166f2c257290828 | sudo tee /usr/share/keyrings/amnezia.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/amnezia.gpg] https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/amnezia.list
echo "deb-src [signed-by=/usr/share/keyrings/amnezia.gpg] https://ppa.launchpadcontent.net/amnezia/ppa/ubuntu focal main" | sudo tee -a /etc/apt/sources.list.d/amnezia.list
sudo apt update
sudo apt -y install amneziawg

raspberrypi-kernel-headers has to be installed prior to installing amneziawg, otherwise apt picks incorrect linux headers when installing dependencies

deb-src lines have to be uncommented in sources, however uncommenting deb-src lines in sources.list is not enough. You have to uncomment deb-src lines in /etc/apt/sources.list.d/raspi.list also, as RPi's kernel sources are provided by sources in raspi.list

The rest of the installation has been taken from #27, as the official installation instructions are flawed.

@vanyasem
Copy link

vanyasem commented Dec 10, 2024

rpi-6.6.y while you are building on 6.1 kernel

The original issue is also related to raspberrypi-kernel-headers, as apt selects debian's 6.1 kernel by default unless you have raspberrypi-kernel-headers installed

See https://raspberrypi.stackexchange.com/questions/141103/why-does-apt-install-linux-headers-generic-install-old-headers-for-the-newest

@vanyasem
Copy link

The error itself is due to the fact that in Linux 6.4.10 skb_gso_segment function has been moved to a new file called net/gso.h: mkubecek/vmware-host-modules#204

The outdated sources (6.1) don't have that change, while RPi's kernel (6.6) has it. The mismatch between the two trigger the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants