1 |
commit: 67e3569a9c805ad4887cd8a91561272c13f6c02a |
2 |
Author: Jason A. Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Aug 8 00:14:24 2017 +0000 |
4 |
Commit: Jason Donenfeld <zx2c4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 8 22:47:18 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67e3569a |
7 |
|
8 |
net-vpn/wireguard: give advice to rmmod |
9 |
|
10 |
Package-Manager: Portage-2.3.6, Repoman-2.3.3 |
11 |
|
12 |
net-vpn/wireguard/wireguard-0.0.20170726.ebuild | 41 ++++++++++++++++++++----- |
13 |
net-vpn/wireguard/wireguard-9999.ebuild | 41 ++++++++++++++++++++----- |
14 |
2 files changed, 68 insertions(+), 14 deletions(-) |
15 |
|
16 |
diff --git a/net-vpn/wireguard/wireguard-0.0.20170726.ebuild b/net-vpn/wireguard/wireguard-0.0.20170726.ebuild |
17 |
index ff291933ed8..d3b45bd83e1 100644 |
18 |
--- a/net-vpn/wireguard/wireguard-0.0.20170726.ebuild |
19 |
+++ b/net-vpn/wireguard/wireguard-0.0.20170726.ebuild |
20 |
@@ -76,13 +76,13 @@ pkg_postinst() { |
21 |
fi |
22 |
use module && linux-mod_pkg_postinst |
23 |
|
24 |
- ewarn |
25 |
- ewarn "This software is experimental and has not yet been released." |
26 |
- ewarn "As such, it may contain significant issues. Please do not file" |
27 |
- ewarn "bug reports with Gentoo, but rather direct them upstream to:" |
28 |
- ewarn |
29 |
- ewarn " team@×××××××××.io security@×××××××××.io" |
30 |
- ewarn |
31 |
+ einfo |
32 |
+ einfo "This software is experimental and has not yet been released." |
33 |
+ einfo "As such, it may contain significant issues. Please do not file" |
34 |
+ einfo "bug reports with Gentoo, but rather direct them upstream to:" |
35 |
+ einfo |
36 |
+ einfo " team@×××××××××.io security@×××××××××.io" |
37 |
+ einfo |
38 |
|
39 |
if use tools; then |
40 |
einfo |
41 |
@@ -106,4 +106,31 @@ pkg_postinst() { |
42 |
einfo "More info on getting started can be found at: https://www.wireguard.io/quickstart/" |
43 |
einfo |
44 |
fi |
45 |
+ if use module; then |
46 |
+ local old new |
47 |
+ if [[ $(uname -r) != "${KV_FULL}" ]]; then |
48 |
+ ewarn |
49 |
+ ewarn "You have just built WireGuard for kernel ${KV_FULL}, yet the currently running" |
50 |
+ ewarn "kernel is $(uname -r). If you intend to use this WireGuard module on the currently" |
51 |
+ ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for" |
52 |
+ ewarn "which this module was built." |
53 |
+ ewarn |
54 |
+ elif [[ -f /sys/module/wireguard/version ]] && \ |
55 |
+ old="$(< /sys/module/wireguard/version)" && \ |
56 |
+ new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireguard.ko" 2>/dev/null)" && \ |
57 |
+ [[ $old != "$new" ]]; then |
58 |
+ ewarn |
59 |
+ ewarn "You appear to have just upgraded WireGuard from version v$old to v$new." |
60 |
+ ewarn "However, the old version is still running on your system. In order to use the" |
61 |
+ ewarn "new version, you will need to remove the old module and load the new one. As" |
62 |
+ ewarn "root, you can accomplish this with the following commands:" |
63 |
+ ewarn |
64 |
+ ewarn " # rmmod wireguard" |
65 |
+ ewarn " # modprobe wireguard" |
66 |
+ ewarn |
67 |
+ ewarn "Do note that doing this will remove current WireGuard interfaces, so you may want" |
68 |
+ ewarn "to gracefully remove them yourself prior." |
69 |
+ ewarn |
70 |
+ fi |
71 |
+ fi |
72 |
} |
73 |
|
74 |
diff --git a/net-vpn/wireguard/wireguard-9999.ebuild b/net-vpn/wireguard/wireguard-9999.ebuild |
75 |
index ff291933ed8..d3b45bd83e1 100644 |
76 |
--- a/net-vpn/wireguard/wireguard-9999.ebuild |
77 |
+++ b/net-vpn/wireguard/wireguard-9999.ebuild |
78 |
@@ -76,13 +76,13 @@ pkg_postinst() { |
79 |
fi |
80 |
use module && linux-mod_pkg_postinst |
81 |
|
82 |
- ewarn |
83 |
- ewarn "This software is experimental and has not yet been released." |
84 |
- ewarn "As such, it may contain significant issues. Please do not file" |
85 |
- ewarn "bug reports with Gentoo, but rather direct them upstream to:" |
86 |
- ewarn |
87 |
- ewarn " team@×××××××××.io security@×××××××××.io" |
88 |
- ewarn |
89 |
+ einfo |
90 |
+ einfo "This software is experimental and has not yet been released." |
91 |
+ einfo "As such, it may contain significant issues. Please do not file" |
92 |
+ einfo "bug reports with Gentoo, but rather direct them upstream to:" |
93 |
+ einfo |
94 |
+ einfo " team@×××××××××.io security@×××××××××.io" |
95 |
+ einfo |
96 |
|
97 |
if use tools; then |
98 |
einfo |
99 |
@@ -106,4 +106,31 @@ pkg_postinst() { |
100 |
einfo "More info on getting started can be found at: https://www.wireguard.io/quickstart/" |
101 |
einfo |
102 |
fi |
103 |
+ if use module; then |
104 |
+ local old new |
105 |
+ if [[ $(uname -r) != "${KV_FULL}" ]]; then |
106 |
+ ewarn |
107 |
+ ewarn "You have just built WireGuard for kernel ${KV_FULL}, yet the currently running" |
108 |
+ ewarn "kernel is $(uname -r). If you intend to use this WireGuard module on the currently" |
109 |
+ ewarn "running machine, you will first need to reboot it into the kernel ${KV_FULL}, for" |
110 |
+ ewarn "which this module was built." |
111 |
+ ewarn |
112 |
+ elif [[ -f /sys/module/wireguard/version ]] && \ |
113 |
+ old="$(< /sys/module/wireguard/version)" && \ |
114 |
+ new="$(modinfo -F version "${ROOT}/lib/modules/${KV_FULL}/net/wireguard.ko" 2>/dev/null)" && \ |
115 |
+ [[ $old != "$new" ]]; then |
116 |
+ ewarn |
117 |
+ ewarn "You appear to have just upgraded WireGuard from version v$old to v$new." |
118 |
+ ewarn "However, the old version is still running on your system. In order to use the" |
119 |
+ ewarn "new version, you will need to remove the old module and load the new one. As" |
120 |
+ ewarn "root, you can accomplish this with the following commands:" |
121 |
+ ewarn |
122 |
+ ewarn " # rmmod wireguard" |
123 |
+ ewarn " # modprobe wireguard" |
124 |
+ ewarn |
125 |
+ ewarn "Do note that doing this will remove current WireGuard interfaces, so you may want" |
126 |
+ ewarn "to gracefully remove them yourself prior." |
127 |
+ ewarn |
128 |
+ fi |
129 |
+ fi |
130 |
} |