meta-agl-core: systemd: Disable `BitRate` setting for `can*` network for VIRTIO. 04/28104/5
authorVasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Wed, 2 Nov 2022 08:42:45 +0000 (09:42 +0100)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Wed, 23 Nov 2022 14:04:52 +0000 (14:04 +0000)
VIRTIO CAN [1] does not support bitrate configuration, it assumes
bitrate configuration is done on backend.

Fixes systemd-networkd failure:

    can0: Failed to set CAN interface configurations: Operation not supported

File `canbus-virtio-can.network` is copied from `canbus-can.network`
with `BitRate=` setting removed.

v2: rework patchset to use own systemd-conf-canbus package to
    avoid changes in main systemd package.

[1]: https://lists.oasis-open.org/archives/virtio-dev/202208/msg00159.html

Bug-AGL: SPEC-4597

Change-Id: Idb132203501bb99103e76098eea3bb6394b645da
Signed-off-by: Vasyl Vavrychuk <vasyl.vavrychuk@opensynergy.com>
Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/28104
Tested-by: Jenkins Job builder account
ci-image-build: Jenkins Job builder account
ci-image-boot-test: Jenkins Job builder account
Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-can.network [moved from meta-agl-core/recipes-core/systemd/systemd/canbus-can.network with 100% similarity]
meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network [new file with mode: 0644]
meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb [new file with mode: 0644]
meta-agl-core/recipes-core/systemd/systemd_aglcore.inc
meta-agl-core/recipes-platform/packagegroups/packagegroup-agl-core-connectivity.bb

diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus/canbus-virtio.network
new file mode 100644 (file)
index 0000000..cc33d86
--- /dev/null
@@ -0,0 +1,5 @@
+[Match]
+Name=can*
+
+[CAN]
+RestartSec=0.1
diff --git a/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb b/meta-agl-core/recipes-core/systemd/systemd-conf-canbus_1.0.bb
new file mode 100644 (file)
index 0000000..33b9862
--- /dev/null
@@ -0,0 +1,27 @@
+SUMMARY = "Systemd canbus configuration"
+DESCRIPTION = "Systemd may require slightly different configuration for \
+different machines. This injects configuration for the CAN bus."
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+PE = "1"
+
+SRC_URI = "\
+    file://canbus-can.network \
+    file://canbus-virtio.network \
+"
+
+CANBUS_NETWORK_CONFIG ??= "canbus-can.network"
+CANBUS_NETWORK_CONFIG:virtio-all ?= "canbus-virtio.network"
+
+do_install() {
+    # Install canbus network script
+    install -d ${D}${nonarch_base_libdir}/systemd/network/
+    install -m 0644 ${WORKDIR}/${CANBUS_NETWORK_CONFIG} ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.network
+}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+FILES:${PN} = " \
+    ${nonarch_base_libdir}/systemd/network/*.network \
+"
index 6dd6698..b74a60f 100644 (file)
@@ -2,7 +2,6 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/systemd:"
 
 SRC_URI += "\
     file://e2fsck.conf \
-    file://canbus-can.network \
     ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','file://wired.network','',d)} \
 "
 
@@ -15,9 +14,6 @@ do_install:append() {
     # Install /etc/e2fsck.conf to avoid boot stuck by wrong clock time
     install -m 644 -p -D ${WORKDIR}/e2fsck.conf ${D}${sysconfdir}/e2fsck.conf
 
-    # Install canbus network script
-    install -m 0644 ${WORKDIR}/canbus-can.network ${D}${nonarch_base_libdir}/systemd/network/60-canbus-can.network
-
     if ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','systemd','true','false',d)}; then
        # Install DHCP configuration for Ethernet adapters
        install -m 644 ${WORKDIR}/wired.network ${D}${sysconfdir}/systemd/network
index a794d1a..7f3c951 100644 (file)
@@ -15,4 +15,5 @@ RDEPENDS:${PN} += "\
     ${@bb.utils.contains('VIRTUAL-RUNTIME_net_manager','connman','connman connman-client connman-conf \
         connman-tests connman-tools connman-ncurses' ,'',d)} \
     ${@bb.utils.contains('AGL_FEATURES', 'agl-devel', '${PKGGROUP_ZEROCONF}', '', d)} \
+    systemd-conf-canbus \
     "