network-manager-conf: Don't always use eth0 as default

It was already the case for HW18: eth2 was the default.
Now with HW25, we can't rely either on eth0 name since it is assigned by
default to the wrong port.

We are therefor using lan0 for HW25 and make the nm-conf recipe more
generic.

BugzID: 69468
This commit is contained in:
Alexandre Bard 2020-12-14 13:59:43 +01:00
parent 5bec9ecf1f
commit 8a4c0869d3
3 changed files with 11 additions and 5 deletions

View File

@ -10,6 +10,7 @@ PREFERRED_PROVIDER_virtual/bootloader = "u-boot-am335x-hw25"
KERNEL_DEVICETREE = "am335x-hw25.dtb "
SERIAL_CONSOLES = "115200;ttyS0"
DEFAULT_ETH = "lan0"
MACHINE_FEATURES_remove = " \
bluetooth \

View File

@ -17,6 +17,8 @@ module_conf_ath10k_pci = "options ath10k_pci irq_mode=1"
PREFERRED_PROVIDER_virtual/bootloader = "u-boot-armada-385-nrhw18-v2"
IMAGE_BOOT_FILES = "u-boot-armada-385-nrhw18-v2.kwb"
DEFAULT_ETH = "eth2"
MACHINE_FEATURES += " \
fpga \
atsha \

View File

@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Proprietary;md
RDEPENDS_${PN} = "networkmanager"
PACKAGECONFIG ?= ""
DEFAULT_ETH ??= "eth0"
PACKAGECONFIG[unmanaged-devices] = ""
PACKAGECONFIG[ethernet-dhcp] = ""
@ -36,6 +37,13 @@ do_install () {
install -m 0600 ${WORKDIR}/eth0-static ${D}${sysconfdir}/NetworkManager/system-connections/eth0.nmconnection
fi
# Handle HWs with different default interface
if [ "${DEFAULT_ETH}" != "eth0" ]; then
sed -i 's/eth0/${DEFAULT_ETH}/g' ${D}${sysconfdir}/NetworkManager/system-connections/*
mv ${D}${sysconfdir}/NetworkManager/system-connections/eth0.nmconnection \
${D}${sysconfdir}/NetworkManager/system-connections/${DEFAULT_ETH}.nmconnection
fi
if ${@bb.utils.contains('PACKAGECONFIG','unmanaged-devices','true','false',d)}; then
install -d ${D}${sysconfdir}/NetworkManager/conf.d
@ -52,11 +60,6 @@ do_install_append_am335x-nrhw20() {
fi
}
do_install_append_armada-385-nrhw18() {
sed -i 's/eth0/eth2/g' ${D}${sysconfdir}/NetworkManager/system-connections/*
mv ${D}${sysconfdir}/NetworkManager/system-connections/eth0.nmconnection \
${D}${sysconfdir}/NetworkManager/system-connections/eth2.nmconnection
}
FILES_${PN} = " \
${sysconfdir}/NetworkManager/NetworkManager.conf \