aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2021-02-04 10:22:10 -0500
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2021-02-05 11:54:16 +0000
commitda9aad9b0bda135578d017fa68c0db751e82b2e4 (patch)
tree5501206d7bd44c87cec918ad8eceaf1e95b2160b /meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb
parent48fd4407babad2df5dba0aeb57c832a9ab531c0d (diff)
meta-agl-bsp: Add reference hardware GPS support
Add recipe for gpsd configuration for the reference hardware, which also installs a script plus systemd unit drop-in to handle enabling and disabling it. The latter is required due to the reference hardware's reuse of the h3ulcb image, which means the existing PREFERRED_PROVIDER_virtual/gpsd-conf scheme is not sufficient in this case. Bug-AGL: SPEC-3792 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: Ifaf3b93d06825f7c5c6a8ce2773d93931e47178c Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/25994 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-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb')
-rw-r--r--meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb39
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb
new file mode 100644
index 000000000..c87308eb7
--- /dev/null
+++ b/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-conf-refhw_1.0.bb
@@ -0,0 +1,39 @@
+SUMMARY = "AGL Reference Hardware specific gpsd configuration"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
+
+COMPATIBLE_MACHINE = "agl-refhw-h3"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "file://gpsd.refhw \
+ file://refhw-gpsd-helper.sh \
+ file://refhw.conf \
+"
+
+inherit update-alternatives
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -D -m 0644 ${WORKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
+ install -D -m 0755 ${WORKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh
+ install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d
+ install -D -m 0644 ${WORKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf
+ fi
+}
+
+ALTERNATIVE_${PN} = "gpsd-defaults"
+ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
+ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.refhw"
+# NOTE: Priority needs to be below default of 10 to avoid overriding the
+# default configuration. The script run by the systemd drop-in
+# will tweak things on boot to handle h3ulcb vs refhw.
+ALTERNATIVE_PRIORITY[gpsd-defaults] = "5"
+
+CONFFILES_${PN} = "${sysconfdir}/default/gpsd.refhw"
+
+# NOTE: Explicitly not defining RPROVIDES of "virtual/gpsd-conf" to
+# avoid conflicting with the default configuration and potentially
+# changing behavior on m3ulcb/h3ulcb.