From fd12ec83cb75f1c95d234f047d5629681249c160 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 12 Sep 2019 21:55:32 +0300 Subject: [PATCH] Raspberry Pi (all): S13btuart: exit on empty bluetooth.conf --- board/raspberrypi/overlay/etc/init.d/S13btuart | 4 ++++ board/raspberrypi3/overlay/etc/init.d/S13btuart | 4 ++++ board/raspberrypi4/overlay/etc/init.d/S13btuart | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/board/raspberrypi/overlay/etc/init.d/S13btuart b/board/raspberrypi/overlay/etc/init.d/S13btuart index aa2d0f431e..d0090f6612 100755 --- a/board/raspberrypi/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi/overlay/etc/init.d/S13btuart @@ -13,6 +13,10 @@ if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then exit 0 # no rpi bluetooth detected fi +if [[ -f ${CONF} ]] && ! [[ -s ${CONF} ]]; then + exit 0 # bluetooth explicitly disabled by empty bluetooth.conf +fi + test -n "${OS_VERSION}" || source /etc/init.d/base function start() { diff --git a/board/raspberrypi3/overlay/etc/init.d/S13btuart b/board/raspberrypi3/overlay/etc/init.d/S13btuart index aa2d0f431e..d0090f6612 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi3/overlay/etc/init.d/S13btuart @@ -13,6 +13,10 @@ if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then exit 0 # no rpi bluetooth detected fi +if [[ -f ${CONF} ]] && ! [[ -s ${CONF} ]]; then + exit 0 # bluetooth explicitly disabled by empty bluetooth.conf +fi + test -n "${OS_VERSION}" || source /etc/init.d/base function start() { diff --git a/board/raspberrypi4/overlay/etc/init.d/S13btuart b/board/raspberrypi4/overlay/etc/init.d/S13btuart index aa2d0f431e..d0090f6612 100755 --- a/board/raspberrypi4/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi4/overlay/etc/init.d/S13btuart @@ -13,6 +13,10 @@ if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then exit 0 # no rpi bluetooth detected fi +if [[ -f ${CONF} ]] && ! [[ -s ${CONF} ]]; then + exit 0 # bluetooth explicitly disabled by empty bluetooth.conf +fi + test -n "${OS_VERSION}" || source /etc/init.d/base function start() {