diff options
Diffstat (limited to 'classes/qemuboot-testimage-network.bbclass')
| -rw-r--r-- | classes/qemuboot-testimage-network.bbclass | 17 |
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. | ||
| 4 | enable_runqemu_network() { | ||
| 5 | : # no-op for non-qemu MACHINES | ||
| 6 | } | ||
| 7 | enable_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 | ||
| 12 | auto eth0 | ||
| 13 | iface eth0 inet dhcp | ||
| 14 | EOF | ||
| 15 | fi | ||
| 16 | } | ||
| 17 | ROOTFS_POSTPROCESS_COMMAND += 'enable_runqemu_network;' | ||
