diff options
Diffstat (limited to '_to_remove/recipes-apis/agl-service-can-low-level')
7 files changed, 102 insertions, 0 deletions
diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb b/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb new file mode 100644 index 000000000..6ac2f4f29 --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bb @@ -0,0 +1,23 @@ +SUMMARY = "Low level CAN service" +DESCRIPTION = "AGL Service application for read and decode CAN messages" +HOMEPAGE = "https://gerrit.automotivelinux.org/gerrit/#/admin/projects/apps/low-level-can-service" +SECTION = "apps" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +SRC_URI = "git://gerrit.automotivelinux.org/gerrit/apps/agl-service-can-low-level;protocol=https;branch=${AGL_BRANCH}" +SRCREV = "${AGL_APP_REVISION}" + +PV = "${AGLVERSION}" +S = "${WORKDIR}/git" + +DEPENDS = "libafb-helpers libappcontroller" + +inherit cmake aglwgt pkgconfig ptest + +# For now, just enable J1939 on the qemu platforms where we know the +# linux-yocto kernel is new enough (>= 5.4) and has the support enabled. +AGLWGT_CMAKE_CONFIGURE_ARGS:append:qemuall = " -DWITH_FEATURE_J1939=ON" + +RDEPENDS:${PN} = "virtual/low-can-dev-mapping" diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bbappend b/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bbappend new file mode 100644 index 000000000..bc2d0d357 --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/agl-service-can-low-level_git.bbappend @@ -0,0 +1,10 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/files:" + +SRC_URI:append = " file://can-dev-mapping-helper.conf" + +do_install:append() { + install -D -m 0644 ${WORKDIR}/can-dev-mapping-helper.conf \ + ${D}${sysconfdir}/systemd/system/afm-service-agl-service-can-low-level-.service.d/can-dev-mapping-helper.conf +} + +RDEPENDS:${PN}:append = " can-dev-mapping-helper" diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/can-dev-mapping-helper_1.0.bb b/_to_remove/recipes-apis/agl-service-can-low-level/can-dev-mapping-helper_1.0.bb new file mode 100644 index 000000000..cc50bfe2a --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/can-dev-mapping-helper_1.0.bb @@ -0,0 +1,21 @@ +SUMMARY = "Systemd unit for agl-service-can-low-level CAN device helper" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" + +inherit systemd allarch + +SRC_URI = "file://can-dev-mapping-helper.service \ + file://can-dev-mapping-helper.sh \ +" + +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -D -m 0644 ${WORKDIR}/${BPN}.service ${D}${systemd_system_unitdir}/${BPN}.service + install -D -m 0755 ${WORKDIR}/${BPN}.sh ${D}${sbindir}/${BPN}.sh +} + +FILES:${PN} += "${systemd_system_unitdir}" + +RDEPENDS:${PN} += "bash" diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.conf b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.conf new file mode 100644 index 000000000..c89cc4d87 --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.conf @@ -0,0 +1,3 @@ +[Unit] +Wants=can-dev-mapping-helper.service +After=can-dev-mapping-helper.service diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.service b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.service new file mode 100644 index 000000000..0436716cb --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.service @@ -0,0 +1,6 @@ +[Unit] +Description=CAN interface helper + +[Service] +ExecStart=/usr/sbin/can-dev-mapping-helper.sh +Type=oneshot diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.sh b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.sh new file mode 100644 index 000000000..c81014f3e --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/files/can-dev-mapping-helper.sh @@ -0,0 +1,36 @@ +#!/bin/bash + +# +# Script to bring up CAN interfaces configured in /etc/dev-mapping.conf +# as vcan interfaces if no physical interface is present. +# + +vcan_up() { + if [ -n "$1" ]; then + echo "Bringing up $1 as virtual CAN device" + ip link add dev $1 type vcan + ip link set up $1 + fi +} + +if [ ! -f /etc/dev-mapping.conf ]; then + exit 0 +fi + +hs=$(grep ^hs= /etc/dev-mapping.conf |cut -d= -f2 |tr -d '"') +ls=$(grep ^ls= /etc/dev-mapping.conf |cut -d= -f2 |tr -d '"') + +if [ -n "$hs" ]; then + echo "Checking $hs" + if ! ifconfig $hs >/dev/null 2>&1; then + vcan_up $hs + fi +fi +if [ -n "$ls" -a "$ls" != "$hs" ]; then + echo "Checking $ls" + if ! ifconfig $ls >/dev/null 2>&1; then + vcan_up $ls + fi +fi + +exit 0 diff --git a/_to_remove/recipes-apis/agl-service-can-low-level/files/run-ptest b/_to_remove/recipes-apis/agl-service-can-low-level/files/run-ptest new file mode 100644 index 000000000..cc9c41365 --- /dev/null +++ b/_to_remove/recipes-apis/agl-service-can-low-level/files/run-ptest @@ -0,0 +1,3 @@ +#!/bin/sh + +afm-test /usr/AGL/apps/testwgt/low-can-service-test.wgt |