[-]
[+]
|
Changed |
_service:tar_git:droid-config-ham.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:droid-config-ham.spec
^
|
|
[-]
[+]
|
Deleted |
_service:tar_git:droid-config-ham-0.0.6.tar.bz2/droid-configs-device/sparse/usr/bin/droid/kill-cgroup.sh
^
|
@@ -1,74 +0,0 @@
-#!/bin/sh
-# Contact: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
-#
-# Copyright (c) 2013, Jolla Ltd.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met:
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# * Neither the name of the <organization> nor the
-# names of its contributors may be used to endorse or promote products
-# derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-# Kill all processes that are in this same cgroup ($1)
-[ -z "$1" ] && echo "Need cgroup path" && exit 1
-CGROUP=$1
-[ ! -f /sys/fs/cgroup/systemd/$CGROUP/cgroup.procs ] && echo "No such cgroup: $1" && exit 1
-
-get_pids() {
- # Get list of running pids in this cgroup
- # return list $PIDS and $NUM_PIDS
- PIDS=$(cat /sys/fs/cgroup/systemd/$CGROUP/cgroup.procs)
- NUM_PIDS=$(echo $PIDS | wc -w)
-}
-
-kill_pids() {
- # Kill pids using signal $1
- for pid in $PIDS; do
- [ -d /proc/$pid ] && kill -$1 $pid
- done
-}
-
-# ============== main() ===============
-
-get_pids
-PREV_NUM_PIDS=$NUM_PIDS
-kill_pids TERM
-sleep 1
-WAIT=1
-get_pids
-MAX_WAIT=5
-while [ $NUM_PIDS -gt 0 -a $WAIT -lt $MAX_WAIT ]; do
- if [ $NUM_PIDS -lt $PREV_NUM_PIDS ]; then
- # Number of running processes is getting smaller
- # Wait a little bit more
- sleep 1
- else
- # Number of pids is not gettting smaller
- break
- fi
- let WAIT=$WAIT+1
- PREV_NUM_PIDS=$NUM_PIDS
- get_pids
-done
-# If anyone left, hard kill them all
-[ $NUM_PIDS -gt 0 ] && kill_pids KILL
-exit 0
-
|
[-]
[+]
|
Deleted |
_service:tar_git:droid-config-ham-0.0.6.tar.bz2/sparse/lib/systemd/system/bluetooth.service.wants/droid-hcismd-up.service
^
|
-(symlink to ../droid-hcismd-up.service)
|
[-]
[+]
|
Deleted |
_service:tar_git:droid-config-ham-0.0.6.tar.bz2/sparse/lib/systemd/system/droid-hcismd-up.service
^
|
@@ -1,14 +0,0 @@
-[Unit]
-Description=Enable Bluetooth HCI over SMD
-After=droid-late-start.target
-Before=bluetooth.service
-Conflicts=shutdown.target actdead.target
-
-[Service]
-Type=oneshot
-ExecStart=/bin/sh /usr/bin/droid/droid-hcismd-up.sh
-RemainAfterExit=yes
-
-[Install]
-WantedBy=bluetooth.service
-
|
[-]
[+]
|
Deleted |
_service:tar_git:droid-config-ham-0.0.6.tar.bz2/sparse/usr/bin/droid/droid-hcismd-up.sh
^
|
@@ -1,28 +0,0 @@
-#!/bin/sh
-
-# Maximum number of attempts to enable hcismd to try to get
-# hci0 to come online. Writing to sysfs too early seems to
-# not work, so we loop.
-MAXTRIES=15
-
-i=1
-while [ ! $i -gt $MAXTRIES ] ; do
- echo 1 > /sys/module/hci_smd/parameters/hcismd_set
- if [ -e /sys/class/bluetooth/hci0 ] ; then
- # found hci0, exit successfully
- echo 0 > /sys/module/hci_smd/parameters/hcismd_set
- bt_mac=$(/system/bin/hci_qcomm_init -e | grep -oP '([0-9a-f]{2}:){5}([0-9a-f]{2})')
- echo "BT MAC: $bt_mac"
- if [ ! -z "$bt_mac" ] ; then
- echo $bt_mac > /var/lib/bluetooth/board-address
- echo "BT MAC: $bt_mac"
- fi
- echo 1 > /sys/module/hci_smd/parameters/hcismd_set
- exit 0
- fi
- sleep 1
- if [ $i == $MAXTRIES ] ; then
- # must have gotten through all our retries, fail
- exit 1
- fi
-done
|
[-]
[+]
|
Changed |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/droid-configs-device/sparse/lib/systemd/system/droid-hal-init.service
^
|
@@ -13,7 +13,7 @@
Type=notify
NotifyAccess=all
ExecStart=/bin/sh /usr/bin/droid/droid-hal-startup.sh
-ExecStop=/usr/bin/droid/kill-cgroup.sh %c
+ExecStop=/bin/sh /usr/bin/droid/droid-hal-shutdown.sh
Restart=always
# Lets make sure we don't block minutes in case of errors.
TimeoutSec=15
|
[-]
[+]
|
Added |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/droid-configs-device/sparse/usr/bin/droid/droid-hal-shutdown.sh
^
|
@@ -0,0 +1,81 @@
+#!/bin/sh
+# Contact: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
+#
+# Copyright (c) 2013, Jolla Ltd.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are met:
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+# * Neither the name of the <organization> nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# The following should be in /init.rc, so init will shut everything down:
+# on property:hybris.shutdown=*
+# class_stop late_start
+# class_stop main
+# class_stop core
+
+# Kill all processes that are in this same cgroup ($1)
+[ -z "$1" ] && echo "Need cgroup path" && exit 1
+CGROUP=$1
+[ ! -f /sys/fs/cgroup/systemd/$CGROUP/cgroup.procs ] && echo "No such cgroup: $1" && exit 1
+
+get_pids() {
+ # Get list of running pids in this cgroup
+ # return list $PIDS and $NUM_PIDS
+ PIDS=$(cat /sys/fs/cgroup/systemd/$CGROUP/cgroup.procs)
+ NUM_PIDS=$(echo $PIDS | wc -w)
+ echo Android service PIDs remaining: $NUM_PIDS
+}
+
+# ============== main() ===============
+
+get_pids
+PREV_NUM_PIDS=$NUM_PIDS
+# This android property is supposed to ensure a shutdown if system-server crashes
+# We don't use it, but some init scripts watch for it as a signal to shut other things down
+/usr/bin/setprop sys.shutdown.requested 1
+
+echo Shutting down droid-hal-init services
+/usr/bin/setprop hybris.shutdown 1
+
+sleep 1
+WAIT=1
+get_pids
+MAX_WAIT=5
+while [ $NUM_PIDS -gt 0 -a $WAIT -lt $MAX_WAIT ]; do
+ if [ $NUM_PIDS -lt $PREV_NUM_PIDS ]; then
+ # Number of running processes is getting smaller
+ # Wait a little bit more
+ sleep 1
+ else
+ # Number of pids is not gettting smaller
+ break
+ fi
+ let WAIT=$WAIT+1
+ PREV_NUM_PIDS=$NUM_PIDS
+ get_pids
+done
+
+echo All done. Killing droid-hal-init
+killall droid-hal-init
+
+exit 0
+
|
[-]
[+]
|
Added |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/sparse/lib/systemd/system/bluetooth.service.wants/hcismd.service
^
|
+(symlink to ../hcismd.service)
|
[-]
[+]
|
Added |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/sparse/lib/systemd/system/hcismd.service
^
|
@@ -0,0 +1,23 @@
+[Unit]
+Description=Enable Bluetooth HCI over SMD
+After=dev-wcnss_ctrl.device
+Before=bluetooth.service
+Conflicts=shutdown.target actdead.target
+
+[Service]
+Environment=WCNSS_IS_READY=/sys/module/wcnsscore/parameters/wcnss_is_ready
+Environment=HCISMD_SET=/sys/module/hci_smd/parameters/hcismd_set
+
+Type=forking
+RemainAfterExit=yes
+ExecStartPre=/bin/sh -c "[ $(cat $WCNSS_IS_READY) -eq '1' ]"
+ExecStartPre=/bin/sh -c "echo 0 > $HCISMD_SET"
+ExecStart=/system/bin/hci_qcomm_init -e
+ExecStartPost=/bin/sh -c "echo 1 > $HCISMD_SET"
+ExecStop=/bin/sh -c "echo 0 > $HCISMD_SET"
+Restart=on-failure
+RestartSec=5
+StartLimitBurst=20
+
+[Install]
+WantedBy=bluetooth.service
|
[-]
[+]
|
Changed |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/sparse/lib/systemd/system/wlan-module-load.service
^
|
@@ -1,15 +1,19 @@
[Unit]
Description=Load wifi module
+After=dev-wcnss_wlan.device
Conflicts=shutdown.target actdead.target
[Service]
-Type=simple
+Environment=WCNSS_IS_READY=/sys/module/wcnsscore/parameters/wcnss_is_ready
+
+Type=forking
RemainAfterExit=yes
-ExecStartPre=/bin/sleep 5s
+ExecStartPre=/bin/sh -c "[ $(cat $WCNSS_IS_READY) -eq '1' ]"
ExecStart=/sbin/modprobe wlan
ExecStop=/sbin/modprobe -r wlan
Restart=on-failure
RestartSec=2
+StartLimitBurst=15
[Install]
WantedBy=basic.target
|
[-]
[+]
|
Added |
_service:tar_git:droid-config-ham-0.0.7.tar.bz2/sparse/lib/udev/rules.d/999-droid-wcnss.rules
^
|
@@ -0,0 +1,3 @@
+KERNEL=="wcnss_ctrl", SYMLINK="wcnss_ctrl", TAG+="systemd"
+KERNEL=="wcnss_wlan", SYMLINK="wcnss_wlan", TAG+="systemd"
+
|