summaryrefslogtreecommitdiffstats
path: root/recipes-test/demo-network-config/network-config.inc
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-test/demo-network-config/network-config.inc')
-rw-r--r--recipes-test/demo-network-config/network-config.inc19
1 files changed, 19 insertions, 0 deletions
diff --git a/recipes-test/demo-network-config/network-config.inc b/recipes-test/demo-network-config/network-config.inc
new file mode 100644
index 0000000..c713589
--- /dev/null
+++ b/recipes-test/demo-network-config/network-config.inc
@@ -0,0 +1,19 @@
1CONF_TYPE ?= "${@ 'multihomed' if d.getVar('MACHINE') == 'raspberrypi3' and d.getVar('IMAGE_TYPE') == 'primary' else 'static'}"
2
3SRC_URI_append = "\
4 file://26-${CONF_TYPE}-client.network \
5 "
6
7SECONDARY_INTERFACE ?= "${@ 'eth0' if d.getVar('MACHINE') == 'raspberrypi3' else 'enp0s5'}"
8
9do_install_append() {
10 bbnote "Network configuration type to be applied: ${CONF_TYPE}"
11 install -d ${D}/usr/lib/systemd/network
12 install -m 0644 ${WORKDIR}/26-${CONF_TYPE}-client.network ${D}/usr/lib/systemd/network/
13 sed -i -e 's|@ADDR@|${IP_ADDR}|g' \
14 -e 's|@IFNAME@|${SECONDARY_INTERFACE}|g' \
15 ${D}/usr/lib/systemd/network/26-${CONF_TYPE}-client.network
16
17}
18
19# vim:set ts=4 sw=4 sts=4 expandtab: