Add hci's command service file for Broadcom BT/FM request 50/76150/1 accepted/tizen/common/20160623.154303 accepted/tizen/ivi/20160623.123853 accepted/tizen/mobile/20160623.123806 accepted/tizen/tv/20160623.123819 accepted/tizen/wearable/20160623.123834 submit/tizen/20160623.035421
authorTaejin Woo <tt.woo@samsung.com>
Thu, 23 Jun 2016 03:19:10 +0000 (12:19 +0900)
committerTaejin Woo <tt.woo@samsung.com>
Thu, 23 Jun 2016 03:20:32 +0000 (12:20 +0900)
Change-Id: Ib958dda1bfd9bf1cdb89cb787793e86b0642c9f3
Signed-off-by: Taejin Woo <tt.woo@samsung.com>
packaging/bluetooth-firmware-bcm.spec
packaging/bluetooth-hci-device.service [new file with mode: 0644]
packaging/bluetooth-hciattach@.service [new file with mode: 0644]

index b060c34..457a544 100644 (file)
@@ -7,6 +7,8 @@ License:    Apache
 # NOTE: Source name does not match package name.  This should be
 # resolved in the future, by I don't have that power. - Ryan Ware
 Source0:    %{name}-%{version}.tar.gz
+Source1:    bluetooth-hciattach@.service
+Source2:    bluetooth-hci-device.service
 Provides:   bluetooth-scripts
 
 BuildRequires:  pkgconfig(vconf)
@@ -47,6 +49,9 @@ mkdir -p %{buildroot}/usr/share/license
 cp LICENSE.APLv2 %{buildroot}/usr/share/license/%{name}
 cat %{_builddir}/%{name}-%{version}/LICENSE.Broadcom >> %{buildroot}/usr/share/license/%{name}
 
+install -D -m 0644 %SOURCE1 %{buildroot}%{_libdir}/systemd/system/bluetooth-hciattach@.service
+install -D -m 0644 %SOURCE2 %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-device.service
+
 %files
 %defattr(-,root,root,-)
 #%{_bindir}/bcmtool_4330b1
@@ -58,6 +63,8 @@ cat %{_builddir}/%{name}-%{version}/LICENSE.Broadcom >> %{buildroot}/usr/share/l
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
+%exclude %{_libdir}/systemd/system/bluetooth-hciattach@.service
+%exclude %{_libdir}/systemd/system/bluetooth-hci-device.service
 %manifest %{name}.manifest
 
 %post exynos3250
@@ -74,6 +81,8 @@ ln -s %{_prefix}/etc/bluetooth/bt-dev-start-exynos3250.sh %{_prefix}/etc/bluetoo
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-exynos3250.sh
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
 /usr/share/license/%{name}
+%{_libdir}/systemd/system/bluetooth-hciattach@.service
+%{_libdir}/systemd/system/bluetooth-hci-device.service
 %manifest %{name}.manifest
 
 %post artik
@@ -89,4 +98,6 @@ ln -s %{_prefix}/etc/bluetooth/bt-dev-start-artik.sh %{_prefix}/etc/bluetooth/bt
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start-artik.sh
 %attr(755,-,-) %{_prefix}/etc/bluetooth/bt-set-addr.sh
 /usr/share/license/%{name}
+%{_libdir}/systemd/system/bluetooth-hciattach@.service
+%{_libdir}/systemd/system/bluetooth-hci-device.service
 %manifest %{name}.manifest
diff --git a/packaging/bluetooth-hci-device.service b/packaging/bluetooth-hci-device.service
new file mode 100644 (file)
index 0000000..e05228c
--- /dev/null
@@ -0,0 +1,11 @@
+[Unit]
+Description=hciattach service for Broadcom BT/FM requested
+StopWhenUnneeded=yes
+
+[Service]
+Type=oneshot
+ExecStart=/usr/etc/bluetooth/bt-dev-start.sh
+ExecStop=/usr/etc/bluetooth/bt-dev-end.sh
+RemainAfterExit=yes
+StandardOutput=journal+console
+StandardError=inherit
diff --git a/packaging/bluetooth-hciattach@.service b/packaging/bluetooth-hciattach@.service
new file mode 100644 (file)
index 0000000..00ec9e9
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=hciattach service requested by %I
+Requires=bluetooth-hci-device.service
+After=bluetooth-hci-device.service
+
+[Service]
+Type=oneshot
+ExecStartPre=-/bin/mkdir -p /run/bluetooth/
+ExecStart=/bin/touch /run/bluetooth/%I
+ExecStop=/bin/rm /run/bluetooth/%I
+RemainAfterExit=yes
+StandardOutput=journal+console
+StandardError=inherit