Skip to content

Commit

Permalink
Change bluetooth-raspberry.service to template unit
Browse files Browse the repository at this point in the history
Serial device name is an instance - ttyAMA0 by default
  • Loading branch information
RoEdAl committed Apr 29, 2018
1 parent 8953ca7 commit b61f5d4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Maintainer: Edmunt Pienkowsky <[email protected]>

pkgname=bluetooth-raspberrypi
pkgver=1
pkgver=2
pkgrel=1
pkgdesc='Bluetooth support for Raspberry Pi'
arch=('any')
Expand All @@ -10,11 +10,11 @@ url='http://wiki.archlinux.org/index.php/bluetooth'
depends=('firmware-raspberrypi' 'bluez-utils')
conflicts=('pi-bluetooth')
options=('!strip')
source=('bluetooth-raspberrypi.service'
source=('bluetooth-raspberrypi@.service'
'bluetooth-raspberrypi.conf'
'61-amba-tty-alias.rules')
md5sums=('8e965b8e57cb70f7ef8a82b431380b94'
'80ee98fd2dfec67abeeb8e602f226a15'
md5sums=('690edc48aed27f518128d79a5e24a952'
'7d32416a03fba468845cf8b22ef96a05'
'9406dbec74def6d99605b5bbab2a6ed5')

package() {
Expand All @@ -24,7 +24,7 @@ package() {
install -d "${pkgdir}/usr/lib/udev/rules.d"
install -d "${pkgdir}/usr/lib/firmware/updates/brcm"

install -m 0644 bluetooth-raspberrypi.service "${pkgdir}/usr/lib/systemd/system"
install -m 0644 bluetooth-raspberrypi@.service "${pkgdir}/usr/lib/systemd/system"
install -m 0644 bluetooth-raspberrypi.conf "${pkgdir}/usr/lib/systemd/system/bluetooth.service.d"
install -m 0644 61-amba-tty-alias.rules "${pkgdir}/usr/lib/udev/rules.d"

Expand Down
4 changes: 2 additions & 2 deletions bluetooth-raspberrypi.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[Unit]
Wants=bluetooth-raspberrypi.service
Wants=bluetooth-raspberrypi@ttyAMA0.service

[Install]
Also=bluetooth-raspberrypi.service
Also=bluetooth-raspberrypi@ttyAMA0.service
9 changes: 5 additions & 4 deletions bluetooth-raspberrypi.service → [email protected]
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
[Unit]
Description=Broadcom BCM43438 bluetooth HCI
Description=Broadcom BCM434* Bluetooth HCI
ConditionPathIsDirectory=/proc/device-tree/soc/gpio@7e200000/bt_pins
DefaultDependencies=no
Wants=local-fs.target
Before=sysinit.target shutdown.target
After=systemd-modules-load.service local-fs.target
After=sys-subsystem-serial-devices-ttyAMA0.device
BindsTo=sys-subsystem-serial-devices-%i.device
After=sys-subsystem-serial-devices-%i.device local-fs.target
RefuseManualStart=yes
RefuseManualStop=yes
Conflicts=shutdown.target

[Service]
ExecStart=/usr/bin/btattach -B /dev/ttyAMA0 -P bcm -S 3000000 -N
ExecStart=/usr/bin/btattach -B /dev/%i -P bcm -S 3000000 -N
LimitNPROC=1
ProtectHome=true
ProtectSystem=full

[Install]
WantedBy=sysinit.target
DefaultInstance=ttyAMA0

0 comments on commit b61f5d4

Please sign in to comment.