From 4b25e519cde9a4d3f459fefb9ce692089324115d Mon Sep 17 00:00:00 2001 From: Oleksandr Kravchuk Date: Mon, 13 Aug 2018 04:00:55 +0200 Subject: [PATCH] peak-linux-driver: upgrade to 8.6.0 - Upgraded driver to v8.6.0 - Made it build with the currently used kernel v4.9 - Split it into two packages: kernel module and libs with headers --- .../peak-linux-driver-libs_8.6.0.bb | 34 ++++++++++++ .../peak-linux-driver-modules_8.6.0.bb | 53 +++++++++++++++++++ .../peak-can-driver/peak-linux-driver_7.9.bb | 36 ------------- 3 files changed, 87 insertions(+), 36 deletions(-) create mode 100644 recipes-kernel/peak-can-driver/peak-linux-driver-libs_8.6.0.bb create mode 100644 recipes-kernel/peak-can-driver/peak-linux-driver-modules_8.6.0.bb delete mode 100644 recipes-kernel/peak-can-driver/peak-linux-driver_7.9.bb diff --git a/recipes-kernel/peak-can-driver/peak-linux-driver-libs_8.6.0.bb b/recipes-kernel/peak-can-driver/peak-linux-driver-libs_8.6.0.bb new file mode 100644 index 0000000..813ae8c --- /dev/null +++ b/recipes-kernel/peak-can-driver/peak-linux-driver-libs_8.6.0.bb @@ -0,0 +1,34 @@ +# +# Copyright (C) 2015 Pelagicore AB +# Copyright (C) 2018 Luxoft Sweden AB +# +# SPDX-License-Identifier: MIT +# +DESCRIPTION = "PEAK CAN Bus Linux API" +HOMEPAGE = "http://www.peak-system.com/fileadmin/media/linux/index.htm" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${WORKDIR}/peak-linux-driver-${PV}/Documentation/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +SRC_URI = "http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-${PV}.tar.gz" +SRC_URI[md5sum] = "f62d94c721aa6a83316fcb4232631a64" +SRC_URI[sha256sum] = "62fa0ebde620a436816546bc1f82feb663a32f20db26e8889b7204b9686f5776" + +DEPENDS = "popt" + +RDEPENDS_${PN} = "bash" + +S = "${WORKDIR}/peak-linux-driver-${PV}/lib" + +INSANE_SKIP_${PN} = "ldflags" + +EXTRA_OEMAKE = "NET=NETDEV_SUPPORT" + +do_install() { + oe_runmake install DESTDIR=${D} +} + +FILES_${PN} += "\ + ${includedir} \ + ${libdir} \ +" diff --git a/recipes-kernel/peak-can-driver/peak-linux-driver-modules_8.6.0.bb b/recipes-kernel/peak-can-driver/peak-linux-driver-modules_8.6.0.bb new file mode 100644 index 0000000..3886923 --- /dev/null +++ b/recipes-kernel/peak-can-driver/peak-linux-driver-modules_8.6.0.bb @@ -0,0 +1,53 @@ +# +# Copyright (C) 2015 Pelagicore AB +# Copyright (C) 2018 Luxoft Sweden AB +# +# SPDX-License-Identifier: MIT +# +DESCRIPTION = "PEAK CAN Bus Driver for Linux" +HOMEPAGE = "http://www.peak-system.com/fileadmin/media/linux/index.htm" + +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://${WORKDIR}/peak-linux-driver-${PV}/Documentation/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" + +inherit module + +SRC_URI = "http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-${PV}.tar.gz" +SRC_URI[md5sum] = "f62d94c721aa6a83316fcb4232631a64" +SRC_URI[sha256sum] = "62fa0ebde620a436816546bc1f82feb663a32f20db26e8889b7204b9686f5776" + +DEPENDS = "virtual/kernel" + +S = "${WORKDIR}/peak-linux-driver-${PV}/driver" + +EXTRA_OEMAKE = "NET=NETDEV_SUPPORT \ + KERNEL_LOCATION=${STAGING_KERNEL_BUILDDIR} \ +" + +do_install() { + # create directories + install -m 0755 -d ${D}/${base_bindir} + install -m 0755 -d ${D}/${sysconfdir}/udev/rules.d/ + install -m 0755 -d ${D}/${sysconfdir}/modprobe.d/ + install -m 0755 -d ${D}/lib/modules/${KERNEL_VERSION}/kernel/misc/ + + # install kernel module + install -m 0644 ${S}/pcan.ko ${D}/lib/modules/${KERNEL_VERSION}/kernel/misc/ + install -m 0644 ${S}/udev/blacklist-peak.conf ${D}/${sysconfdir}/modprobe.d/pcan.conf + + # install tools and scripts + install -m 0755 ${S}/lspcan ${D}/${base_bindir} + install -m 0744 ${S}/pcan_make_devices ${D}/${base_bindir} + install -m 0744 ${S}/udev/pcan_usb_minor_check.bash ${D}/${base_bindir} + + # install udev rules + install -m 0644 ${S}/udev/45-pcan.rules ${D}/${sysconfdir}/udev/rules.d/ +} + +FILES_${PN} += "\ + ${base_bindir} \ + ${sysconfdir}/udev/rules.d/ \ + /lib/modules/${KERNEL_VERSION}/kernel/misc/ \ +" + +KERNEL_MODULE_AUTOLOAD_append_corei7-64-intel-common = " pcan" diff --git a/recipes-kernel/peak-can-driver/peak-linux-driver_7.9.bb b/recipes-kernel/peak-can-driver/peak-linux-driver_7.9.bb deleted file mode 100644 index d5011f3..0000000 --- a/recipes-kernel/peak-can-driver/peak-linux-driver_7.9.bb +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright (C) 2015 Pelagicore AB -# -# SPDX-License-Identifier: MIT -# -DESCRIPTION = "PEAK CAN Bus Driver" -HOMEPAGE = "http://www.peak-system.com/fileadmin/media/linux/index.htm" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://Documentation/COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" -PR = "r0" -SRC_URI = "http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-${PV}.tar.gz" -SRC_URI[md5sum] = "a3e9e355c7055d5a07ce5d3ebca99132" -SRC_URI[sha256sum] = "dfe57d390918eaf949c7116d0639537e1f08704d8cb4ef55f63f8e8131e7c2f0" - -inherit module - -EXTRA_OEMAKE = "NET=NETDEV_SUPPORT KERNEL_LOCATION=${STAGING_KERNEL_DIR}" - -do_install() { - oe_runmake install DESTDIR=${D} -} - -PACKAGES = "\ - ${PN} \ - ${PN}-tools \ -" - -FILES_${PN} += "\ - ${libdir} \ - ${libdir}/*${SOLIBS} \ -" - -FILES_${PN}-tools += "\ - ${bindir}/pcan_make_devices \ -" -