commit 8bc97370322e49f03edd46b578a81c6846e88554246c295cc02ddb8c5c406841
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-05-09T22:48:54Z |
| subject | Export missing bin, dpa_app to support env vars |
commit 8bc97370322e49f03edd46b578a81c6846e88554246c295cc02ddb8c5c406841
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-05-09T22:48:54Z
Export missing bin, dpa_app to support env vars
---
docker/ask.Dockerfile | 12 ++--
...a-app-allow-xml-config-path-env-overrides.patch | 72 ++++++++++++++++++++++
2 files changed, 79 insertions(+), 5 deletions(-)
diff --git a/docker/ask.Dockerfile b/docker/ask.Dockerfile
index 533c26c..4e42dd8 100644
--- a/docker/ask.Dockerfile
+++ b/docker/ask.Dockerfile
@@ -262,11 +262,11 @@ RUN mkdir -p /out/ASK/dist && \
cp "${ASK_DIR}/cdx/cdx.ko" /out/ASK/dist && \
cp "${ASK_DIR}/fci/fci.ko" /out/ASK/dist && \
cp "${ASK_DIR}/auto_bridge/auto_bridge.ko" /out/ASK/dist && \
- mkdir -p /out/ask/bin && \
- cp /src/fmc/source/fmc /out/ASK/bin && \
- cp "${ASK_DIR}/cmm/src/cmm" /out/ASK/bin && \
- cp "${ASK_DIR}/dpa_app/dpa_app" /out/ASK/bin && \
- aarch64-linux-musl-strip /out/ASK/bin/fmc /out/ASK/bin/cmm /out/ASK/bin/dpa_app || true
+ mkdir -p /out/ASK/bin && \
+ cp /src/fmc/source/fmc /out/ASK/bin/ && \
+ cp "${ASK_DIR}/cmm/src/cmm" /out/ASK/bin/ && \
+ cp "${ASK_DIR}/dpa_app/dpa_app" /out/ASK/bin/ && \
+ aarch64-linux-musl-strip /out/ASK/bin/fmc /out/ASK/bin/cmm /out/ASK/bin/dpa_app
# in-tree Linux kernel modules
RUN mkdir -p /out/rootfs && \
@@ -297,5 +297,7 @@ COPY --from=build \
/src/linux/arch/arm64/boot/dts/freescale/${DEVICE_TREE_TARGET}.dtb \
/kernel/
+COPY --from=build /out/ASK/bin/ /bin/
+
# Export the configs for Gateway Development Kit
COPY --from=build /out/rootfs-cfg/ /rootfs-cfg/
diff --git a/patches/ask/dpa/0001-dpa-app-allow-xml-config-path-env-overrides.patch b/patches/ask/dpa/0001-dpa-app-allow-xml-config-path-env-overrides.patch
new file mode 100644
index 0000000..4ae1766
--- /dev/null
+++ b/patches/ask/dpa/0001-dpa-app-allow-xml-config-path-env-overrides.patch
@@ -0,0 +1,72 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: monok8s <monok8s@example.invalid>
+Date: Sun, 10 May 2026 00:00:00 +0000
+Subject: [PATCH] dpa_app: allow XML config paths to be overridden by env
+
+Keep the vendor default XML paths, but allow deployments to override them
+without patching the binary or placing board-specific XML files directly
+under /etc.
+
+Supported environment variables:
+
+ CDX_CFG_FILE
+ CDX_PCD_FILE
+ CDX_PDL_FILE
+ CDX_SP_FILE
+
+This is useful for monok8s/OpenRC integration where board-specific DPA
+configuration can live under a managed config directory.
+---
+ dpa_app/dpa.c | 30 ++++++++++++++++++++++++++++++
+ 1 file changed, 30 insertions(+)
+
+diff --git a/dpa_app/dpa.c b/dpa_app/dpa.c
+index 91ca1d4..960afcd 100644
+--- a/dpa_app/dpa.c
++++ b/dpa_app/dpa.c
+@@ -91,6 +91,34 @@ char *pcd_file = DEFAULT_PCD_FILE;
+ char *pdl_file = DEFAULT_PDL_FILE;
+ char *sp_file = DEFAULT_SP_FILE;
+
++static void dpa_load_env_paths(void)
++{
++ char *v;
++
++ v = getenv("CDX_CFG_FILE");
++ if (v && *v)
++ cfg_file = v;
++
++ v = getenv("CDX_PCD_FILE");
++ if (v && *v)
++ pcd_file = v;
++
++ v = getenv("CDX_PDL_FILE");
++ if (v && *v)
++ pdl_file = v;
++
++ v = getenv("CDX_SP_FILE");
++ if (v && *v)
++ sp_file = v;
++
++#ifdef DPA_C_DEBUG
++ printf("%s::cfg_file %s\n", __func__, cfg_file);
++ printf("%s::pcd_file %s\n", __func__, pcd_file);
++ printf("%s::pdl_file %s\n", __func__, pdl_file);
++ printf("%s::sp_file %s\n", __func__, sp_file);
++#endif
++}
++
+ //fmc model from xml files
+ static struct fmc_model_t cmodel;
+
+@@ -752,6 +780,8 @@ int dpa_init(void)
+ char devname[64];
+ int retval;
+
++ dpa_load_env_paths();
++
+ //open cdx control device
+ sprintf(devname, "/dev/%s", CDX_CTRL_CDEVNAME);
+ cdx_dev_handle = open(devname, O_RDWR);
+--
+2.39.5