meta-virtualization/classes/virt_networking.bbclass
Bruce Ashfield d2238e7287 xen: enable networking and guest image bundling
The xen host image reference needed signifant work to be
functional for launching and testing Xen domu guests.

Here we add additional tools to the host image, and allow
it to automatically bundle guests if the configuration
is enabled.

We also add systemd networking configuration to create
a xenbr0 which offeres connectivity to the entire reference
system.

See the recipes and the README for details on testing
and bundling.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2024-11-15 19:50:00 +00:00

27 lines
985 B
Plaintext

# Similarly to the cni_networking.bbclass this class should be
# inherted by recipes to produce a package that contains their
# desired networking configuration.
#
# Currently only systemd networking is supported, but this will
# be extended in the future
#
# By simply specifying the configuration / networking files,
# they will be package and then eventually installed to the
# correct target location.
#
PACKAGES:prepend = "${PN}-net-conf "
FILES:${PN}-net-conf = "${sysconfdir}/systemd/network/*"
do_install:append() {
if [ -z "${VIRT_NETWORKING_FILES}" ]; then
bbfatal "virt-networking was inherited, but no networking configuration was provided via VIRT_NETWORKING_FILES"
fi
# TODO: possibily make the systemd configuration conditional on the init manager
install -d "${D}/${sysconfdir}/systemd/network/"
for f in ${VIRT_NETWORKING_FILES}; do
conf_name="$(basename $f)"
install -D -m 0644 "$f" "${D}/${sysconfdir}/systemd/network/$conf_name"
done
}