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 <naoto.yamaguchi@aisin.co.jp>
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
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
-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
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