From: Scott Murray Date: Fri, 5 Jan 2024 00:56:30 +0000 (-0500) Subject: ondemandnavi-config: Enable Mapbox if MAPBOX_ACCESS_TOKEN is set X-Git-Tag: 16.93.0~8 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=AGL%2Fmeta-agl-demo.git;a=commitdiff_plain;h=608d983bdfb90929689bd0eb31e4bc5ca11f8881 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 --- 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 }