diff --git a/board/raspberrypi/overlay/etc/init.d/S05cpufreq b/board/raspberrypi/overlay/etc/init.d/S05cpufreq index 82ae420f49..6a9ff9ce85 100755 --- a/board/raspberrypi/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi/overlay/etc/init.d/S05cpufreq @@ -1,18 +1,19 @@ #!/bin/bash +GOV="ondemand" +CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" +GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" + + test -n "$os_version" || source /etc/init.d/base -gov="ondemand" -cpufreqdir="/sys/devices/system/cpu/cpu0/cpufreq" -govdir="/sys/devices/system/cpu/cpufreq/$gov" - configure() { - echo $gov > $cpufreqdir/scaling_governor - if [[ $gov == "ondemand" ]]; then - echo 50 > $govdir/up_threshold - echo 100000 > $govdir/sampling_rate - echo 50 > $govdir/sampling_down_factor - echo 1 > $govdir/io_is_busy + echo $GOV > $CPUFREQDIR/scaling_governor + if [[ $GOV == "ondemand" ]]; then + echo 50 > $GOVDIR/up_threshold + echo 100000 > $GOVDIR/sampling_rate + echo 50 > $GOVDIR/sampling_down_factor + echo 1 > $GOVDIR/io_is_busy fi } diff --git a/board/raspberrypi/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi/overlay/etc/init.d/S11throttlewatch index a06374158c..116c3f30fc 100755 --- a/board/raspberrypi/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi/overlay/etc/init.d/S11throttlewatch @@ -1,6 +1,7 @@ #!/bin/bash -check_interval=30 +CHECK_INTERVAL=30 + test -n "$os_version" || source /etc/init.d/base @@ -25,7 +26,7 @@ watch_now() { logger -t throttlewatch -s "currently: $t" fi - sleep $check_interval + sleep $CHECK_INTERVAL done } @@ -37,7 +38,7 @@ watch_since_boot() { break fi - sleep $check_interval + sleep $CHECK_INTERVAL done } diff --git a/board/raspberrypi/overlay/etc/init.d/S13btuart b/board/raspberrypi/overlay/etc/init.d/S13btuart index f5d51a4148..27a92d3e3f 100755 --- a/board/raspberrypi/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi/overlay/etc/init.d/S13btuart @@ -1,10 +1,11 @@ #!/bin/bash -sys_conf="/etc/bluetooth.conf" -boot_conf="/boot/bluetooth.conf" -conf="/data/etc/bluetooth.conf" +SYS_CONF="/etc/bluetooth.conf" +BOOT_CONF="/boot/bluetooth.conf" +CONF="/data/etc/bluetooth.conf" -test -f $conf || test -f $boot_conf || test -f $sys_conf || exit 0 + +test -f $CONF || test -f $BOOT_CONF || test -f $SYS_CONF || exit 0 test -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" || exit 0 # no rpi bluetooth detected diff --git a/board/raspberrypi2/overlay/etc/init.d/S05cpufreq b/board/raspberrypi2/overlay/etc/init.d/S05cpufreq index 82ae420f49..6a9ff9ce85 100755 --- a/board/raspberrypi2/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi2/overlay/etc/init.d/S05cpufreq @@ -1,18 +1,19 @@ #!/bin/bash +GOV="ondemand" +CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" +GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" + + test -n "$os_version" || source /etc/init.d/base -gov="ondemand" -cpufreqdir="/sys/devices/system/cpu/cpu0/cpufreq" -govdir="/sys/devices/system/cpu/cpufreq/$gov" - configure() { - echo $gov > $cpufreqdir/scaling_governor - if [[ $gov == "ondemand" ]]; then - echo 50 > $govdir/up_threshold - echo 100000 > $govdir/sampling_rate - echo 50 > $govdir/sampling_down_factor - echo 1 > $govdir/io_is_busy + echo $GOV > $CPUFREQDIR/scaling_governor + if [[ $GOV == "ondemand" ]]; then + echo 50 > $GOVDIR/up_threshold + echo 100000 > $GOVDIR/sampling_rate + echo 50 > $GOVDIR/sampling_down_factor + echo 1 > $GOVDIR/io_is_busy fi } diff --git a/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch index a06374158c..116c3f30fc 100755 --- a/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch @@ -1,6 +1,7 @@ #!/bin/bash -check_interval=30 +CHECK_INTERVAL=30 + test -n "$os_version" || source /etc/init.d/base @@ -25,7 +26,7 @@ watch_now() { logger -t throttlewatch -s "currently: $t" fi - sleep $check_interval + sleep $CHECK_INTERVAL done } @@ -37,7 +38,7 @@ watch_since_boot() { break fi - sleep $check_interval + sleep $CHECK_INTERVAL done } diff --git a/board/raspberrypi3/overlay/etc/init.d/S05cpufreq b/board/raspberrypi3/overlay/etc/init.d/S05cpufreq index 82ae420f49..6a9ff9ce85 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi3/overlay/etc/init.d/S05cpufreq @@ -1,18 +1,19 @@ #!/bin/bash +GOV="ondemand" +CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" +GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" + + test -n "$os_version" || source /etc/init.d/base -gov="ondemand" -cpufreqdir="/sys/devices/system/cpu/cpu0/cpufreq" -govdir="/sys/devices/system/cpu/cpufreq/$gov" - configure() { - echo $gov > $cpufreqdir/scaling_governor - if [[ $gov == "ondemand" ]]; then - echo 50 > $govdir/up_threshold - echo 100000 > $govdir/sampling_rate - echo 50 > $govdir/sampling_down_factor - echo 1 > $govdir/io_is_busy + echo $GOV > $CPUFREQDIR/scaling_governor + if [[ $GOV == "ondemand" ]]; then + echo 50 > $GOVDIR/up_threshold + echo 100000 > $GOVDIR/sampling_rate + echo 50 > $GOVDIR/sampling_down_factor + echo 1 > $GOVDIR/io_is_busy fi } diff --git a/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch index a06374158c..116c3f30fc 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch @@ -1,6 +1,7 @@ #!/bin/bash -check_interval=30 +CHECK_INTERVAL=30 + test -n "$os_version" || source /etc/init.d/base @@ -25,7 +26,7 @@ watch_now() { logger -t throttlewatch -s "currently: $t" fi - sleep $check_interval + sleep $CHECK_INTERVAL done } @@ -37,7 +38,7 @@ watch_since_boot() { break fi - sleep $check_interval + sleep $CHECK_INTERVAL done } diff --git a/board/raspberrypi3/overlay/etc/init.d/S13btuart b/board/raspberrypi3/overlay/etc/init.d/S13btuart index 513842ba6a..27a92d3e3f 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi3/overlay/etc/init.d/S13btuart @@ -1,10 +1,13 @@ #!/bin/bash -sys_conf="/etc/bluetooth.conf" -boot_conf="/boot/bluetooth.conf" -conf="/data/etc/bluetooth.conf" +SYS_CONF="/etc/bluetooth.conf" +BOOT_CONF="/boot/bluetooth.conf" +CONF="/data/etc/bluetooth.conf" -test -f $conf || test -f $boot_conf || test -f $sys_conf || exit 0 + +test -f $CONF || test -f $BOOT_CONF || test -f $SYS_CONF || exit 0 + +test -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" || exit 0 # no rpi bluetooth detected test -n "$os_version" || source /etc/init.d/base