

























Here is where this package uses wget inside the build (not allowed by aur rules); also doesn't the dependency on wget raise a red flag for you?
kernel_major="${1%%[^0-9]*}"
wget "https://cdn.kernel.org/pub/linux/kernel/v${kernel_major}.x/linux-${kernel}.tar.xz" -O- | tar -xvJf - --wildcards linux-${kernel}/drivers/net/wireguard "linux-${kernel}/K*" linux-${kernel}/include/uapi/linux/
ln -sf linux-${kernel} kernel;
I admit I am wrong about the dkms command being called. I thought it was being called in make dkms-install so that is fine, but the wget dependency and it being used as a makedep needs to be resolved.
@Speedy_Lex I cannot confirm this issues. Firstly, you can provide examples of successful builds on architectures other than x86, I'll add it to the list of supported ones. Until then, I can't consider this a bug. Secondly, package does NOT using wget. Check it deeply - package just adding script to package. Finaly, where did you see calling the dkms command in package? It feels like you're joking!
Hi, as petRUShka already stated, this package has multiple issues. Firstly I don't believe the arch needs to be restricted to x86_64 as this is a dkms package. Secondly, using wget in build() or package() is not allowed since it accesses the network. Finally, do not call the dkms command in this package, you should install the source and let the dkms hook install the module. Go see petRUShka's comment.
No longer builds on 6.19
cookie.c:36:23: error: variable has incomplete type 'struct blake2s_state'
36 | struct blake2s_state blake;
| ^
cookie.c:36:9: note: forward declaration of 'struct blake2s_state'
36 | struct blake2s_state blake;
| ^
cookie.c:80:16: error: incompatible pointer to integer conversion passing 'const void *' to parameter of type 'size_t' (aka 'unsigned long') [-Wint-conversion]
80 | blake2s(mac1, message, key, COOKIE_LEN, len, NOISE_SYMMETRIC_KEY_LEN);
| ^~~~~~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:145:50: note: passing argument to parameter 'keylen' here
145 | static inline void blake2s(const u8 *key, size_t keylen,
| ^
cookie.c:80:42: error: incompatible integer to pointer conversion passing 'size_t' (aka 'unsigned long') to parameter of type 'u8 *' (aka 'unsigned char *') [-Wint-conversion]
80 | blake2s(mac1, message, key, COOKIE_LEN, len, NOISE_SYMMETRIC_KEY_LEN);
| ^~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:147:11: note: passing argument to parameter 'out' here
147 | u8 *out, size_t outlen)
| ^
cookie.c:88:16: error: incompatible pointer to integer conversion passing 'const void *' to parameter of type 'size_t' (aka 'unsigned long') [-Wint-conversion]
88 | blake2s(mac2, message, cookie, COOKIE_LEN, len, COOKIE_LEN);
| ^~~~~~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:145:50: note: passing argument to parameter 'keylen' here
145 | static inline void blake2s(const u8 *key, size_t keylen,
| ^
cookie.c:88:45: error: incompatible integer to pointer conversion passing 'size_t' (aka 'unsigned long') to parameter of type 'u8 *' (aka 'unsigned char *') [-Wint-conversion]
88 | blake2s(mac2, message, cookie, COOKIE_LEN, len, COOKIE_LEN);
| ^~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:147:11: note: passing argument to parameter 'out' here
147 | u8 *out, size_t outlen)
| ^
cookie.c:94:23: error: variable has incomplete type 'struct blake2s_state'
94 | struct blake2s_state state;
| ^
cookie.c:94:9: note: forward declaration of 'struct blake2s_state'
94 | struct blake2s_state state;
| ^
6 errors generated.
make[3]: *** [/usr/lib/modules/6.19.0-2-cachyos/build/scripts/Makefile.build:289: cookie.o] Ошибка 1
make[3]: *** Ожидание завершения заданий…
noise.c:39:23: error: variable has incomplete type 'struct blake2s_state'
39 | struct blake2s_state blake;
| ^
noise.c:39:9: note: forward declaration of 'struct blake2s_state'
39 | struct blake2s_state blake;
| ^
noise.c:41:39: error: incompatible pointer to integer conversion passing 'const u8[37]' (aka 'const unsigned char[37]') to parameter of type 'size_t' (aka 'unsigned long') [-Wint-conversion]
41 | blake2s(handshake_init_chaining_key, handshake_name, NULL,
| ^~~~~~~~~~~~~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:145:50: note: passing argument to parameter 'keylen' here
145 | static inline void blake2s(const u8 *key, size_t keylen,
| ^
noise.c:42:19: error: incompatible integer to pointer conversion passing 'unsigned long' to parameter of type 'u8 *' (aka 'unsigned char *') [-Wint-conversion]
42 | NOISE_HASH_LEN, sizeof(handshake_name), 0);
| ^~~~~~~~~~~~~~~~~~~~~~
/usr/lib/modules/6.19.0-2-cachyos/build/include/crypto/blake2s.h:147:11: note: passing argument to parameter 'out' here
147 | u8 *out, size_t outlen)
| ^
noise.c:310:23: error: variable has incomplete type 'struct blake2s_state'
310 | struct blake2s_state state;
| ^
noise.c:310:9: note: forward declaration of 'struct blake2s_state'
310 | struct blake2s_state state;
| ^
noise.c:437:23: error: variable has incomplete type 'struct blake2s_state'
437 | struct blake2s_state blake;
Hi, thanks for maintaining. After last update, package can't build.
Building module(s)
# command: make -j12 KERNELRELEASE=6.17.1-arch1-1 -C /usr/lib/modules/6.17.1-arch1-1/build M=/var/lib/dkms/amneziawg/1.0.0/build
make: вход в каталог «/usr/lib/modules/6.17.1-arch1-1/build»
make[1]: вход в каталог «/var/lib/dkms/amneziawg/1.0.0/build»
CC [M] main.o
CC [M] noise.o
CC [M] device.o
CC [M] peer.o
CC [M] timers.o
CC [M] queueing.o
CC [M] send.o
CC [M] receive.o
CC [M] socket.o
CC [M] peerlookup.o
CC [M] allowedips.o
CC [M] ratelimiter.o
timers.c: В функции «wg_expired_retransmit_handshake»:
timers.c:43:32: ошибка: неявная декларация функции «from_timer»; имелось в виду «mod_timer»? [-Wimplicit-function-declaration]
43 | struct wg_peer *peer = from_timer(peer, timer,
| ^~~~~~~~~~
| mod_timer
socket.c: В функции «send4»:
socket.c:85:9: ошибка: too few arguments to function «udp_tunnel_xmit_skb»; expected 13, have 12
85 | udp_tunnel_xmit_skb(rt, sock, skb, fl.saddr, fl.daddr, ds,
| ^~~~~~~~~~~~~~~~~~~
In file included from socket.c:17:
/usr/lib/modules/6.17.1-arch1-1/build/include/net/udp_tunnel.h:134:6: замечание: объявлено здесь
134 | void udp_tunnel_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *skb,
| ^~~~~~~~~~~~~~~~~~~
socket.c: В функции «send6»:
socket.c:152:9: ошибка: too few arguments to function «udp_tunnel6_xmit_skb»; expected 13, have 12
152 | udp_tunnel6_xmit_skb(dst, sock, skb, skb->dev, &fl.saddr, &fl.daddr, ds,
| ^~~~~~~~~~~~~~~~~~~~
Hi there, thanks for maintaining AmneziaWG!
I noticed the PKGBUILD runs wget inside prepare‑sources.sh, pulling an entire kernel tarball during build()/package().
That breaks the Arch packaging rule that “build() and package() must be able to run with no network access; everything must come from source=().” (see Creating packages → “Offline build” section).
Suggested fix (either of the two works):
1. Vendor the needed WireGuard subtree.
* Add the handful of kernel files to the source=() array and patch the Makefile to use them under /usr/src/${pkgname}-${pkgver}/kernel.
* Removes the network call, keeps the DKMS logic intact.
2. Patch AmneziaWG to build against installed linux-headers only (like upstream WireGuard).
* Then you can drop prepare‑sources.sh entirely; no external tarball is needed.
Happy to test a revised PKGBUILD or submit patches if that helps—just let me know.
diff --git a/PKGBUILD b/PKGBUILD
index 1918a12..aa92c2d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -21,6 +21,18 @@ kernel_major="${1%%[^0-9]*}"
wget "https://cdn.kernel.org/pub/linux/kernel/v${kernel_major}.x/linux-${kernel}.tar.xz" -O- | tar -xvJf - --wildcards linux-${kernel}/drivers/net/wireguard "linux-${kernel}/K*" linux-${kernel}/include/uapi/linux/
ln -sf linux-${kernel} kernel;
EOF
+cat > "${srcdir}/amneziawg-linux-kernel-module-${pkgver}/kernel-tree-scripts/cleanup-sources.sh" <<'EOF'
+#!/bin/bash
+
+AWG_TEMP_DIR="$(cat /var/lib/amnezia/amneziawg/.tempdir 2>/dev/null)"
+PREFIX=${AWG_TEMP_DIR:-/tmp}
+WORKDIR="${PREFIX}/amneziawg"
+
+[ -e kernel ] && rm -rf kernel
+if [[ -d "${WORKDIR}" ]]; then
+ rm -rf "${WORKDIR}";
+fi
+EOF
cd ${srcdir}/amneziawg-linux-kernel-module-${pkgver}/src
sed -i 's/MODERN_KERNEL_SOURCES_NOT_FOUND_ERROR/KERNEL_SRC_ABSENT_ERR/g' Makefile
make DESTDIR=${pkgdir} dkms-install
this fixes "dkms exited with error code 1" for me. Constructs like test && something set return code to 1 when condition is false.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。
@Speedy_Lex I checked the PKGBUILD to see where
wgetis called. I was extremely confused as to why nobody said anything and I was kinda afraid to compile this because of your observations.But no,
wgetis not called during compilation of this package.The only purpose of THIS CODE:
is to write the content between the start
cat > "${srcdir}/amneziawg-linux-kernel-module-${pkgver}/kernel-tree-scripts/prepare-sources.sh" <<'EOF'and the end<<'EOF'to the filesrc/amneziawg-linux-kernel-module-${pkgver}/kernel-tree-scripts/prepare-sources.sh.