blob: 5cc40668d3e53a7fcc03516cd96bb0ec3bb6f4f7 (
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
37
|
SUMMARY = "Initialize Bluetooth UART"
DESCRIPTION = "At runtime on target make sure appropriate firmware is used and initialize Bluetooth UART"
LICENSE = "PD"
PACKAGE_ARCH = "${MACHINE_ARCH}"
RRECOMMENDS_${PN} = "bluez5"
SRC_URI = " \
file://btuart.sh \
file://btuart.service \
file://COPYING \
"
LIC_FILES_CHKSUM = "file://${WORKDIR}/COPYING;md5=1c3a7fb45253c11c74434676d84fe7dd"
do_install () {
install -d ${D}/${sbindir}
install -m 0755 ${WORKDIR}/*.sh ${D}/${sbindir}
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/btuart.service ${D}${systemd_unitdir}/system
}
SYSTEMD_PACKAGES = "${PN}"
SYSTEMD_SERVICE_${PN} = "btuart.service"
inherit allarch systemd
pkg_postinst_ontarget_${PN}_verdin-imx8mp () {
# only BT UART modules need our service
if fgrep -q V1.0 /proc/device-tree/toradex,board-rev || ! fgrep -q toradex,verdin-imx8mp-wifi /proc/device-tree/compatible; then
/bin/systemctl disable btuart.service
/bin/systemctl stop btuart.service
exit 0
fi
}
|