summaryrefslogtreecommitdiffstats
path: root/meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2024-06-26 15:22:14 -0400
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2024-06-27 09:53:39 +0000
commit2460f6ac99d834f00dfa6e26546c41eac6cd38c9 (patch)
tree1e9d6714f63bc29f8e31e5007c162e1df3d6406b /meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch
parentdbb228360317872e7c6fcbd96faaf404535130c3 (diff)
Add meta-agl-kuksa-val
Add new meta-agl-kuksa-val layer, and populate it with the base KUKSA.val databroker and VSS schema recipes from meta-agl, as well as the recipes for the Python modules they depend on. Additional changes: - Installation of AGL-specific configuration has been removed from the kuksa-can-provider recipe. It now packages the upstream example/test configuration in a new kuksa-can-provider-conf-example package that can be replaced via the RPROVIDES scheme. Some minor tweaks for paths are made to the upstream .ini file to match FHS expectations. Bug-AGL: SPEC-5136 Change-Id: I3128a223f4fcf16e496cb27e26afcaee0a28979a Signed-off-by: Scott Murray <scott.murray@konsulko.com> Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/30040 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Reviewed-by: Jan-Simon Moeller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch')
-rw-r--r--meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch b/meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch
new file mode 100644
index 000000000..91a309240
--- /dev/null
+++ b/meta-agl-kuksa-val/recipes-connectivity/kuksa-val/kuksa-can-provider/0002-dbc2val-usability-improvements.patch
@@ -0,0 +1,80 @@
+From 2e4e1f9147f1ebe5b545ae0cab41341e3abb00ae Mon Sep 17 00:00:00 2001
+From: Scott Murray <scott.murray@konsulko.com>
+Date: Sat, 15 Jun 2024 13:13:17 -0400
+Subject: [PATCH 2/4] dbc2val: usability improvements
+
+Changes:
+- Tweaked default configuration file search path to better match
+ Linux FHS. First look for a config.ini or dbc_feeder.ini in
+ /etc/kuksa-can-provider, then fall back to /etc/dbc_feeder.ini
+ before using trying other possible paths.
+- Add catching of exceptions around CAN device opening so that the
+ script can exit cleanly with an error message if the device is
+ not available.
+- Tweaked DBC default value file command line argument parsing so
+ that it does not attempt to fallback to "dbc_default_values.json"
+ in the current working directory. That likely works for upstream
+ test scenarios, but prevents running on a target.
+
+Upstream-Status: pending
+
+Signed-off-by: Scott Murray <scott.murray@konsulko.com>
+---
+ dbcfeeder.py | 19 +++++++++++++++----
+ 1 file changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/dbcfeeder.py b/dbcfeeder.py
+index a1ef174..c252503 100755
+--- a/dbcfeeder.py
++++ b/dbcfeeder.py
+@@ -144,7 +144,11 @@ class Feeder:
+ whitelisted_frame_ids.append(filter.can_id) # type: ignore
+ elm2canbridge.elm2canbridge(canport, self._elmcan_config, whitelisted_frame_ids)
+
+- self._reader.start()
++ try:
++ self._reader.start()
++ except:
++ log.error("Could not open %s, exiting", canport)
++ sys.exit(-1)
+
+ receiver = threading.Thread(target=self._run_receiver)
+ receiver.start()
+@@ -165,7 +169,12 @@ class Feeder:
+ # For now creating another bus
+ # Maybe support different buses for downstream/upstream in the future
+
+- self._canclient = CANClient(interface="socketcan", channel=canport, can_fd=can_fd)
++ self._canclient = None
++ try:
++ self._canclient = CANClient(interface="socketcan", channel=canport, can_fd=can_fd)
++ except:
++ log.error("Could not open %s, exiting", canport)
++ sys.exit(-1)
+
+ transmitter = threading.Thread(target=self._run_transmitter)
+ transmitter.start()
+@@ -335,8 +344,10 @@ def _parse_config(filename: str) -> configparser.ConfigParser:
+ configfile = filename
+ else:
+ config_candidates = [
+- "/config/dbc_feeder.ini",
++ "/etc/kuksa-can-provider/config.ini",
++ "/etc/kuksa-can-provider/dbc_feeder.ini",
+ "/etc/dbc_feeder.ini",
++ "/config/dbc_feeder.ini",
+ "config/dbc_feeder.ini",
+ ]
+ for candidate in config_candidates:
+@@ -534,7 +545,7 @@ def main(argv):
+ elif os.environ.get("DBC_DEFAULT_FILE"):
+ dbc_default = os.environ.get("DBC_DEFAULT_FILE")
+ else:
+- dbc_default = config.get(CONFIG_SECTION_CAN, CONFIG_OPTION_DBC_DEFAULT_FILE, fallback="dbc_default_values.json")
++ dbc_default = config.get(CONFIG_SECTION_CAN, CONFIG_OPTION_DBC_DEFAULT_FILE, fallback=None)
+
+ if args.mapping:
+ mappingfile = args.mapping
+--
+2.44.0
+