summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/qemuboot-testimage-network.bbclass17
1 files changed, 17 insertions, 0 deletions
diff --git a/classes/qemuboot-testimage-network.bbclass b/classes/qemuboot-testimage-network.bbclass
new file mode 100644
index 00000000..18af1eea
--- /dev/null
+++ b/classes/qemuboot-testimage-network.bbclass
@@ -0,0 +1,17 @@
1# The recipe for init-ifupdown in core has a special-case for all
2# the Qemu MACHINES: it removes all external network interfaces
3# by default. However, eth0 is needed for testimage, so enable it here.
4enable_runqemu_network() {
5 : # no-op for non-qemu MACHINES
6}
7enable_runqemu_network:qemuall() {
8 if ! grep -q eth0 "${IMAGE_ROOTFS}${sysconfdir}/network/interfaces" ; then
9 cat <<EOF >>${IMAGE_ROOTFS}${sysconfdir}/network/interfaces
10
11# Network for testimage
12auto eth0
13iface eth0 inet dhcp
14EOF
15 fi
16}
17ROOTFS_POSTPROCESS_COMMAND += 'enable_runqemu_network;'