ccimx93: standby: check bluetooth-init service status
Check if the bluetooth-init service is running before going to suspend, just in case has stopped or disabled it on purpose. https://onedigi.atlassian.net/browse/DEL-8497 Signed-off-by: Isaac Hermida <isaac.hermida@digi.com>
This commit is contained in:
parent
7302fbc0df
commit
ea81fda3bf
|
|
@ -16,7 +16,7 @@
|
||||||
#
|
#
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
SUSPEND_WLAN_IFACES="/tmp/suspend_wlan_ifaces"
|
RESUME_ACTIONS="/tmp/resume_actions"
|
||||||
|
|
||||||
actions_needed() {
|
actions_needed() {
|
||||||
[ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ]
|
[ -d "/proc/device-tree/wireless" ] && [ ! -e "/sys/firmware/devicetree/base/soc@0/bus@42800000/mmc@428b0000/keep-power-in-suspend" ]
|
||||||
|
|
@ -27,32 +27,32 @@ if [ "${1}" = "pre" ]; then
|
||||||
systemctl stop NetworkManager
|
systemctl stop NetworkManager
|
||||||
|
|
||||||
if actions_needed; then
|
if actions_needed; then
|
||||||
rm -f "${SUSPEND_WLAN_IFACES}"
|
rm -f "${RESUME_ACTIONS}"
|
||||||
for iface in mlan0 uap0 wfd0; do
|
for iface in mlan0 uap0 wfd0; do
|
||||||
if grep -qs ${iface} /var/run/ifstate; then
|
if grep -qs ${iface} /var/run/ifstate; then
|
||||||
ifdown ${iface} && echo ${iface} >> "${SUSPEND_WLAN_IFACES}"
|
ifdown ${iface} && echo "ifup ${iface}" >> "${RESUME_ACTIONS}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
rmmod moal
|
rmmod moal
|
||||||
rmmod mlan
|
rmmod mlan
|
||||||
|
|
||||||
systemctl stop bluetooth
|
if systemctl is-active bluetooth-init; then
|
||||||
systemctl stop bluetooth-init
|
#
|
||||||
stty -F /dev/ttyBt 115200
|
# bluetooth service relies on bluetooth-init service, so stop/start it unconditionally
|
||||||
|
echo "systemctl start bluetooth-init" >> "${RESUME_ACTIONS}"
|
||||||
|
echo "systemctl start bluetooth" >> "${RESUME_ACTIONS}"
|
||||||
|
systemctl stop bluetooth-init
|
||||||
|
systemctl stop bluetooth
|
||||||
|
stty -F /dev/ttyBt 115200
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
elif [ "${1}" = "post" ]; then
|
elif [ "${1}" = "post" ]; then
|
||||||
if actions_needed; then
|
if actions_needed; then
|
||||||
/etc/udev/scripts/load_iw612.sh
|
/etc/udev/scripts/load_iw612.sh
|
||||||
sleep 0.5
|
sleep 0.5
|
||||||
|
sh "${RESUME_ACTIONS}"
|
||||||
while read -r iface; do
|
rm -f "${RESUME_ACTIONS}"
|
||||||
ifup "${iface}"
|
|
||||||
done < "${SUSPEND_WLAN_IFACES}"
|
|
||||||
rm -f "${SUSPEND_WLAN_IFACES}"
|
|
||||||
|
|
||||||
systemctl start bluetooth-init
|
|
||||||
systemctl start bluetooth
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Resume NetworkManager after suspend
|
# Resume NetworkManager after suspend
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue