summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason A. Donenfeld <zx2c4@gentoo.org>2017-08-08 02:14:24 +0200
committerJason A. Donenfeld <zx2c4@gentoo.org>2017-08-09 00:47:18 +0200
commit67e3569a9c805ad4887cd8a91561272c13f6c02a (patch)
treeb817a51aad2331eb30d1ae2b64074475b20f39a8 /net-vpn/wireguard/wireguard-9999.ebuild
parentapp-arch/p7zip: cleanup, from mm1ke's PR, manually done (diff)
downloadgentoo-67e3569a9c805ad4887cd8a91561272c13f6c02a.tar.gz
gentoo-67e3569a9c805ad4887cd8a91561272c13f6c02a.tar.bz2
gentoo-67e3569a9c805ad4887cd8a91561272c13f6c02a.zip
net-vpn/wireguard: give advice to rmmod
Package-Manager: Portage-2.3.6, Repoman-2.3.3
Diffstat (limited to 'net-vpn/wireguard/wireguard-9999.ebuild')
-rw-r--r--net-vpn/wireguard/wireguard-9999.ebuild41
1 files changed, 34 insertions, 7 deletions
diff --git a/net-vpn/wireguard/wireguard-9999.ebuild b/net-vpn/wireguard/wireguard-9999.ebuild
index ff291933ed87..d3b45bd83e14 100644
--- a/net-vpn/wireguard/wireguard-9999.ebuild
+++ b/net-vpn/wireguard/wireguard-9999.ebuild
@@ -76,13 +76,13 @@ pkg_postinst() {
fi
use module && linux-mod_pkg_postinst
- ewarn
- ewarn "This software is experimental and has not yet been released."
- ewarn "As such, it may contain significant issues. Please do not file"
- ewarn "bug reports with Gentoo, but rather direct them upstream to:"
- ewarn
- ewarn " team@wireguard.io security@wireguard.io"
- ewarn
+ einfo
+ einfo "This software is experimental and has not yet been released."
+ einfo "As such, it may contain significant issues. Please do not file"
+ einfo "bug reports with Gentoo, but rather direct them upstream to:"
+ einfo
+ einfo " team@wireguard.io security@wireguard.io"
+ einfo
if use tools; then
einfo
@@ -106,4 +106,31 @@ pkg_postinst() {
einfo "More info on getting started can be found at: https://www.wireguard.io/quickstart/"
einfo
fi
+ if use module; then
+ 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
}