From 9efdd28246813b0342abe72621c9cc676a12f99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Iwanicki?= Date: Fri, 27 Feb 2026 10:08:32 +0100 Subject: [PATCH] recipes-core: systemd: increase USB network metric MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit USB network interface will have lower priorty than non-USB one. Fixes: https://github.com/Dasharo/dasharo-issues/issues/1289 Signed-off-by: MichaƂ Iwanicki --- .../recipes-core/systemd/files/usb.network | 15 +++++++++++++++ .../recipes-core/systemd/systemd-conf_%.bbappend | 9 +++++++++ 2 files changed, 24 insertions(+) create mode 100644 meta-dts-distro/recipes-core/systemd/files/usb.network create mode 100644 meta-dts-distro/recipes-core/systemd/systemd-conf_%.bbappend diff --git a/meta-dts-distro/recipes-core/systemd/files/usb.network b/meta-dts-distro/recipes-core/systemd/files/usb.network new file mode 100644 index 0000000..0d7a120 --- /dev/null +++ b/meta-dts-distro/recipes-core/systemd/files/usb.network @@ -0,0 +1,15 @@ +# modified 80-wired.network +[Match] +Type=ether +Name=!veth* +Driver=rndis_host +KernelCommandLine=!nfsroot +KernelCommandLine=!ip + +[Network] +DHCP=yes + +[DHCP] +UseMTU=yes +RouteMetric=30 +ClientIdentifier=mac diff --git a/meta-dts-distro/recipes-core/systemd/systemd-conf_%.bbappend b/meta-dts-distro/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 0000000..d8301e9 --- /dev/null +++ b/meta-dts-distro/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,9 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append = " file://usb.network" + +do_install:append() { + install -D -m0644 ${WORKDIR}/usb.network ${D}${sysconfdir}/systemd/network/50-usb.network +} + +FILES:${PN}:append = " ${sysconfdir}/systemd/network/50-usb.network"