From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 503941395E1 for ; Wed, 2 Nov 2016 11:32:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7C790E0C13; Wed, 2 Nov 2016 11:32:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 539C2E0C13 for ; Wed, 2 Nov 2016 11:32:24 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A2C323413C3 for ; Wed, 2 Nov 2016 11:32:21 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 166D72EF for ; Wed, 2 Nov 2016 11:32:20 +0000 (UTC) From: "Jason Donenfeld" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Jason Donenfeld" Message-ID: <1478086339.2eacdb091f9a5d84db6413d83e9a1a9a35f88dbf.zx2c4@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/wireguard/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-misc/wireguard/metadata.xml net-misc/wireguard/wireguard-0.0.20161102.ebuild net-misc/wireguard/wireguard-9999.ebuild X-VCS-Directories: net-misc/wireguard/ X-VCS-Committer: zx2c4 X-VCS-Committer-Name: Jason Donenfeld X-VCS-Revision: 2eacdb091f9a5d84db6413d83e9a1a9a35f88dbf X-VCS-Branch: master Date: Wed, 2 Nov 2016 11:32:20 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 75a7d132-12c6-4cdc-b170-59d0a9c2f04d X-Archives-Hash: 9e86c0073dfe71d9e4a645900b283878 commit: 2eacdb091f9a5d84db6413d83e9a1a9a35f88dbf Author: Jason A. Donenfeld gentoo org> AuthorDate: Wed Nov 2 11:31:36 2016 +0000 Commit: Jason Donenfeld gentoo org> CommitDate: Wed Nov 2 11:32:19 2016 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2eacdb09 net-misc/wireguard: add kmod-src option Package-Manager: portage-2.3.2 net-misc/wireguard/metadata.xml | 4 ++++ net-misc/wireguard/wireguard-0.0.20161102.ebuild | 24 ++++++++++++++++++++---- net-misc/wireguard/wireguard-9999.ebuild | 24 ++++++++++++++++++++---- 3 files changed, 44 insertions(+), 8 deletions(-) diff --git a/net-misc/wireguard/metadata.xml b/net-misc/wireguard/metadata.xml index 915f002..aa8747f 100644 --- a/net-misc/wireguard/metadata.xml +++ b/net-misc/wireguard/metadata.xml @@ -5,4 +5,8 @@ zx2c4@gentoo.org Jason A. Donenfeld + + Do not compile the kernel module. Instead install the kernel module source code to /usr/src/wireguard. + Enable verbose debug reporting in dmesg of various WireGuard peer and device information. + diff --git a/net-misc/wireguard/wireguard-0.0.20161102.ebuild b/net-misc/wireguard/wireguard-0.0.20161102.ebuild index 642325b..b6e88c4 100644 --- a/net-misc/wireguard/wireguard-0.0.20161102.ebuild +++ b/net-misc/wireguard/wireguard-0.0.20161102.ebuild @@ -21,7 +21,7 @@ fi LICENSE="GPL-2" SLOT="0" -IUSE="debug" +IUSE="debug kmod-src" DEPEND="net-libs/libmnl" RDEPEND="${DEPEND}" @@ -33,27 +33,43 @@ WARNING_PADATA="If you're running a multicore system you likely should enable CO WARNING_IP6_NF_IPTABLES="If your kernel has CONFIG_IPV6, you need CONFIG_IP6_NF_IPTABLES; otherwise WireGuard will not insert." pkg_setup() { + use kmod-src && return linux-mod_pkg_setup kernel_is -lt 4 1 0 && die "This version of ${PN} requires Linux >= 4.1" } src_compile() { use debug && BUILD_PARAMS="CONFIG_WIREGUARD_DEBUG=y ${BUILD_PARAMS}" - linux-mod_src_compile + use kmod-src || linux-mod_src_compile emake RUNSTATEDIR="${EPREFIX}/run" -C src/tools } src_install() { dodoc README.md dodoc -r contrib/examples - linux-mod_src_install emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" -C src/tools install + if use kmod-src; then + dodir /usr/src + rm -r "${WORKDIR}"/*/src/tools || die + mv "${WORKDIR}"/*/src "${ED}"usr/src/wireguard || die + else + linux-mod_src_install + fi insinto /$(get_libdir)/netifrc/net newins "${FILESDIR}"/wireguard-openrc.sh wireguard.sh } pkg_postinst() { - linux-mod_pkg_postinst + if use kmod-src; then + einfo + einfo "You have enabled the kmod-src USE flag. This means that sources" + einfo "are installed to ${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." + einfo + else + linux-mod_pkg_postinst + fi ewarn ewarn "This software is experimental and has not yet been released." ewarn "As such, it may contain significant issues. Please do not file" diff --git a/net-misc/wireguard/wireguard-9999.ebuild b/net-misc/wireguard/wireguard-9999.ebuild index 642325b..b6e88c4 100644 --- a/net-misc/wireguard/wireguard-9999.ebuild +++ b/net-misc/wireguard/wireguard-9999.ebuild @@ -21,7 +21,7 @@ fi LICENSE="GPL-2" SLOT="0" -IUSE="debug" +IUSE="debug kmod-src" DEPEND="net-libs/libmnl" RDEPEND="${DEPEND}" @@ -33,27 +33,43 @@ WARNING_PADATA="If you're running a multicore system you likely should enable CO WARNING_IP6_NF_IPTABLES="If your kernel has CONFIG_IPV6, you need CONFIG_IP6_NF_IPTABLES; otherwise WireGuard will not insert." pkg_setup() { + use kmod-src && return linux-mod_pkg_setup kernel_is -lt 4 1 0 && die "This version of ${PN} requires Linux >= 4.1" } src_compile() { use debug && BUILD_PARAMS="CONFIG_WIREGUARD_DEBUG=y ${BUILD_PARAMS}" - linux-mod_src_compile + use kmod-src || linux-mod_src_compile emake RUNSTATEDIR="${EPREFIX}/run" -C src/tools } src_install() { dodoc README.md dodoc -r contrib/examples - linux-mod_src_install emake DESTDIR="${D}" PREFIX="${EPREFIX}/usr" -C src/tools install + if use kmod-src; then + dodir /usr/src + rm -r "${WORKDIR}"/*/src/tools || die + mv "${WORKDIR}"/*/src "${ED}"usr/src/wireguard || die + else + linux-mod_src_install + fi insinto /$(get_libdir)/netifrc/net newins "${FILESDIR}"/wireguard-openrc.sh wireguard.sh } pkg_postinst() { - linux-mod_pkg_postinst + if use kmod-src; then + einfo + einfo "You have enabled the kmod-src USE flag. This means that sources" + einfo "are installed to ${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." + einfo + else + linux-mod_pkg_postinst + fi ewarn ewarn "This software is experimental and has not yet been released." ewarn "As such, it may contain significant issues. Please do not file"