1 |
commit: 5773ba3aa4b5c5b9d96ab144292c0fc39b456038 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 2 13:30:00 2019 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Oct 2 14:43:05 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=5773ba3a |
7 |
|
8 |
initrd.scripts: start_network(): Don't try to configure network when "ip" argument contains comma or colon |
9 |
|
10 |
We are sharing "ip" kernel command-line argument with kernel's IP PNP feature. |
11 |
Because we don't support the same syntax/features it's safe to assume that user |
12 |
wants to use kernel's IP PNP feature when argument contains a comma or colon. |
13 |
|
14 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
15 |
|
16 |
defaults/initrd.scripts | 17 +++++++++++++++++ |
17 |
1 file changed, 17 insertions(+) |
18 |
|
19 |
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts |
20 |
index 2969f44..071ba32 100644 |
21 |
--- a/defaults/initrd.scripts |
22 |
+++ b/defaults/initrd.scripts |
23 |
@@ -2019,6 +2019,23 @@ start_network() { |
24 |
bad_msg "Failed to start udhcpc for interface ${GK_NET_IFACE}!" |
25 |
return 1 |
26 |
fi |
27 |
+ elif echo "${IP}" | grep -qE ':|,' |
28 |
+ then |
29 |
+ if is_interface_up |
30 |
+ then |
31 |
+ # CONFIG_IP_PNP probably caused kernel to bring up |
32 |
+ # network for us. Due to presence of ":" or "," |
33 |
+ # we can assume an advanced network configuration |
34 |
+ # which we cannot reproduce... |
35 |
+ warn_msg "Interface ${GK_NET_IFACE} is already up." |
36 |
+ warn_msg "Skipping network setup; Will use existing network configuration ..." |
37 |
+ run touch "${GK_NET_LOCKFILE}" |
38 |
+ return 0 |
39 |
+ fi |
40 |
+ |
41 |
+ warn_msg "Found advanced network configuration (check ip= kernel command-line argument)!" |
42 |
+ warn_msg "Assuming user want to use kernel's IP PNP; Will not try to start network ..." |
43 |
+ return 1 |
44 |
else |
45 |
if is_interface_up |
46 |
then |