meta-agl-bsp: Rework gpsd configuration
[AGL/meta-agl.git] / meta-agl-bsp / meta-agl-refhw-gen3 / recipes-navigation / gpsd / gpsd-machine-conf_1.0.bbappend
1 FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
2
3 SRC_URI = "file://gpsd.refhw \
4            file://refhw-gpsd-helper.sh \
5            file://refhw.conf \
6 "
7
8 inherit update-alternatives
9
10 do_configure[noexec] = "1"
11 do_compile[noexec] = "1"
12
13 do_install() {
14     install -D -m 0644 ${WORKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw
15
16     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
17         install -D -m 0755 ${WORKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh
18         install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d
19         install -D -m 0644 ${WORKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf
20     fi
21 }
22
23 PACKAGE_ARCH = "${MACHINE_ARCH}"
24
25 CONFFILES:${PN} = "${sysconfdir}/default/gpsd.refhw"
26
27 ALTERNATIVE:${PN} = "gpsd-defaults"
28 ALTERNATIVE_LINK_NAME[gpsd-defaults] = "${sysconfdir}/default/gpsd"
29 ALTERNATIVE_TARGET[gpsd-defaults] = "${sysconfdir}/default/gpsd.refhw"
30 # NOTE: Priority needs to be below default of 10 to avoid overriding the
31 #       default configuration.  The script run by the systemd drop-in
32 #       will tweak things on boot to handle h3ulcb vs refhw.
33 ALTERNATIVE_PRIORITY[gpsd-defaults] = "5"