From 736893d0d9810a133e41ddcbd2fe7ef608d2841b Mon Sep 17 00:00:00 2001 From: Jan-Simon Möller Date: Wed, 7 Nov 2018 08:08:43 +0100 Subject: Finalize and automate sllin setup for LIN on demo unit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provide the systemd unit, the init script, the module options and the autoload command. Change-Id: I8dfe59338f377ca8ac1b94fe568dff9e2b36bf97 Signed-off-by: Jan-Simon Möller --- recipes-kernel/sllin/files/sllin-demo.service | 13 ++++++ recipes-kernel/sllin/files/start_lin_demo.sh | 51 ++++++++++++++++++++++ recipes-kernel/sllin/sllin.bb | 17 +++++++- .../packagegroup-agl-demo-platform.bb | 2 +- 4 files changed, 81 insertions(+), 2 deletions(-) create mode 100644 recipes-kernel/sllin/files/sllin-demo.service create mode 100755 recipes-kernel/sllin/files/start_lin_demo.sh diff --git a/recipes-kernel/sllin/files/sllin-demo.service b/recipes-kernel/sllin/files/sllin-demo.service new file mode 100644 index 000000000..c1bc94982 --- /dev/null +++ b/recipes-kernel/sllin/files/sllin-demo.service @@ -0,0 +1,13 @@ +[Unit] +Description = LIN DEMO startup +After=afm-system-daemon.service + +[Service] +Type=forking +PIDFile=/var/run/lin_ldattach +ExecStart=/usr/bin/start_lin_demo.sh +RemainAfterExit=yes + + +[Install] +WantedBy=default.target diff --git a/recipes-kernel/sllin/files/start_lin_demo.sh b/recipes-kernel/sllin/files/start_lin_demo.sh new file mode 100755 index 000000000..741189fb7 --- /dev/null +++ b/recipes-kernel/sllin/files/start_lin_demo.sh @@ -0,0 +1,51 @@ +#!/bin/sh + +sleep 1 +ldattach 25 /dev/ttySC3 +pidof ldattach > /var/run/lin_ldattach +sleep 1 +ip link set sllin0 up +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 02A# +usleep 100000 +cansend sllin0 02B# +usleep 100000 +cansend sllin0 032#F0F8FFFFFFFFFFFF +usleep 100000 +cansend sllin0 032#F0F8FFFFFFFFFFFF +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 030# +usleep 100000 +cansend sllin0 02D# +usleep 100000 +cansend sllin0 02C# +usleep 100000 +cansend sllin0 02D# +usleep 100000 +cansend sllin0 02C# +usleep 100000 + diff --git a/recipes-kernel/sllin/sllin.bb b/recipes-kernel/sllin/sllin.bb index eecd43947..f3176a8e1 100644 --- a/recipes-kernel/sllin/sllin.bb +++ b/recipes-kernel/sllin/sllin.bb @@ -2,7 +2,7 @@ DESCRIPTION = "slLIN driver module" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" -inherit module +inherit module systemd DEPENDS = "virtual/kernel" @@ -16,6 +16,21 @@ SRC_URI_append = " \ file://0001_update_makefile.patch;pnum=2 \ file://0002_fix_null_operation_check.patch;pnum=2 \ file://0003-Allow-recent-kernels-newer-4.11.x-to-build.patch;pnum=2 \ + file://sllin-demo.service \ + file://start_lin_demo.sh \ " +KERNEL_MODULE_AUTOLOAD_append = " sllin" +KERNEL_MODULE_PROBECONF_append = " sllin" +SLLINBAUDRATE ??= "9600" +module_conf_sllin = "options sllin baudrate=${SLLINBAUDRATE}" + +SYSTEMD_SERVICE_${PN} = "sllin-demo.service" + +do_install_append () { + install -d 644 ${D}/${bindir} + install -m 755 ${WORKDIR}/start_lin_demo.sh ${D}/${bindir}/start_lin_demo.sh +} + +FILES_${PN}_append = " ${bindir}/start_lin_demo.sh" diff --git a/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb b/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb index d79a36b96..f3191ca18 100755 --- a/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb +++ b/recipes-platform/packagegroups/packagegroup-agl-demo-platform.bb @@ -22,8 +22,8 @@ RDEPENDS_${PN} += "\ MOST_DRIVERS = " \ most \ - sllin \ " +MOST_DRIVERS_append_m3ulcb = " sllin" # HVAC dependencies depend on drivers above MOST_HVAC = " " -- cgit 1.2.3-korg