gpsd append: baudrate configuration by systemd service
configure baudrate of serial gnss receiver with gpsctl.
Todo: generic solutions for all hardware
future-proof: support for more that one gnss module
BugzID: 60330
Signed-off-by: Ramon Moesching <ramon.moesching@netmodule.com>
This commit is contained in:
parent
a0b9dce696
commit
5dc6f2ce8d
|
|
@ -0,0 +1,13 @@
|
|||
[Unit]
|
||||
Description=GPS baud rate configuration
|
||||
Requires=gpsd.socket
|
||||
After=gpsd.service
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
ExecStart=/usr/bin/gpsctl -s 115200 /dev/ttyS3
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Also=gpsd.socket
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
|
||||
SRC_URI =+ " \
|
||||
SRC_URI_prepend = " \
|
||||
file://gpsbaud.service \
|
||||
git://git.netmodule.intranet/nmsw/gpsd.git;protocol=ssh;user=gitea;branch=imu-integration \
|
||||
file://60-ublox-neo.rules \
|
||||
"
|
||||
|
|
@ -9,7 +10,11 @@ SRC_URI_remove = "${SAVANNAH_GNU_MIRROR}/${BPN}/${BP}.tar.gz"
|
|||
SRCREV = "${AUTOREV}"
|
||||
S = "${WORKDIR}/git"
|
||||
|
||||
SYSTEMD_SERVICE_${PN} += "${BPN}.service"
|
||||
SYSTEMD_SERVICE_${PN} += "${BPN}.service \
|
||||
gpsbaud.service \
|
||||
"
|
||||
|
||||
FILES_${PN} += " gpsbaud.serivce "
|
||||
|
||||
TTY_DEVICE = "/dev/ttyS3"
|
||||
TTY_DEVICE_imx8-nmhw23 = "/dev/gps0"
|
||||
|
|
@ -21,6 +26,9 @@ do_install_append () {
|
|||
install -d ${D}${sysconfdir}/udev/rules.d
|
||||
install -m 0644 ${WORKDIR}/60-ublox-neo.rules ${D}${sysconfdir}/udev/rules.d
|
||||
|
||||
install -d ${D}${systemd_unitdir}/system/
|
||||
install -m 0644 ${WORKDIR}/gpsbaud.service ${D}${systemd_unitdir}/system/
|
||||
|
||||
sed -i 's|DEVICES=""|DEVICES="${TTY_DEVICE}"|g' ${D}/etc/default/gpsd.default
|
||||
sed -i 's|USBAUTO="true"|USBAUTO="${USBAUTO_STATE}"|g' ${D}/etc/default/gpsd.default
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue