Add virtual sllin support and LIN bridging to CAN for demos
[AGL/meta-agl-demo.git] / recipes-kernel / sllin / sllin.bb
1 DESCRIPTION = "slLIN driver module"
2 LICENSE = "GPLv2"
3 LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5 inherit module systemd
6
7 DEPENDS = "virtual/kernel"
8
9 SRC_URI = "git://github.com/trainman419/linux-lin.git;protocol=https"
10 SRCREV = "155d885e8ccc907a56f6c86c4b159fac27ef6fec"
11 S = "${WORKDIR}/git/sllin"
12
13 PV = "0.1+git${SRCPV}"
14
15 SRC_URI_append = " \
16         file://0001_update_makefile.patch;pnum=2 \
17         file://0002_fix_null_operation_check.patch;pnum=2 \
18         file://0003-Allow-recent-kernels-newer-4.11.x-to-build.patch;pnum=2 \
19         file://0001-Disable-sllin-driver-debug-log.patch;pnum=2 \
20         file://sllin-demo.service \
21         file://sllin-demo-virtual.service \
22         file://start_lin_demo.sh \
23         file://lin_config.conf \
24 "
25
26 KERNEL_MODULE_AUTOLOAD_append = " sllin"
27 KERNEL_MODULE_PROBECONF_append = " sllin"
28
29 SLLINBAUDRATE ??= "9600"
30 module_conf_sllin = "options sllin baudrate=${SLLINBAUDRATE}"
31
32 SYSTEMD_SERVICE_${PN} = "sllin-demo.service"
33 SYSTEMD_SERVICE_${PN}-virtual = "sllin-demo-virtual.service"
34
35 do_install_append () {
36         install -d 644 ${D}/${bindir}
37         install -m 755 ${WORKDIR}/start_lin_demo.sh ${D}/${bindir}/start_lin_demo.sh
38         install -d ${D}${systemd_system_unitdir}
39         install -m 0644 ${WORKDIR}/sllin-demo.service ${D}${systemd_system_unitdir}/
40         install -m 0644 ${WORKDIR}/sllin-demo-virtual.service ${D}${systemd_system_unitdir}/
41         install -d ${D}${sysconfdir}
42         install -m 0644 ${WORKDIR}/lin_config.conf ${D}${sysconfdir}/
43 }
44
45 PACKAGES =+ "${PN}-virtual"
46
47 FILES_${PN} += "${bindir}/start_lin_demo.sh ${sysconfdir}/lin_config.conf"
48
49 FILES_${PN}-virtual = "${systemd_system_unitdir}/sllin-demo-virtual.service"
50
51 RDEPENDS_${PN} += "lin-config"