From 608d983bdfb90929689bd0eb31e4bc5ca11f8881 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 4 Jan 2024 19:56:30 -0500 Subject: [PATCH] ondemandnavi-config: Enable Mapbox if MAPBOX_ACCESS_TOKEN is set To avoid needing manual modifications to enable Mapbox support, rework the ondemandnavi-config recipe to update the configuration file to enable it if the MAPBOX_ACCESS_TOKEN variable is set, and remove the placeholder value for MAPBOX_ACCESS_TOKEN. Bug-AGL: SPEC-5041 Change-Id: Ia6490363b2de6ddf862f25f1c1e0b5eea21c3107 Signed-off-by: Naoto Yamaguchi Signed-off-by: Scott Murray Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl-demo/+/29572 ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account Tested-by: Jenkins Job builder account --- recipes-demo/navigation/ondemandnavi-config_1.0.bb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/recipes-demo/navigation/ondemandnavi-config_1.0.bb b/recipes-demo/navigation/ondemandnavi-config_1.0.bb index 212971f26..644102ed3 100644 --- a/recipes-demo/navigation/ondemandnavi-config_1.0.bb +++ b/recipes-demo/navigation/ondemandnavi-config_1.0.bb @@ -11,11 +11,14 @@ SRC_URI = "file://naviconfig.ini \ inherit allarch -MAPBOX_ACCESS_TOKEN ?= "Please set mapbox access token" +MAPBOX_ACCESS_TOKEN ?= "" do_compile[noexec] = "1" do_install () { install -D -m 644 ${WORKDIR}/naviconfig.ini ${D}${sysconfdir}/naviconfig.ini - sed -i -e 's/MAPBOX_ACCESS_TOKEN/${MAPBOX_ACCESS_TOKEN}/' ${D}${sysconfdir}/naviconfig.ini + if [ -n "${MAPBOX_ACCESS_TOKEN}" ]; then + sed -i -e 's/MAPBOX_ACCESS_TOKEN/${MAPBOX_ACCESS_TOKEN}/;s/\("enableOSM":\)true/\1false/' \ + ${D}${sysconfdir}/naviconfig.ini + fi } -- 2.16.6