diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-05-26 10:38:07 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-07-06 13:59:56 -0400 |
commit | ca7d98904253c7404c3e6384ebb53d922a3c538a (patch) | |
tree | d82bc0b67481bef7d64c1b15bfc7636bb58b0955 /recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch | |
parent | 785dae680241b989b92725a57255b1df77486d4a (diff) |
kuksa-dbc-feeder: add recipe and dependencies
Add a kuksa-dbc-feeder recipe to build the sample CAN feeder for the
KUKSA.val Vehicle Information Service (VIS) server and add it to the
agl-demo-platform image by adding it to packagegroup-agl-ivi-services.
Local patches are applied to enable building with OpenEmbedded, make
installation into standard Linux FHS locations feasible, and improve
usability on target with respect to logging and error handling.
These will be discussed with upstream to hopefully get them
integrated.
Additional changes:
- Add a recipe for the required kuksa-viss-client Python module
included with the KUKSA.val source tree. The module is also
available via pypi.org, but keeping all the pieces in lockstep for
now seems better, so it is built out of a clone of the kuksa.val
repo using the same SRCREV as the server and kuksa-dbc-feeder.
- Add new recipes for required Python modules:
python3-argparse-addons, python3-can-j1939,
python3-py-expression-eval, python3-setuptools-git-versioning
These will be upstreamed to meta-python as time permits.
- Add bbappend for python3-cantools to add a missing runtime
dependencies discovered during testing. This will be addressed
upstream in meta-python as time permits.
- Add minimal DBC file and mapping configuration. At present the
agl-vcar.dbc file only contains the minimum message definitions
known to be required for the AGL demo platform, namely vehicle
and engine speeds and the steering wheel events.
- Add can-dev-helper recipe to install a systemd unit and script to
ensure a CAN interface is available for testing. This is a tweaked
version of what was previously used with agl-service-can-low-level.
Bug-AGL: SPEC-4405
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: Ic48ea71761fe3767ca3c1711c60b47e0d329d9e7
Diffstat (limited to 'recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch')
-rw-r--r-- | recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch new file mode 100644 index 000000000..1e84eeb7e --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch @@ -0,0 +1,164 @@ +From 603b5a584bd2b348befc9bab8f1ea0a7974f9d77 Mon Sep 17 00:00:00 2001 +From: Scott Murray <scott.murray@konsulko.com> +Date: Wed, 11 May 2022 15:31:25 -0400 +Subject: [PATCH] dbc2val: add installation mechanism + +Add setup.py and setup.cfg to allow installing the dbc2val module +and dbcfeeder.py in a way suitable for packaging. Some of the +imports in the scripts have been tweaked to enable running against +an installed copy of dbc2val. + +Signed-off-by: Scott Murray <scott.murray@konsulko.com> + +--- + kuksa_feeders/dbc2val/__init__.py | 0 + kuksa_feeders/dbc2val/dbc2vssmapper.py | 12 ++++----- + kuksa_feeders/dbc2val/dbcfeeder.py | 6 ++--- + kuksa_feeders/setup.cfg | 31 ++++++++++++++++++++++ + kuksa_feeders/setup.py | 36 ++++++++++++++++++++++++++ + 5 files changed, 75 insertions(+), 10 deletions(-) + create mode 100644 kuksa_feeders/dbc2val/__init__.py + create mode 100644 kuksa_feeders/setup.cfg + create mode 100644 kuksa_feeders/setup.py + +diff --git a/kuksa_feeders/dbc2val/__init__.py b/kuksa_feeders/dbc2val/__init__.py +new file mode 100644 +index 0000000..e69de29 +diff --git a/kuksa_feeders/dbc2val/dbc2vssmapper.py b/kuksa_feeders/dbc2val/dbc2vssmapper.py +index a43d1bd..1718154 100644 +--- a/kuksa_feeders/dbc2val/dbc2vssmapper.py ++++ b/kuksa_feeders/dbc2val/dbc2vssmapper.py +@@ -11,8 +11,8 @@ + ######################################################################## + + import yaml +-import transforms.mapping +-import transforms.math ++from dbc2val.transforms import mapping ++from dbc2val.transforms import math + + + class mapper: +@@ -22,9 +22,9 @@ class mapper: + self.mapping = yaml.full_load(file) + + self.transforms={} +- self.transforms['fullmapping']=transforms.mapping.mapping(discard_non_matching_items=True) +- self.transforms['partialmapping']=transforms.mapping.mapping(discard_non_matching_items=False) +- self.transforms['math']=transforms.math.math() ++ self.transforms['fullmapping']=mapping.mapping(discard_non_matching_items=True) ++ self.transforms['partialmapping']=mapping.mapping(discard_non_matching_items=False) ++ self.transforms['math']=math.math() + + + +@@ -62,4 +62,4 @@ class mapper: + + def __getitem__(self, item): + return self.mapping[item] +- +\ No newline at end of file ++ +diff --git a/kuksa_feeders/dbc2val/dbcfeeder.py b/kuksa_feeders/dbc2val/dbcfeeder.py +index 71939c6..56c316a 100755 +--- a/kuksa_feeders/dbc2val/dbcfeeder.py ++++ b/kuksa_feeders/dbc2val/dbcfeeder.py +@@ -16,10 +16,7 @@ import configparser + import queue + import json + +-import dbc2vssmapper +-import dbcreader +-import j1939reader +-import elm2canbridge ++from dbc2val import dbc2vssmapper, dbcreader, j1939reader, elm2canbridge + + scriptDir= os.path.dirname(os.path.realpath(__file__)) + sys.path.append(os.path.join(scriptDir, "../../")) +@@ -27,6 +24,7 @@ from kuksa_viss_client import KuksaClientThread + + print("kuksa.val DBC example feeder") + config_candidates=['/config/dbc_feeder.ini', '/etc/dbc_feeder.ini', os.path.join(scriptDir, 'config/dbc_feeder.ini')] ++configfile = None + for candidate in config_candidates: + if os.path.isfile(candidate): + configfile=candidate +diff --git a/kuksa_feeders/setup.cfg b/kuksa_feeders/setup.cfg +new file mode 100644 +index 0000000..4b69ccf +--- /dev/null ++++ b/kuksa_feeders/setup.cfg +@@ -0,0 +1,31 @@ ++[metadata] ++name = dbc2val ++author = Sebastian Schildt, Naresh Nayak, Wenwen Chen ++author_email = sebastian.schildt@de.bosch.com, naresh.nayak@de.bosch.com, wenwen.chen@de.bosch.com ++description = kuksa.val DBC feeder ++long_description = file:README.md ++long_description_content_type = text/markdown ++url=https://github.com/eclipse/kuksa.val ++project_urls= ++ Source=https://github.com/eclipse/kuksa.val/tree/master/kuksa_feeders/dbc2val ++ Bug Tracker=https://github.com/eclipse/kuksa.val/issues ++classifiers = ++ Intended Audience :: Developers ++ Development Status :: 3 - Alpha ++ Environment :: Console ++ Programming Language :: Python :: 3 ++ License :: OSI Approved :: Eclipse Public License 2.0 (EPL-2.0) ++ Operating System :: OS Independent ++ Topic :: Software Development ++ ++license_file = ../LICENSE ++ ++[options] ++python_requires = >=3.6 ++install_requires= ++ pyserial ++ pyyaml ++ kuksa-viss-client ++packages=find: ++include_package_data = True ++scripts=dbc2val/dbcfeeder.py +diff --git a/kuksa_feeders/setup.py b/kuksa_feeders/setup.py +new file mode 100644 +index 0000000..ad08d17 +--- /dev/null ++++ b/kuksa_feeders/setup.py +@@ -0,0 +1,36 @@ ++# To avoid shipping dbcfeeder.py in the module itself, use the ++# technique outlined at: ++# ++# https://stackoverflow.com/a/50592100 ++# ++# This can be removed if the directory structure is ever reorganized ++# more along the lines of upstream recommendations. ++# ++ ++import fnmatch ++from setuptools import find_packages, setup ++from setuptools.command.build_py import build_py as build_py_orig ++ ++exclude = ['dbc2val.dbcfeeder'] ++ ++class build_py(build_py_orig): ++ def find_package_modules(self, package, package_dir): ++ modules = super().find_package_modules(package, package_dir) ++ print("modules = %s" % modules) ++ return [(pkg, mod, file, ) for (pkg, mod, file, ) in modules ++ if not any(fnmatch.fnmatchcase(pkg + '.' + mod, pat=pattern) ++ for pattern in exclude)] ++ ++setup( ++ version_config={ ++ "template": "{tag}", ++ "dev_template": "{tag}-{ccount}", ++ "dirty_template": "{tag}-{ccount}-dirty", ++ "starting_version": "0.1.11", ++ "version_callback": None, ++ "version_file": None, ++ "count_commits_from_version_file": False ++ }, ++ setup_requires=['setuptools-git-versioning'], ++ cmdclass={'build_py': build_py}, ++) |