Add no-firmware subpackage. 39/10039/3 accepted/tizen/ivi/genivi tizen_ivi_genivi accepted/tizen/20130923.110619 accepted/tizen/20130923.193957 accepted/tizen/20130923.194531 accepted/tizen/20130923.214204 accepted/tizen/ivi/genivi/20140131.062232 accepted/tizen_ivi_stable/20131116.105028 ivi_oct_m2 submit/tizen/20130923.104723 submit/tizen_ivi_genivi/20140131.061519 submit/tizen_ivi_stable/20131116.100412
authorVictor Hakoun <victor.hakoun@eurogiciel.fr>
Mon, 16 Sep 2013 12:19:20 +0000 (14:19 +0200)
committerVictor Hakoun <victor.hakoun@eurogiciel.fr>
Mon, 16 Sep 2013 12:19:20 +0000 (14:19 +0200)
This package aim to be the Linux standard way to turn on and off bluetooth device
witout firmware.
- Spec file modifications (rpmlint error) : Summary; Licence; Group; Use macro %{_unitdir}
- Replace manifest with default floor
- Add changelog
- Fix TIVI-1691

Change-Id: I4fa91bc30fbb5eb3750280be4632728cf86aeaef
Signed-off-by: Victor Hakoun <victor.hakoun@eurogiciel.fr>
bluetooth-tools.manifest
packaging/bluetooth-tools.changes [new file with mode: 0644]
packaging/bluetooth-tools.spec
scripts/bt-dev-end.sh [new file with mode: 0755]
scripts/bt-dev-start.sh [new file with mode: 0755]

index e9e71d9..75b0fa5 100644 (file)
@@ -1,15 +1,5 @@
 <manifest>
-    <define>
-        <domain name="bluetooth-tools"/>
-    </define>
-    <assign>
-        <filesystem path="/etc/rc.d/init.d/bluetooth-address" label="_" exec_label="none"/>
-        <filesystem path="/etc/rc.d/rc3.d/S60bluetooth-address" label="_" exec_label="none"/>
-        <filesystem path="/etc/rc.d/rc5.d/S60bluetooth-address" label="_" exec_label="none"/>
-       <filesystem path="/usr/lib/systemd/system/bluetooth-address.service" label="_" exec_label="none" />
-       <filesystem path="/usr/lib/systemd/system/multi-user.target.wants/bluetooth-address.service" label="_" exec_label="none" />
-    </assign>
     <request>
-        <domain name="bluetooth-tools"/>
+        <domain name="_"/>
     </request>
 </manifest>
diff --git a/packaging/bluetooth-tools.changes b/packaging/bluetooth-tools.changes
new file mode 100644 (file)
index 0000000..842b40f
--- /dev/null
@@ -0,0 +1,7 @@
+* Mon Sep 16 2013 Victor Hakoun <victor.hakoun@eurogiciel.fr> submit/tizen/20130909.103211@05c05b6
+- Add no-firmware subpackage.
+- Fix TIVI-1723 bt-set-addr.sh is not part of the package and not recommended to specifically set bluetooth address for IVI. If the condition fails starting of the unit will be skipped.
+- Merge branch 'master' into tizen_2.1
+- Tizen 2.1 base
+- Initial empty repository
+
index 6aebbae..3accaf2 100644 (file)
@@ -1,16 +1,26 @@
 Name:       bluetooth-tools
-Summary:    bluetooth-tools
+Summary:    Bluetooth-tools
 Version:    0.2.35
 Release:    3
-Group:      TO_BE/FILLED_IN
-License:    Apache License, Version 2.0
+Group:      Network & Connectivity/Bluetooth
+License:    Apache-2.0
 Source0:    %{name}-%{version}.tar.gz
 Source1001:    bluetooth-address.service
 BuildRequires:  cmake
+Requires : bluetooth-tools-no-firmware
 
 %description
 Tools fo bluetooth run/stop and set address
 
+%package no-firmware
+Summary:    On/Off Bluetooth adapter
+Group:      Network & Connectivity/Bluetooth
+Requires:   %{name} = %{version}-%{release}
+Requires: rfkill
+Conflicts:  bluetooth-firmware-bcm
+
+%description no-firmware
+On/Off bluetooth device
 
 %prep
 %setup -q
@@ -31,13 +41,16 @@ mkdir -p %{buildroot}%{_sysconfdir}/rc.d/rc5.d
 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
 ln -s %{_sysconfdir}/rc.d/init.d/bluetooth-address %{buildroot}%{_sysconfdir}/rc.d/rc5.d/S60bluetooth-address
 
-mkdir -p %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants
-install -m 0644 %{SOURCE1001} %{buildroot}%{_libdir}/systemd/system/
-ln -s ../bluetooth-address.service %{buildroot}%{_libdir}/systemd/system/multi-user.target.wants/bluetooth-address.service
+mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
+install -m 0644 %{SOURCE1001} %{buildroot}%{_unitdir}
+ln -s ../bluetooth-address.service %{buildroot}%{_unitdir}/multi-user.target.wants/bluetooth-address.service
 
+mkdir -p %{buildroot}%{_prefix}/etc/bluetooth/
+install -m 0755 scripts/bt-dev-start.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-start.sh
+install -m 0755 scripts/bt-dev-end.sh %{buildroot}%{_prefix}/etc/bluetooth/bt-dev-end.sh
 
 %files
-%manifest bluetooth-tools.manifest
+%manifest %{name}.manifest
 %defattr(-,root,root,-)
 %{_sysconfdir}/rc.d/init.d/bluetooth-address
 %{_sysconfdir}/rc.d/rc3.d/S60bluetooth-address
@@ -49,6 +62,12 @@ ln -s ../bluetooth-address.service %{buildroot}%{_libdir}/systemd/system/multi-u
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-dev-up.sh
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-mode-on.sh
 %attr(0755,-,-) %{_prefix}/etc/bluetooth/bt-edutm-off.sh
-%{_libdir}/systemd/system/multi-user.target.wants/bluetooth-address.service
-%{_libdir}/systemd/system/bluetooth-address.service
 
+%{_unitdir}/multi-user.target.wants/bluetooth-address.service
+%{_unitdir}/bluetooth-address.service
+
+%files no-firmware
+%manifest %{name}.manifest
+%defattr(-, root, root)
+%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-end.sh
+%attr(755,-,-) %{_prefix}/etc/bluetooth/bt-dev-start.sh
diff --git a/scripts/bt-dev-end.sh b/scripts/bt-dev-end.sh
new file mode 100755 (executable)
index 0000000..fd6c37c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+#
+# Script for stopping Bluetooth stack
+#
+
+# Device down
+/usr/sbin/hciconfig hci0 down
+
+# Turn off Bluetooth Chip
+/usr/sbin/rfkill block bluetooth
diff --git a/scripts/bt-dev-start.sh b/scripts/bt-dev-start.sh
new file mode 100755 (executable)
index 0000000..c06524a
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Script for registering BT device
+BT_PLATFORM_DEFAULT_HCI_NAME="Tizen"
+
+# Trun-on Bluetooth Chip
+
+/usr/sbin/rfkill unblock bluetooth
+
+echo "Check for Bluetooth device status"
+if (/usr/sbin/hciconfig | grep hci); then
+       echo "Bluetooth device is UP"
+       /usr/sbin/hciconfig hci0 up
+else
+       echo "Bluetooth device is DOWN"
+       echo "Registering Bluetooth device"
+       /usr/sbin/hciconfig hci0 up
+       /usr/sbin/hciconfig hci0 name $BT_PLATFORM_DEFAULT_HCI_NAME
+       /usr/sbin/hciconfig hci0 sspmode 1
+fi