aboutsummaryrefslogtreecommitdiffstats
path: root/classes/qemuboot-testimage-network.bbclass
blob: 18af1eea400da56818463eba569d1b64209d21ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# The recipe for init-ifupdown in core has a special-case for all
# the Qemu MACHINES: it removes all external network interfaces
# by default. However, eth0 is needed for testimage, so enable it here.
enable_runqemu_network() {
    : # no-op for non-qemu MACHINES
}
enable_runqemu_network:qemuall() {
    if ! grep -q eth0 "${IMAGE_ROOTFS}${sysconfdir}/network/interfaces" ; then
        cat <<EOF >>${IMAGE_ROOTFS}${sysconfdir}/network/interfaces

# Network for testimage
auto eth0
iface eth0 inet dhcp
EOF
    fi
}
ROOTFS_POSTPROCESS_COMMAND += 'enable_runqemu_network;'