commit:     3489b776063e361636d2b8215b9884bf29344a7d
Author:     Pavel Sobolev <contact <AT> paveloom <DOT> dev>
AuthorDate: Fri Oct 24 16:24:37 2025 +0000
Commit:     Pavel Sobolev <contact <AT> paveloom <DOT> dev>
CommitDate: Fri Oct 24 16:32:06 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=3489b776

net-vpn/amneziawg-modules: new package, add 1.0.20251009

Signed-off-by: Pavel Sobolev <contact <AT> paveloom.dev>

 net-vpn/amneziawg-modules/Manifest                 |  1 +
 .../amneziawg-modules-1.0.20251009.ebuild          | 68 ++++++++++++++++++++++
 net-vpn/amneziawg-modules/metadata.xml             | 16 +++++
 3 files changed, 85 insertions(+)

diff --git a/net-vpn/amneziawg-modules/Manifest 
b/net-vpn/amneziawg-modules/Manifest
new file mode 100644
index 0000000000..835048d064
--- /dev/null
+++ b/net-vpn/amneziawg-modules/Manifest
@@ -0,0 +1 @@
+DIST amneziawg-modules-1.0.20251009.tar.gz 406841 BLAKE2B 
ed7649619506d16f10e79e8ea13f24f7b22bd65c3cbbf66a19391ebc3b9fe3db744dee09ebf2b538bf1881c6b79084e16b5871d9b76a9673f45395d8291c0366
 SHA512 
1c807df0e54fa79f50c055229fe75a4289febd272c304528f5cfe57271aecfe2fb5a8c4480c82f527e1b0272bfae73e03b5b06119769e98d37bb4df65844f2ff

diff --git a/net-vpn/amneziawg-modules/amneziawg-modules-1.0.20251009.ebuild 
b/net-vpn/amneziawg-modules/amneziawg-modules-1.0.20251009.ebuild
new file mode 100644
index 0000000000..0e3be59adc
--- /dev/null
+++ b/net-vpn/amneziawg-modules/amneziawg-modules-1.0.20251009.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit linux-mod-r1
+
+DESCRIPTION="AmneziaWG Linux kernel module"
+HOMEPAGE="https://github.com/amnezia-vpn/amneziawg-linux-kernel-module";
+SRC_URI="https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/archive/refs/tags/v${PV}.tar.gz
 -> ${P}.tar.gz"
+
+S="${WORKDIR}/amneziawg-linux-kernel-module-${PV}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+IUSE="debug"
+
+CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI"
+
+pkg_setup() {
+       linux-mod-r1_pkg_setup
+       if kernel_is -lt 3 10 0; then
+               die "This version of ${PN} requires Linux >= 3.10."
+       fi
+}
+
+src_compile() {
+       local modlist=( amneziawg=net:src::module )
+       local modargs=(
+               KERNELDIR=${KV_OUT_DIR}
+       )
+       use debug && modargs+=( CONFIG_AMNEZIAWG_DEBUG=y )
+       linux-mod-r1_src_compile
+}
+
+src_install() {
+       linux-mod-r1_src_install
+}
+
+pkg_postinst() {
+       linux-mod-r1_pkg_postinst
+       local old new
+       if [[ $(uname -r) != "${KV_FULL}" ]]; then
+               ewarn
+               ewarn "You have just built AmneziaWG for kernel ${KV_FULL}, yet 
the currently running"
+               ewarn "kernel is $(uname -r). If you intend to use this 
AmneziaWG module on the currently"
+               ewarn "running machine, you will first need to reboot it into 
the kernel ${KV_FULL}, for"
+               ewarn "which this module was built."
+               ewarn
+       elif [[ -f /sys/module/amneziawg/version ]] && \
+                       old="$(</sys/module/amneziawg/version)" && \
+                       new="$(modinfo -F version 
"${ROOT}/lib/modules/${KV_FULL}/net/amneziawg.ko" 2>/dev/null)" && \
+                       [[ $old != "$new" ]]; then
+               ewarn
+               ewarn "You appear to have just upgraded AmneziaWG from version 
v$old to v$new."
+               ewarn "However, the old version is still running on your 
system. In order to use the"
+               ewarn "new version, you will need to remove the old module and 
load the new one. As"
+               ewarn "root, you can accomplish this with the following 
commands:"
+               ewarn
+               ewarn "    # rmmod amneziawg"
+               ewarn "    # modprobe amneziawg"
+               ewarn
+               ewarn "Do note that doing this will remove current AmneziaWG 
interfaces, so you may want"
+               ewarn "to gracefully remove them yourself prior."
+               ewarn
+       fi
+}

diff --git a/net-vpn/amneziawg-modules/metadata.xml 
b/net-vpn/amneziawg-modules/metadata.xml
new file mode 100644
index 0000000000..e7dc1a8972
--- /dev/null
+++ b/net-vpn/amneziawg-modules/metadata.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <name>Pavel Sobolev</name>
+    <email>[email protected]</email>
+  </maintainer>
+  <use>
+    <flag name="debug">Enable verbose debug reporting in dmesg of various 
AmneziaWG peer and device information.</flag>
+  </use>
+  <upstream>
+    
<bugs-to>https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues</bugs-to>
+    <remote-id 
type="github">amnezia-vpn/amneziawg-linux-kernel-module</remote-id>
+  </upstream>
+</pkgmetadata>
+

Reply via email to