diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2020-01-15 15:51:32 +0000 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2020-01-15 15:51:32 +0000 |
commit | 21435953e16cda318a82334ddbadb3b5c36d9ea7 (patch) | |
tree | e1810a4b135afce04b34862ef0fab2bfaeb8aeca /net-vpn/wireguard-modules | |
parent | 7bc9c63c9da678a7e6fceb095d56c634afd22c56 (diff) |
gentoo resync : 15.01.2020
Diffstat (limited to 'net-vpn/wireguard-modules')
-rw-r--r-- | net-vpn/wireguard-modules/Manifest | 4 | ||||
-rw-r--r-- | net-vpn/wireguard-modules/metadata.xml | 13 | ||||
-rw-r--r-- | net-vpn/wireguard-modules/wireguard-modules-0.0.20200105.ebuild | 100 | ||||
-rw-r--r-- | net-vpn/wireguard-modules/wireguard-modules-9999.ebuild | 100 |
4 files changed, 217 insertions, 0 deletions
diff --git a/net-vpn/wireguard-modules/Manifest b/net-vpn/wireguard-modules/Manifest new file mode 100644 index 000000000000..272e70d80056 --- /dev/null +++ b/net-vpn/wireguard-modules/Manifest @@ -0,0 +1,4 @@ +DIST wireguard-linux-compat-0.0.20200105.tar.xz 261236 BLAKE2B 679902e7bea78c42fb49ec51141b1d543e966056fa341eb058266b7810dfeca09c5eb81a4c93e695762581f01fe1212acd8d5f4846a3bed8c37451b112d2d78e SHA512 a27d863e7af9ecbdad784d9ebd6b7613cb6a3a8749d2552c0ecc932c606ed08effc9600813d8cc6801748041456d6e59aab28b9ba486986c88f3d2e90a9209bd +EBUILD wireguard-modules-0.0.20200105.ebuild 3446 BLAKE2B f835ad396e15c7618cc6702b5c2e3e467be486496285eaf0304059667c65f8b48a754477071cb87cd03ba4e1b6b5ad0ccc60cffc7942920f17ca68f708d1e7b9 SHA512 c967a4990c3ebb10355a936a736c06a6d149371ba5f75ad1cccb023e3d387ae5a6f39b2af17c562ebd802369db5fb6e075f93b40f10ed1871a0d7eaef7a1229b +EBUILD wireguard-modules-9999.ebuild 3446 BLAKE2B 210f244cd0df0062bf3330f7dfd551aa9827fbc719ecdf76906f323edddb4e8f0713c9f7bc8302c10e615518d3b4a9f4da551f9412c138f9cd4d850bdacd1327 SHA512 1d3890fe6b5408fb6b623b9a2d3976c89b89183492482d9fe41d04238acda943600637cb43852f4511622742a599cc913eb02bf7c39c917a463a4d55673ba380 +MISC metadata.xml 661 BLAKE2B bb9a48b3a4f3162f8ccec522734cbc8ffdc7a92868cc7dc32adc1f7ef89f7b2eab1df573bed421d4b76204f9f38ad4fee45f9db4b41c7dc3b86d9d9bb3120a8f SHA512 e9daa3bb8fa72cc60373a3187610231cf396bc5014f33412b65d069ffd02caa659c426819aa76d46a0dd15e8cb579325b46df5296a3b2136d020ec378e5f98a5 diff --git a/net-vpn/wireguard-modules/metadata.xml b/net-vpn/wireguard-modules/metadata.xml new file mode 100644 index 000000000000..3b5b3d014e70 --- /dev/null +++ b/net-vpn/wireguard-modules/metadata.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>zx2c4@gentoo.org</email> + <name>Jason A. Donenfeld</name> + </maintainer> + <use> + <flag name="module">Compile the actual WireGuard kernel module. Most certainly you want this enabled, unless you're doing something strange.</flag> + <flag name="module-src">Install the module source code to /usr/src, in case you like building kernel modules yourself.</flag> + <flag name="debug">Enable verbose debug reporting in dmesg of various WireGuard peer and device information.</flag> + </use> +</pkgmetadata> diff --git a/net-vpn/wireguard-modules/wireguard-modules-0.0.20200105.ebuild b/net-vpn/wireguard-modules/wireguard-modules-0.0.20200105.ebuild new file mode 100644 index 000000000000..e0049debd888 --- /dev/null +++ b/net-vpn/wireguard-modules/wireguard-modules-0.0.20200105.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MODULES_OPTIONAL_USE="module" +inherit linux-mod bash-completion-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" + KEYWORDS="" +else + SRC_URI="https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${PV}.tar.xz" + S="${WORKDIR}/wireguard-linux-compat-${PV}" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug +module module-src" + +DEPEND="" +RDEPEND="${DEPEND} !<virtual/wireguard-1" + +MODULE_NAMES="wireguard(kernel/drivers/net:src)" +BUILD_TARGETS="module" +CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI" + +pkg_setup() { + if use module; then + linux-mod_pkg_setup + if kernel_is -ge 5 6 0; then + eerror + eerror "WireGuard has been merged upstream in Linux 5.6. 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 kernels >= 5.6, and do not use this package." + elif kernel_is -lt 3 10 0; then + die "This version of ${PN} requires Linux >= 3.10." + fi + fi +} + +src_compile() { + BUILD_PARAMS="KERNELDIR=${KV_OUT_DIR}" + use debug && BUILD_PARAMS="CONFIG_WIREGUARD_DEBUG=y ${BUILD_PARAMS}" + use module && linux-mod_src_compile +} + +src_install() { + use module && linux-mod_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_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 +} diff --git a/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild b/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild new file mode 100644 index 000000000000..7c5072266bfc --- /dev/null +++ b/net-vpn/wireguard-modules/wireguard-modules-9999.ebuild @@ -0,0 +1,100 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +MODULES_OPTIONAL_USE="module" +inherit linux-mod bash-completion-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" + KEYWORDS="" +else + SRC_URI="https://git.zx2c4.com/wireguard-linux-compat/snapshot/wireguard-linux-compat-${PV}.tar.xz" + S="${WORKDIR}/wireguard-linux-compat-${PV}" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" +fi + +LICENSE="GPL-2" +SLOT="0" +IUSE="debug +module module-src" + +DEPEND="" +RDEPEND="${DEPEND} !<virtual/wireguard-1" + +MODULE_NAMES="wireguard(kernel/drivers/net:src)" +BUILD_TARGETS="module" +CONFIG_CHECK="NET INET NET_UDP_TUNNEL CRYPTO_ALGAPI" + +pkg_setup() { + if use module; then + linux-mod_pkg_setup + if kernel_is -ge 5 6 0; then + eerror + eerror "WireGuard has been merged upstream in Linux 5.6. 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 kernels >= 5.6, and do not use this package." + elif kernel_is -lt 3 10 0; then + die "This version of ${PN} requires Linux >= 3.10." + fi + fi +} + +src_compile() { + BUILD_PARAMS="KERNELDIR=${KV_OUT_DIR}" + use debug && BUILD_PARAMS="CONFIG_WIREGUARD_DEBUG=y ${BUILD_PARAMS}" + use module && linux-mod_src_compile +} + +src_install() { + use module && linux-mod_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_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 +} |