[GH-ISSUE #58] Can't build on Rocky Linux 8. #29

Open
opened 2026-10-13 21:05:30 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @Trogvars on GitHub (Dec 2, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/58

NAME="Rocky Linux"
VERSION="8.10 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.10"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.10 (Green Obsidian)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2029-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8"
ROCKY_SUPPORT_PRODUCT_VERSION="8.10"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8.10"

sudo dnf copr enable amneziavpn/amneziawg
sudo dnf install amneziawg-dkms amneziawg-tools

Without any errors.

But when I try to build dkms module got error:

build -m amneziawg -v 1.0.0

Sign command: /lib/modules/4.18.0-553.27.1.el8_10.x86_64/build/scripts/sign-file
Signing key: /var/lib/dkms/mok.key
Public certificate (MOK): /var/lib/dkms/mok.pub
Deprecated feature: REMAKE_INITRD (/var/lib/dkms/amneziawg/1.0.0/source/dkms.conf)

Running the pre_build script:
Legacy kernel - using the compat sources

Cleaning build area... done.
Building module(s)...(bad exit status: 2)
Failed command:
make -j1 KERNELRELEASE=4.18.0-553.27.1.el8_10.x86_64 -C /var/lib/dkms/amneziawg/1.0.0/build
Error! Bad return status for module build on kernel: 4.18.0-553.27.1.el8_10.x86_64 (x86_64)
Consult /var/lib/dkms/amneziawg/1.0.0/build/make.log for more information.

make: Entering directory '/var/lib/dkms/amneziawg/1.0.20241112/build'
  CC [M]  /var/lib/dkms/amneziawg/1.0.20241112/build/main.o
In file included from <command-line>:
/var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:412:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/ktime.h:266,
                 from /var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:391,
                 from <command-line>:
./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here
 static inline u64 ktime_get_coarse_boottime_ns(void)
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./include/linux/string.h:254,
                 from ./include/linux/bitmap.h:9,
                 from ./include/linux/cpumask.h:12,
                 from ./arch/x86/include/asm/cpumask.h:5,
                 from ./arch/x86/include/asm/msr.h:11,
                 from ./arch/x86/include/asm/processor.h:21,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:65,
                 from ./include/linux/jiffies.h:11,
                 from ./include/linux/ktime.h:25,
                 from /var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:391,
                 from <command-line>:
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h: In function ‘wg_reset_packet’:
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:85:34: error: ‘struct sk_buff’ has no member named ‘headers_end’; did you mean ‘headers’?
         offsetof(struct sk_buff, headers_end) -
                                  ^~~~~~~~~~~
./include/linux/fortify-string.h:260:35: note: in definition of macro ‘__fortify_memset_chk’
  size_t __fortify_size = (size_t)(size);    \
                                   ^~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
./include/linux/stddef.h:17:32: note: in expansion of macro ‘__compiler_offsetof’
 #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
                                ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:85:9: note: in expansion of macro ‘offsetof’
         offsetof(struct sk_buff, headers_end) -
         ^~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:86:35: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’?
          offsetof(struct sk_buff, headers_start));
                                   ^~~~~~~~~~~~~
./include/linux/fortify-string.h:260:35: note: in definition of macro ‘__fortify_memset_chk’
  size_t __fortify_size = (size_t)(size);    \
                                   ^~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
./include/linux/stddef.h:17:32: note: in expansion of macro ‘__compiler_offsetof’
 #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER)
                                ^~~~~~~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:86:10: note: in expansion of macro ‘offsetof’
          offsetof(struct sk_buff, headers_start));
          ^~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’?
  memset(&skb->headers_start, 0,
               ^~~~~~~~~~~~~
./include/linux/fortify-string.h:261:37: note: in definition of macro ‘__fortify_memset_chk’
  fortify_memset_chk(__fortify_size, p_size, p_size_field), \
                                     ^~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’?
  memset(&skb->headers_start, 0,
               ^~~~~~~~~~~~~
./include/linux/fortify-string.h:261:45: note: in definition of macro ‘__fortify_memset_chk’
  fortify_memset_chk(__fortify_size, p_size, p_size_field), \
                                             ^~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’?
  memset(&skb->headers_start, 0,
               ^~~~~~~~~~~~~
./include/linux/fortify-string.h:262:22: note: in definition of macro ‘__fortify_memset_chk’
  __underlying_memset(p, c, __fortify_size);   \
                      ^
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
./include/linux/fortify-string.h:261:58: warning: left-hand operand of comma expression has no effect [-Wunused-value]
  fortify_memset_chk(__fortify_size, p_size, p_size_field), \
                                                          ^
./include/linux/fortify-string.h:269:25: note: in expansion of macro ‘__fortify_memset_chk’
 #define memset(p, c, s) __fortify_memset_chk(p, c, s,   \
                         ^~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’
  memset(&skb->headers_start, 0,
  ^~~~~~
make[2]: *** [scripts/Makefile.build:318: /var/lib/dkms/amneziawg/1.0.20241112/build/main.o] Error 1
make[1]: *** [Makefile:1619: _module_/var/lib/dkms/amneziawg/1.0.20241112/build] Error 2
make: *** [Makefile:94: module] Error 2
make: Leaving directory '/var/lib/dkms/amneziawg/1.0.20241112/build'
Originally created by @Trogvars on GitHub (Dec 2, 2024). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/58 NAME="Rocky Linux" VERSION="8.10 (Green Obsidian)" ID="rocky" ID_LIKE="rhel centos fedora" VERSION_ID="8.10" PLATFORM_ID="platform:el8" PRETTY_NAME="Rocky Linux 8.10 (Green Obsidian)" ANSI_COLOR="0;32" LOGO="fedora-logo-icon" CPE_NAME="cpe:/o:rocky:rocky:8:GA" HOME_URL="https://rockylinux.org/" BUG_REPORT_URL="https://bugs.rockylinux.org/" SUPPORT_END="2029-05-31" ROCKY_SUPPORT_PRODUCT="Rocky-Linux-8" ROCKY_SUPPORT_PRODUCT_VERSION="8.10" REDHAT_SUPPORT_PRODUCT="Rocky Linux" REDHAT_SUPPORT_PRODUCT_VERSION="8.10" ``` sudo dnf copr enable amneziavpn/amneziawg sudo dnf install amneziawg-dkms amneziawg-tools ``` Without any errors. But when I try to build dkms module got error: ` build -m amneziawg -v 1.0.0` ``` Sign command: /lib/modules/4.18.0-553.27.1.el8_10.x86_64/build/scripts/sign-file Signing key: /var/lib/dkms/mok.key Public certificate (MOK): /var/lib/dkms/mok.pub Deprecated feature: REMAKE_INITRD (/var/lib/dkms/amneziawg/1.0.0/source/dkms.conf) Running the pre_build script: Legacy kernel - using the compat sources Cleaning build area... done. Building module(s)...(bad exit status: 2) Failed command: make -j1 KERNELRELEASE=4.18.0-553.27.1.el8_10.x86_64 -C /var/lib/dkms/amneziawg/1.0.0/build Error! Bad return status for module build on kernel: 4.18.0-553.27.1.el8_10.x86_64 (x86_64) Consult /var/lib/dkms/amneziawg/1.0.0/build/make.log for more information. make: Entering directory '/var/lib/dkms/amneziawg/1.0.20241112/build' CC [M] /var/lib/dkms/amneziawg/1.0.20241112/build/main.o In file included from <command-line>: /var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:412:19: error: redefinition of ‘ktime_get_coarse_boottime_ns’ static inline u64 ktime_get_coarse_boottime_ns(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./include/linux/ktime.h:266, from /var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:391, from <command-line>: ./include/linux/timekeeping.h:119:19: note: previous definition of ‘ktime_get_coarse_boottime_ns’ was here static inline u64 ktime_get_coarse_boottime_ns(void) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ./include/linux/string.h:254, from ./include/linux/bitmap.h:9, from ./include/linux/cpumask.h:12, from ./arch/x86/include/asm/cpumask.h:5, from ./arch/x86/include/asm/msr.h:11, from ./arch/x86/include/asm/processor.h:21, from ./arch/x86/include/asm/timex.h:5, from ./include/linux/timex.h:65, from ./include/linux/jiffies.h:11, from ./include/linux/ktime.h:25, from /var/lib/dkms/amneziawg/1.0.20241112/build/compat/compat.h:391, from <command-line>: /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h: In function ‘wg_reset_packet’: /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:85:34: error: ‘struct sk_buff’ has no member named ‘headers_end’; did you mean ‘headers’? offsetof(struct sk_buff, headers_end) - ^~~~~~~~~~~ ./include/linux/fortify-string.h:260:35: note: in definition of macro ‘__fortify_memset_chk’ size_t __fortify_size = (size_t)(size); \ ^~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ ./include/linux/stddef.h:17:32: note: in expansion of macro ‘__compiler_offsetof’ #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) ^~~~~~~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:85:9: note: in expansion of macro ‘offsetof’ offsetof(struct sk_buff, headers_end) - ^~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:86:35: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’? offsetof(struct sk_buff, headers_start)); ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:260:35: note: in definition of macro ‘__fortify_memset_chk’ size_t __fortify_size = (size_t)(size); \ ^~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ ./include/linux/stddef.h:17:32: note: in expansion of macro ‘__compiler_offsetof’ #define offsetof(TYPE, MEMBER) __compiler_offsetof(TYPE, MEMBER) ^~~~~~~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:86:10: note: in expansion of macro ‘offsetof’ offsetof(struct sk_buff, headers_start)); ^~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’? memset(&skb->headers_start, 0, ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:261:37: note: in definition of macro ‘__fortify_memset_chk’ fortify_memset_chk(__fortify_size, p_size, p_size_field), \ ^~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’? memset(&skb->headers_start, 0, ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:261:45: note: in definition of macro ‘__fortify_memset_chk’ fortify_memset_chk(__fortify_size, p_size, p_size_field), \ ^~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:15: error: ‘struct sk_buff’ has no member named ‘headers_start’; did you mean ‘headers’? memset(&skb->headers_start, 0, ^~~~~~~~~~~~~ ./include/linux/fortify-string.h:262:22: note: in definition of macro ‘__fortify_memset_chk’ __underlying_memset(p, c, __fortify_size); \ ^ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ ./include/linux/fortify-string.h:261:58: warning: left-hand operand of comma expression has no effect [-Wunused-value] fortify_memset_chk(__fortify_size, p_size, p_size_field), \ ^ ./include/linux/fortify-string.h:269:25: note: in expansion of macro ‘__fortify_memset_chk’ #define memset(p, c, s) __fortify_memset_chk(p, c, s, \ ^~~~~~~~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.20241112/build/queueing.h:84:2: note: in expansion of macro ‘memset’ memset(&skb->headers_start, 0, ^~~~~~ make[2]: *** [scripts/Makefile.build:318: /var/lib/dkms/amneziawg/1.0.20241112/build/main.o] Error 1 make[1]: *** [Makefile:1619: _module_/var/lib/dkms/amneziawg/1.0.20241112/build] Error 2 make: *** [Makefile:94: module] Error 2 make: Leaving directory '/var/lib/dkms/amneziawg/1.0.20241112/build' ```
Author
Owner

@itezlo commented on GitHub (Dec 31, 2024):

I was in the same situation, but finally after 2 days I've made it. Here is how:
I assume that kernel 4.18 is old, so I had to install more modern kernel. Elrepo has kernel 5.4 and 6.12.7(at the moment) for Rocky Linux 8 and 9. DKMS was causing a lot of pain, so I decided to compile from source. Steps to make:

  1. Load and unpack kernel source (FULL kernel tree), not headers only from here: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.7.tar.xz
  2. tar xf linux-6.12.7.tar.xz
  3. git clone amneziawg-linux-kernel-module and cd into its subdirectory src
  4. make symlink:
    ln -s directory_from_step_2 kernel
  5. make && sudo make install as usual
    And it's working. You can try steps above on 4.18 kernel, but without kernel sources as stated in manual. I'm 95% sure you're not gonna make it and the reason is old kernel. Hope I helped.
<!-- gh-comment-id:2566654437 --> @itezlo commented on GitHub (Dec 31, 2024): I was in the same situation, but finally after 2 days I've made it. Here is how: I assume that kernel 4.18 is old, so I had to install more modern kernel. Elrepo has kernel 5.4 and 6.12.7(at the moment) for Rocky Linux 8 and 9. DKMS was causing a lot of pain, so I decided to compile from source. Steps to make: 1. Load and unpack kernel source (FULL kernel tree), not headers only from here: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.12.7.tar.xz 2. tar xf linux-6.12.7.tar.xz 3. git clone amneziawg-linux-kernel-module and cd into its subdirectory src 4. make symlink: `ln -s directory_from_step_2 kernel` 5. make && sudo make install as usual And it's working. You can try steps above on 4.18 kernel, but without kernel sources as stated in manual. I'm 95% sure you're not gonna make it and the reason is old kernel. Hope I helped.
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-linux-kernel-module#29
No description provided.