summaryrefslogtreecommitdiffstats
path: root/classes/virt_networking.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'classes/virt_networking.bbclass')
-rw-r--r--classes/virt_networking.bbclass26
1 files changed, 26 insertions, 0 deletions
diff --git a/classes/virt_networking.bbclass b/classes/virt_networking.bbclass
new file mode 100644
index 00000000..e92e1de5
--- /dev/null
+++ b/classes/virt_networking.bbclass
@@ -0,0 +1,26 @@
1# Similarly to the cni_networking.bbclass this class should be
2# inherted by recipes to produce a package that contains their
3# desired networking configuration.
4#
5# Currently only systemd networking is supported, but this will
6# be extended in the future
7#
8# By simply specifying the configuration / networking files,
9# they will be package and then eventually installed to the
10# correct target location.
11#
12PACKAGES:prepend = "${PN}-net-conf "
13FILES:${PN}-net-conf = "${sysconfdir}/systemd/network/*"
14
15do_install:append() {
16 if [ -z "${VIRT_NETWORKING_FILES}" ]; then
17 bbfatal "virt-networking was inherited, but no networking configuration was provided via VIRT_NETWORKING_FILES"
18 fi
19
20 # TODO: possibily make the systemd configuration conditional on the init manager
21 install -d "${D}/${sysconfdir}/systemd/network/"
22 for f in ${VIRT_NETWORKING_FILES}; do
23 conf_name="$(basename $f)"
24 install -D -m 0644 "$f" "${D}/${sysconfdir}/systemd/network/$conf_name"
25 done
26}