--- /dev/null
+[Unit]
+Description=Service to run bt-stack-up.sh script to start BT functions
+
+[Service]
+User=network_fw
+Group=network_fw
+Type=oneshot
+SmackProcessLabel=System
+SupplementaryGroups=priv_mediastorage priv_externalstorage dialout
+Capabilities=cap_sys_module=i
+SecureBits=keep-caps
+ExecStart=/usr/etc/bluetooth/bt-stack-up.sh
+KillMode=process
+
+[Install]
+WantedBy=multi-user.target
install -D -m 0644 packaging/bluetooth-hci-down.service %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-down.service
install -D -m 0644 packaging/bluetooth-hci-down.path %{buildroot}%{_libdir}/systemd/system/bluetooth-hci-down.path
+install -D -m 0644 packaging/bluetooth-stack-up-common.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-up-common.service
+install -D -m 0644 packaging/bluetooth-stack-down-common.service %{buildroot}%{_libdir}/systemd/system/bluetooth-stack-down-common.service
+
%post
mkdir -p %{_libdir}/systemd/system/multi-user.target.wants/
#ln -sf %{_libdir}/systemd/system/bluetooth-hci-logger.path %{_libdir}/systemd/system/multi-user.target.wants/bluetooth-hci-logger.path
ln -sf common/bt-stack-down.sh bt-stack-down.sh
ln -sf common/bt-reset-env.sh bt-reset-env.sh
popd
+pushd %{_unitdir}
+mv bluetooth-stack-up-common.service bluetooth-stack-up.service
+mv bluetooth-stack-down-common.service bluetooth-stack-down.service
+popd
%preun profile_common
pushd %{_prefix}/etc/bluetooth/
rm bt-stack-up.sh
rm bt-stack-down.sh
rm bt-reset-env.sh
popd
+pushd %{_unitdir}
+rm bluetooth-stack-up.service
+rm bluetooth-stack-down.service
+popd
%files profile_common
%license LICENSE.APLv2
#%{_sysconfdir}/rc.d/init.d/bluetooth-address
%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-up.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-stack-down.sh
%attr(0755,-,-) %{_prefix}/etc/bluetooth/common/bt-reset-env.sh
+%{_libdir}/systemd/system/bluetooth-stack-up-common.service
+%{_libdir}/systemd/system/bluetooth-stack-down-common.service
%post profile_mobile
pushd %{_prefix}/etc/bluetooth/