summaryrefslogtreecommitdiffstats
path: root/external/poky/meta/recipes-connectivity/connman/connman-conf
diff options
context:
space:
mode:
authorToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
committerToshikazuOhiwa <toshikazu_ohiwa@mail.toyota.co.jp>2020-03-30 09:24:26 +0900
commit5b80bfd7bffd4c20d80b7c70a7130529e9a755dd (patch)
treeb4bb18dcd1487dbf1ea8127e5671b7bb2eded033 /external/poky/meta/recipes-connectivity/connman/connman-conf
parent706ad73eb02caf8532deaf5d38995bd258725cb8 (diff)
agl-basesystem
Diffstat (limited to 'external/poky/meta/recipes-connectivity/connman/connman-conf')
-rw-r--r--external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service10
-rw-r--r--external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup16
-rw-r--r--external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config9
3 files changed, 35 insertions, 0 deletions
diff --git a/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
new file mode 100644
index 00000000..48adfc08
--- /dev/null
+++ b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-connection.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Setup a wired interface
+Before=connman.service
+
+[Service]
+Type=oneshot
+ExecStart=@SCRIPTDIR@/wired-setup
+
+[Install]
+WantedBy=network.target
diff --git a/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
new file mode 100644
index 00000000..c46899ef
--- /dev/null
+++ b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired-setup
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+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'`
+
+# Check if eth0 is already set via kernel cmdline
+if [ "x$NET_CONF" = "x" ]; then
+ # Wired interface is not configured via kernel cmdline
+ # Remove connman config file template
+ rm -f ${CONFIGF}
+else
+ # Setup a connman config accordingly
+ sed -i -e "s|^IPv4 =.*|IPv4 = ${NET_CONF}|" ${CONFIGF}
+fi
diff --git a/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
new file mode 100644
index 00000000..42998ce8
--- /dev/null
+++ b/external/poky/meta/recipes-connectivity/connman/connman-conf/qemuall/wired.config
@@ -0,0 +1,9 @@
+[global]
+Name = Wired
+Description = Wired network configuration
+
+[service_ethernet]
+Type = ethernet
+IPv4 =
+MAC = 52:54:00:12:34:56
+Nameservers = 8.8.8.8