diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/image-oci-umoci.inc | 2 | ||||
-rw-r--r-- | classes/qemuboot-testimage-network.bbclass | 3 | ||||
-rw-r--r-- | classes/virt_networking.bbclass | 26 |
3 files changed, 30 insertions, 1 deletions
diff --git a/classes/image-oci-umoci.inc b/classes/image-oci-umoci.inc index c77750fb..9bd154fb 100644 --- a/classes/image-oci-umoci.inc +++ b/classes/image-oci-umoci.inc | |||
@@ -50,7 +50,7 @@ IMAGE_CMD:oci() { | |||
50 | 50 | ||
51 | bbdebug 1 "OCI: populating rootfs" | 51 | bbdebug 1 "OCI: populating rootfs" |
52 | bbdebug 1 "OCI: cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/" | 52 | bbdebug 1 "OCI: cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs/" |
53 | cp -r ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs | 53 | cp -r -a --no-preserve=ownership ${IMAGE_ROOTFS}/* $image_bundle_name/rootfs |
54 | 54 | ||
55 | bbdebug 1 "OCI: umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name" | 55 | bbdebug 1 "OCI: umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name" |
56 | umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name | 56 | umoci repack --image $image_name:${OCI_IMAGE_TAG} $image_bundle_name |
diff --git a/classes/qemuboot-testimage-network.bbclass b/classes/qemuboot-testimage-network.bbclass index 57e03551..ca65de6c 100644 --- a/classes/qemuboot-testimage-network.bbclass +++ b/classes/qemuboot-testimage-network.bbclass | |||
@@ -2,6 +2,9 @@ | |||
2 | # the Qemu MACHINES: it removes all external network interfaces | 2 | # the Qemu MACHINES: it removes all external network interfaces |
3 | # by default. However, eth0 is needed for testimage, so enable it here. | 3 | # by default. However, eth0 is needed for testimage, so enable it here. |
4 | 4 | ||
5 | # NOTE: systemd configuration can be found in the virt_networking | ||
6 | # bbclass and associated packages | ||
7 | |||
5 | # If QB_NETWORK_XEN_BRIDGE is set, configure bridging for the network. | 8 | # If QB_NETWORK_XEN_BRIDGE is set, configure bridging for the network. |
6 | QB_NETWORK_XEN_BRIDGE ??= "" | 9 | QB_NETWORK_XEN_BRIDGE ??= "" |
7 | 10 | ||
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 | # | ||
12 | PACKAGES:prepend = "${PN}-net-conf " | ||
13 | FILES:${PN}-net-conf = "${sysconfdir}/systemd/network/*" | ||
14 | |||
15 | do_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 | } | ||