diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-05-26 10:38:07 -0400 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-05-26 11:27:50 -0400 |
commit | 63512e51692b48ad645dba0a21858cc48d5b416f (patch) | |
tree | b7d86a214d1efd314bdc1f6d8923476eac651fe2 /recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch | |
parent | e7c84a94bb6a28cc560cc3027799bf4ae3c13579 (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 backports of recipes for required Python modules:
python3-bitstruct, python3-can, python3-cantools, python3-cmd2,
python3-diskcache, python3-importlib-metadata,
python3-setuptools-scm, python3-textparser, python3-toml
This is required to both add recipes missing from dunfell as well
as to meet version requirements for kuksa-viss-client and
kuksa-dbc-feeder. For the most part the recipes were picked from
the poky and meta-openembedded kirkstone branches before the
significant Python module build rework done for the kirkstone M4
milestone. There is some potential for updating them to newer
backports, but this will be a low priority unless there are
explicit requests.
- Add bbappend for python3-cantools to add some missing runtime
dependencies discovered during testing. This will be addressed
upstream in meta-python as time permits.
- 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 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: I4f9fe9c34165da30005d39689739c73dfdbbc615
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 | 166 |
1 files changed, 166 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..42ab7886d --- /dev/null +++ b/recipes-connectivity/kuksa-val/kuksa-dbc-feeder/0001-dbc2val-add-installation-mechanism.patch @@ -0,0 +1,166 @@ +From 6e7176cf6cbf7587c7e7999da56b59a32cf81f82 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 26a0c23..a7cec86 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..ca6ad0b +--- /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}, ++) +-- +2.35.1 + |