From ce7471cce94841a4e1ee35d359b9ce5e16fc3243 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 7 Dec 2023 23:11:42 +0000 Subject: gentoo auto-resync : 07:12:2023 - 23:11:42 --- net-vpn/wireguard-modules/Manifest | 1 + .../wireguard-modules-1.0.20220627-r1.ebuild | 98 ++++++++++++++++++++++ 2 files changed, 99 insertions(+) create mode 100644 net-vpn/wireguard-modules/wireguard-modules-1.0.20220627-r1.ebuild (limited to 'net-vpn/wireguard-modules') diff --git a/net-vpn/wireguard-modules/Manifest b/net-vpn/wireguard-modules/Manifest index f9d5514ac942..36f27f7d4914 100644 --- a/net-vpn/wireguard-modules/Manifest +++ b/net-vpn/wireguard-modules/Manifest @@ -1,3 +1,4 @@ DIST wireguard-linux-compat-1.0.20220627.tar.xz 264016 BLAKE2B d75f5f36b23a17c1d62a22b8d62f3ab5b46c286f1c6b731d3c17d7efba28e5bcd6b8fccdbd8a1ee0d954e7ff81fbaa5c29b8fcc1f96d6e9d1c8351031cbfb8e3 SHA512 dc3d434517a348c8025274c9a139e0fe0563a8e235a8ef666263892c8d27865297ce185dbf0dfdf94178fa1516bea978d2cb817609cbfdb0f91f6491abd2e975 +EBUILD wireguard-modules-1.0.20220627-r1.ebuild 3491 BLAKE2B 9a89fd32f25d63ae23aafe8a4830404bc8950fa252a0acea816828accb49000d186e37769c0ed18a65b29615c9c77d8f5aeb05e8862979aef58803438db08ebb SHA512 06b81c83563b612cd922e21fe26577addbbdc2d50402cc4053e532b545b441bfd577f567b39e0fb250ab9c54a6387ceef718e84dea3b382ebc25e2abbdbbcf15 EBUILD wireguard-modules-1.0.20220627.ebuild 3533 BLAKE2B 7f44fc269fbd51dc20def7805d2802a3b97a148ab5e881cd53bfbb9148f55e05fd6751e7c8df42cae567fe2426c777f8001d0d49fff2aac745b96f94021dc118 SHA512 30e7ba649cec97828f8c7f82a644dec0eb951551d2ef4cce6c7a5919830744f90ddcd26e58eb18964978a6922547e4cd296035b1437a23808777a45f1a15d23c MISC metadata.xml 662 BLAKE2B 1fb10b96eb242b02d800a0ff9b4847ffe557ae911b5bc0f9761f6887f716ec8843bce2a8cedd5987b18cf065c93271c3c2049e2ce1dd3f23103022b8632d7b34 SHA512 c7a73c72d02dbe7a6d1e30b2016d689a78bf57f7accef40d4c43202bbfb9acd6407b20303a55ba9198e88d24b03e447519a0993bfa965e28d55bd8a5b41a7464 diff --git a/net-vpn/wireguard-modules/wireguard-modules-1.0.20220627-r1.ebuild b/net-vpn/wireguard-modules/wireguard-modules-1.0.20220627-r1.ebuild new file mode 100644 index 000000000000..cb02e3c10175 --- /dev/null +++ b/net-vpn/wireguard-modules/wireguard-modules-1.0.20220627-r1.ebuild @@ -0,0 +1,98 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +MODULES_OPTIONAL_IUSE="module" +inherit linux-mod-r1 + +DESCRIPTION="Simple yet fast and modern VPN that utilizes state-of-the-art cryptography" +HOMEPAGE="https://www.wireguard.com/" + +if [[ ${PV} == 9999 ]]; then + inherit git-r3 + EGIT_REPO_URI="https://git.zx2c4.com/wireguard-linux-compat" +else + SRC_URI="https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${PV}.tar.xz" + S="${WORKDIR}/wireguard-linux-compat-${PV}" + # Please don't stabilize this package. Stable users should use gentoo-sources 5.4 or 5.10. + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug +module module-src" + +CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI" + +pkg_setup() { + if use module; then + linux-mod-r1_pkg_setup + if [[ -f $KERNEL_DIR/include/uapi/linux/wireguard.h ]]; then + eerror + eerror "WireGuard has been merged upstream into this kernel. Therefore," + eerror "you no longer need this compatibility ebuild. Instead, simply" + eerror "enable CONFIG_WIREGUARD=y in your kernel configuration." + eerror + die "Use CONFIG_WIREGUARD=y for this kernel, and do not use this package." + elif kernel_is -lt 3 10 0 || kernel_is -ge 5 6 0; then + die "This version of ${PN} requires Linux >= 3.10 and < 5.6." + fi + fi +} + +src_compile() { + local modlist=( wireguard=net:src::module ) + local modargs=( + KERNELDIR=${KV_OUT_DIR} + ) + use debug && modargs+=( CONFIG_WIREGUARD_DEBUG=y ) + use module && linux-mod-r1_src_compile +} + +src_install() { + use module && linux-mod-r1_src_install + use module-src && emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" -C src dkms-install +} + +pkg_postinst() { + if use module-src && ! use module; then + einfo + einfo "You have enabled the module-src USE flag without the module USE" + einfo "flag. This means that sources are installed to" + einfo "${ROOT}/usr/src/wireguard instead of having the" + einfo "kernel module compiled. You will need to compile the module" + einfo "yourself. Most likely, you don't want this USE flag, and should" + einfo "rather use USE=module" + einfo + fi + + if use module; then + linux-mod-r1_pkg_postinst + local old new + if [[ $(uname -r) != "${KV_FULL}" ]]; then + ewarn + ewarn "You have just built WireGuard for kernel ${KV_FULL}, yet the currently running" + ewarn "kernel is $(uname -r). If you intend to use this WireGuard 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/wireguard/version ]] && \ + old="$(< /sys/module/wireguard/version)" && \ + new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireguard.ko" 2>/dev/null)" && \ + [[ $old != "$new" ]]; then + ewarn + ewarn "You appear to have just upgraded WireGuard 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 wireguard" + ewarn " # modprobe wireguard" + ewarn + ewarn "Do note that doing this will remove current WireGuard interfaces, so you may want" + ewarn "to gracefully remove them yourself prior." + ewarn + fi + fi +} -- cgit v1.2.3