[OE-core] [meta-oe][PATCH 1/3] connman: fix qemu config
Adrian Freihofer
adrian.freihofer at gmail.com
Sat Nov 14 21:35:06 UTC 2015
If a network interface is configured by kernel boot parameters
and the image is booted in qemu, connman takes the IP settings
from /proc/cmdline for this NIC.
The regex for parsing /proc/cmdline is invalid.
Signed-off-by: Adrian Freihofer <adrian.freihofer at gmail.com>
---
meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
index c46899e..4a61513 100644
--- a/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
+++ b/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
@@ -2,8 +2,10 @@
CONFIGF=/var/lib/connman/wired.config
-# Extract wired network config from /proc/cmdline
-NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([^ ]*\):\([^ ]*\):\([^ ]*\):\([^ ]*\).*$/\1\/\4\/\3/p'`
+# Extract wired network config (IPv4 = <client-ip>/<netmask>/<gw-ip>) from /proc/cmdline
+# "ip=<client-ip>:<server-ip>:<gw-ip>:<netmask>:<hostname>:<device>:<autoconf>:<dns0-ip>:<dns1-ip> "
+NET_CONF=`cat /proc/cmdline |sed -ne 's/^.*ip=\([0-9.]*\):\([0-9.]*\):\([0-9.]*\):\([0-9.]*\).*$/\1\/\4\/\3/p'`
+NET_CONF=${NET_CONF=%/}
# Check if eth0 is already set via kernel cmdline
if [ "x$NET_CONF" = "x" ]; then
--
2.4.3
More information about the Openembedded-core
mailing list