summaryrefslogtreecommitdiffstats
path: root/meta-agl-bsp/meta-agl-refhw-gen3/recipes-navigation/gpsd/gpsd-machine-conf_1.0.bbappend
blob: 4407b10111e6c1387bdbf53c1f07c4ffac26aafb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI = "file://gpsd.refhw \
           file://refhw-gpsd-helper.sh \
           file://refhw.conf \
"

S = "${WORKDIR}/sources"
UNPACKDIR = "${S}"

inherit update-alternatives

do_configure[noexec] = "1"
do_compile[noexec] = "1"

do_install() {
    install -D -m 0644 ${UNPACKDIR}/gpsd.refhw ${D}/${sysconfdir}/default/gpsd.refhw

    if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
        install -D -m 0755 ${UNPACKDIR}/refhw-gpsd-helper.sh ${D}/${sbindir}/refhw-gpsd-helper.sh
        install -d ${D}${sysconfdir}/systemd/system/gpsd.service.d
        install -D -m 0644 ${UNPACKDIR}/refhw.conf ${D}${sysconfdir}/systemd/system/gpsd.service.d/refhw.conf
    fi
}

PACKAGE_ARCH = "${MACHINE_ARCH}"

CONFFILES:${PN} = "${sysconfdir}/default/gpsd.refhw"

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"