diff --git a/board/common/overlay/etc/init.d/S37bluetooth b/board/common/overlay/etc/init.d/S37bluetooth index 3d82b6dfc0..647e921e17 100755 --- a/board/common/overlay/etc/init.d/S37bluetooth +++ b/board/common/overlay/etc/init.d/S37bluetooth @@ -10,6 +10,7 @@ PROG="/usr/libexec/bluetooth/bluetoothd" PROG_HC="/usr/bin/hciconfig" DATA_DIR="/var/lib/bluetooth" RUN_DATA_DIR="/data/bluetooth" +NO_ON_BOARD_BT="/tmp/.no_on_board_bt" # used by RPi to explicitly indicate that no on-board BT was detected test -x ${PROG} || exit 0 @@ -40,14 +41,16 @@ start() { # wait up to 10 seconds for device count=0 while ! ${PROG_HC} ${ADAPTER} &>/dev/null; do - sleep 1 - count=$((${count} + 1)) - if [[ ${count} -ge 10 ]]; then + # on RPi boards, the absence of an on-board BT can be detected earlier, preventing 10s timeout + + count=$((count + 1)) + if [[ ${count} -ge 10 ]] || [[ -f "${NO_ON_BOARD_BT}" ]]; then msg_fail "no device" - logger -t bluetooth "bluetooth device not available, calling panic action" - panic_action bluetooth - return 1 + logger -t bluetooth "bluetooth device not available" + return 0 fi + + sleep 1 done if configure; then diff --git a/board/common/overlay/etc/init.d/S50date b/board/common/overlay/etc/init.d/S50date index b8de6a29c3..ec434993d6 100755 --- a/board/common/overlay/etc/init.d/S50date +++ b/board/common/overlay/etc/init.d/S50date @@ -2,7 +2,8 @@ PROG_DATE="/bin/date" PROG_NTPD="/usr/sbin/ntpd" -PROG_NTPDATE="/usr/bin/ntpdate" +PROG_SNTP="/usr/bin/sntp" +LOG_SNTP="/var/log/sntp.log" SYS_CONF="/etc/date.conf" BOOT_CONF="/boot/date.conf" @@ -23,7 +24,7 @@ test -s ${CONF} || exit 0 test "${OS_NETWORKLESS}" == "true" && exit 0 DATE_TIMEOUT=10 -DATE_METHOD=http +DATE_METHOD=sntp DATE_HOST="google.com" DATE_INTERVAL="900" DATE_NTP_SERVER="" @@ -32,7 +33,9 @@ source ${CONF} set_current_date_http() { - date_str=$(curl -v -s -m ${DATE_TIMEOUT} -X GET http://${DATE_HOST} 2>&1 | grep Date | sed -e 's/< Date: //') + curl_args="-v -s -m ${DATE_TIMEOUT} -H \"Cache-Control: no-cache\" -X GET" + url="http://${DATE_HOST}?_=${RANDOM}" + date_str=$(curl ${curl_args} ${url} 2>&1 | grep Date | sed -e 's/< Date: //') if [[ -n "${date_str}" ]]; then ${PROG_DATE} -u -D "%a, %d %b %Y %H:%M:%S" -s "${date_str}" > /dev/null logger -t date "current system date/time set to $(date) via HTTP" @@ -44,7 +47,7 @@ set_current_date_http() { } set_current_date_ntp() { - cat ${NTP_CONF} | grep server | head -n 1 | cut -d ' ' -f 2 | xargs ${PROG_NTPDATE} -t ${DATE_TIMEOUT} -s + ${PROG_NTPD} -gq &>/dev/null if [[ $? == 0 ]]; then logger -t date "current system date/time set to $(date) via NTP" return 0 @@ -54,8 +57,22 @@ set_current_date_ntp() { fi } +set_current_date_sntp() { + sntp_args="-t ${DATE_TIMEOUT} -K /var/lib/ntp/kod -Ss" + server=$(cat ${NTP_CONF} | grep server | head -n 1 | cut -d ' ' -f 2) + ${PROG_SNTP} ${sntp_args} ${server} &>${LOG_SNTP} + if [[ $? == 0 ]]; then + logger -t date "current system date/time set to $(date) via SNTP" + return 0 + else + logger -t date "failed to set current system date/time via SNTP" + return 1 + fi +} + + start_http() { - msg_begin "Setting current date using http" + msg_begin "Setting current date using HTTP" if set_current_date_http; then sleep_interval=${DATE_INTERVAL} msg_done "$(${PROG_DATE})" @@ -78,6 +95,7 @@ start_http() { start_ntp() { mkdir -p /var/lib/ntp + touch /var/lib/ntp/kod cat ${NTP_CONF} | grep -v iburst > ${NTP_CONF}.tmp @@ -90,9 +108,15 @@ start_ntp() { cat ${NTP_CONF}.tmp >> ${NTP_CONF} rm ${NTP_CONF}.tmp - msg_begin "Setting current date using ntp" - set_current_date_ntp || set_current_date_ntp - test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail + if [[ "${DATE_METHOD}" == "sntp" ]]; then + msg_begin "Setting current date using SNTP" + set_current_date_sntp + test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail + else # assuming ntp + msg_begin "Setting current date using NTP" + set_current_date_ntp || set_current_date_ntp + test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail + fi msg_begin "Starting ntpd" ${PROG_NTPD} -g -c ${NTP_CONF} @@ -101,7 +125,7 @@ start_ntp() { stop_http() { msg_begin "Stopping date updater" - ps | grep S60date | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill + ps | grep S50date | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill test $? == 0 && msg_done || msg_fail } @@ -114,7 +138,7 @@ stop_ntp() { start() { if [[ "${DATE_METHOD}" == "http" ]]; then start_http - else + else # ntp or sntp start_ntp fi @@ -124,7 +148,7 @@ start() { stop() { if [[ "${DATE_METHOD}" == "http" ]]; then stop_http - else + else # ntp or sntp stop_ntp fi } @@ -149,4 +173,3 @@ case "$1" in esac exit $? - diff --git a/board/common/overlay/etc/init.d/mountsys b/board/common/overlay/etc/init.d/mountsys index 1963d2f2a3..d61d249ce7 100755 --- a/board/common/overlay/etc/init.d/mountsys +++ b/board/common/overlay/etc/init.d/mountsys @@ -3,8 +3,4 @@ /bin/mkdir -p /dev/pts /bin/mkdir -p /dev/shm /bin/mount --make-shared / -/bin/mount -T /etc/fstab.sys -a -t proc -/bin/mount -T /etc/fstab.sys -a -t devpts -/bin/mount -T /etc/fstab.sys -a -t tmpfs -/bin/mount -T /etc/fstab.sys -a -t sysfs - +/bin/mount -T /etc/fstab.sys -a diff --git a/board/common/overlay/sbin/fwupdate b/board/common/overlay/sbin/fwupdate index 19c8b53ca8..78dd4c58ca 100755 --- a/board/common/overlay/sbin/fwupdate +++ b/board/common/overlay/sbin/fwupdate @@ -530,11 +530,6 @@ function new_version() { cat ${VER_FILE} } -function backup_conf() { - echo "backing up /data/etc..." - tar -acf /boot/backup-etc-${OS_VERSION}.tar.gz -C /data etc -} - function show_status() { status=$(flash_boot_status) if [[ "${status}" == "running" ]]; then diff --git a/board/raspberrypi/cleanups.sh b/board/raspberrypi/cleanups.sh index 81f8694b8a..23ad8b8387 100755 --- a/board/raspberrypi/cleanups.sh +++ b/board/raspberrypi/cleanups.sh @@ -2,4 +2,4 @@ rm -rf ${TARGET}/opt/vc/src rm -rf ${TARGET}/opt/vc/include - +rm -rf ${TARGET}/usr/bin/dtoverlay-* diff --git a/board/raspberrypi/overlay/etc/fstab.sys b/board/raspberrypi/overlay/etc/fstab.sys new file mode 100644 index 0000000000..acc6225063 --- /dev/null +++ b/board/raspberrypi/overlay/etc/fstab.sys @@ -0,0 +1,7 @@ +# +proc /proc proc defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /dev/shm tmpfs mode=0777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +sysfs /sys sysfs defaults 0 0 +configfs /sys/kernel/config configfs defaults 0 0 diff --git a/board/raspberrypi/overlay/etc/init.d/S07dtoverlays b/board/raspberrypi/overlay/etc/init.d/S07dtoverlays new file mode 100755 index 0000000000..9b67103d53 --- /dev/null +++ b/board/raspberrypi/overlay/etc/init.d/S07dtoverlays @@ -0,0 +1,41 @@ +#!/bin/bash + +SYS_DTOVERLAYS_FILE="/etc/dtoverlays" +BOOT_DTOVERLAYS_FILE="/boot/dtoverlays" +DTOVERLAYS_FILE="/data/etc/dtoverlays" + +PROG="/usr/bin/dtoverlay" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +case "$1" in + start) + msg_begin "Loading device-tree overlays" + + if [[ -r ${SYS_DTOVERLAYS_FILE} ]]; then + cat ${SYS_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${BOOT_DTOVERLAYS_FILE} ]]; then + cat ${BOOT_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${DTOVERLAYS_FILE} ]]; then + cat ${DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + msg_done + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? + diff --git a/board/raspberrypi/overlay/etc/init.d/S13btuart b/board/raspberrypi/overlay/etc/init.d/S13btuart index 0ad4deda81..d0090f6612 100755 --- a/board/raspberrypi/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi/overlay/etc/init.d/S13btuart @@ -3,44 +3,50 @@ SYS_CONF="/etc/bluetooth.conf" BOOT_CONF="/boot/bluetooth.conf" CONF="/data/etc/bluetooth.conf" +NO_ON_BOARD_BT="/tmp/.no_on_board_bt" # used by RPi to explicitly indicate that no on-board BT was detected 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 +if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then + touch ${NO_ON_BOARD_BT} + 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() { if [[ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ]] ; then - if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = " 16" ]] ; then - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null + if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = "16" ]]; then + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null fi else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null fi } case "$1" in start) - msg_begin "Attaching UART bluetooth modem" - # for some reason, sometimes the hciattach command needs to be run twice - (start || start) &>/dev/null & + msg_begin "Attaching UART bluetooth device" + start &>/dev/null & msg_background ;; stop) - msg_begin "Detaching UART bluetooth modem" + msg_begin "Detaching UART bluetooth device" killall hciattach &>/dev/null test $? == 0 && msg_done || msg_fail ;; *) - echo $"Usage: $0 {start}" + echo $"Usage: $0 {start|stop}" exit 1 esac exit $? - diff --git a/board/raspberrypi/postscript.sh b/board/raspberrypi/postscript.sh index 077520008b..ee8141625b 100755 --- a/board/raspberrypi/postscript.sh +++ b/board/raspberrypi/postscript.sh @@ -17,3 +17,6 @@ cp ${RPI_FW_DIR}/bootcode.bin ${BOOT_DIR} cp ${RPI_FW_DIR}/start.elf ${BOOT_DIR} cp ${RPI_FW_DIR}/fixup.dat ${BOOT_DIR} +# copy overlays +mkdir -p ${BOOT_DIR}/overlays +cp ${RPI_FW_DIR}/overlays/*.dtbo ${BOOT_DIR}/overlays diff --git a/board/raspberrypi2/overlay/etc/fstab.sys b/board/raspberrypi2/overlay/etc/fstab.sys new file mode 100644 index 0000000000..acc6225063 --- /dev/null +++ b/board/raspberrypi2/overlay/etc/fstab.sys @@ -0,0 +1,7 @@ +# +proc /proc proc defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /dev/shm tmpfs mode=0777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +sysfs /sys sysfs defaults 0 0 +configfs /sys/kernel/config configfs defaults 0 0 diff --git a/board/raspberrypi2/overlay/etc/init.d/S07dtoverlays b/board/raspberrypi2/overlay/etc/init.d/S07dtoverlays new file mode 100755 index 0000000000..9b67103d53 --- /dev/null +++ b/board/raspberrypi2/overlay/etc/init.d/S07dtoverlays @@ -0,0 +1,41 @@ +#!/bin/bash + +SYS_DTOVERLAYS_FILE="/etc/dtoverlays" +BOOT_DTOVERLAYS_FILE="/boot/dtoverlays" +DTOVERLAYS_FILE="/data/etc/dtoverlays" + +PROG="/usr/bin/dtoverlay" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +case "$1" in + start) + msg_begin "Loading device-tree overlays" + + if [[ -r ${SYS_DTOVERLAYS_FILE} ]]; then + cat ${SYS_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${BOOT_DTOVERLAYS_FILE} ]]; then + cat ${BOOT_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${DTOVERLAYS_FILE} ]]; then + cat ${DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + msg_done + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? + diff --git a/board/raspberrypi2/postscript.sh b/board/raspberrypi2/postscript.sh index bfe0f440ae..be1e661160 100755 --- a/board/raspberrypi2/postscript.sh +++ b/board/raspberrypi2/postscript.sh @@ -14,3 +14,6 @@ cp ${RPI_FW_DIR}/bootcode.bin ${BOOT_DIR} cp ${RPI_FW_DIR}/start.elf ${BOOT_DIR} cp ${RPI_FW_DIR}/fixup.dat ${BOOT_DIR} +# copy overlays +mkdir -p ${BOOT_DIR}/overlays +cp ${RPI_FW_DIR}/overlays/*.dtbo ${BOOT_DIR}/overlays diff --git a/board/raspberrypi3/overlay/etc/fstab.sys b/board/raspberrypi3/overlay/etc/fstab.sys new file mode 100644 index 0000000000..acc6225063 --- /dev/null +++ b/board/raspberrypi3/overlay/etc/fstab.sys @@ -0,0 +1,7 @@ +# +proc /proc proc defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /dev/shm tmpfs mode=0777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +sysfs /sys sysfs defaults 0 0 +configfs /sys/kernel/config configfs defaults 0 0 diff --git a/board/raspberrypi3/overlay/etc/init.d/S07dtoverlays b/board/raspberrypi3/overlay/etc/init.d/S07dtoverlays new file mode 100755 index 0000000000..9b67103d53 --- /dev/null +++ b/board/raspberrypi3/overlay/etc/init.d/S07dtoverlays @@ -0,0 +1,41 @@ +#!/bin/bash + +SYS_DTOVERLAYS_FILE="/etc/dtoverlays" +BOOT_DTOVERLAYS_FILE="/boot/dtoverlays" +DTOVERLAYS_FILE="/data/etc/dtoverlays" + +PROG="/usr/bin/dtoverlay" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +case "$1" in + start) + msg_begin "Loading device-tree overlays" + + if [[ -r ${SYS_DTOVERLAYS_FILE} ]]; then + cat ${SYS_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${BOOT_DTOVERLAYS_FILE} ]]; then + cat ${BOOT_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${DTOVERLAYS_FILE} ]]; then + cat ${DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + msg_done + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? + diff --git a/board/raspberrypi3/overlay/etc/init.d/S13btuart b/board/raspberrypi3/overlay/etc/init.d/S13btuart index 0ad4deda81..d0090f6612 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi3/overlay/etc/init.d/S13btuart @@ -3,44 +3,50 @@ SYS_CONF="/etc/bluetooth.conf" BOOT_CONF="/boot/bluetooth.conf" CONF="/data/etc/bluetooth.conf" +NO_ON_BOARD_BT="/tmp/.no_on_board_bt" # used by RPi to explicitly indicate that no on-board BT was detected 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 +if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then + touch ${NO_ON_BOARD_BT} + 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() { if [[ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ]] ; then - if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = " 16" ]] ; then - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null + if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = "16" ]]; then + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null fi else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null fi } case "$1" in start) - msg_begin "Attaching UART bluetooth modem" - # for some reason, sometimes the hciattach command needs to be run twice - (start || start) &>/dev/null & + msg_begin "Attaching UART bluetooth device" + start &>/dev/null & msg_background ;; stop) - msg_begin "Detaching UART bluetooth modem" + msg_begin "Detaching UART bluetooth device" killall hciattach &>/dev/null test $? == 0 && msg_done || msg_fail ;; *) - echo $"Usage: $0 {start}" + echo $"Usage: $0 {start|stop}" exit 1 esac exit $? - diff --git a/board/raspberrypi3/postscript.sh b/board/raspberrypi3/postscript.sh index 9469f74a7f..c8f90025a4 100755 --- a/board/raspberrypi3/postscript.sh +++ b/board/raspberrypi3/postscript.sh @@ -16,3 +16,6 @@ cp ${RPI_FW_DIR}/bootcode.bin ${BOOT_DIR} cp ${RPI_FW_DIR}/start.elf ${BOOT_DIR} cp ${RPI_FW_DIR}/fixup.dat ${BOOT_DIR} +# copy overlays +mkdir -p ${BOOT_DIR}/overlays +cp ${RPI_FW_DIR}/overlays/*.dtbo ${BOOT_DIR}/overlays diff --git a/board/raspberrypi4/overlay/etc/fstab.sys b/board/raspberrypi4/overlay/etc/fstab.sys new file mode 100644 index 0000000000..acc6225063 --- /dev/null +++ b/board/raspberrypi4/overlay/etc/fstab.sys @@ -0,0 +1,7 @@ +# +proc /proc proc defaults 0 0 +devpts /dev/pts devpts gid=5,mode=620 0 0 +tmpfs /dev/shm tmpfs mode=0777 0 0 +tmpfs /tmp tmpfs mode=1777 0 0 +sysfs /sys sysfs defaults 0 0 +configfs /sys/kernel/config configfs defaults 0 0 diff --git a/board/raspberrypi4/overlay/etc/init.d/S07dtoverlays b/board/raspberrypi4/overlay/etc/init.d/S07dtoverlays new file mode 100755 index 0000000000..9b67103d53 --- /dev/null +++ b/board/raspberrypi4/overlay/etc/init.d/S07dtoverlays @@ -0,0 +1,41 @@ +#!/bin/bash + +SYS_DTOVERLAYS_FILE="/etc/dtoverlays" +BOOT_DTOVERLAYS_FILE="/boot/dtoverlays" +DTOVERLAYS_FILE="/data/etc/dtoverlays" + +PROG="/usr/bin/dtoverlay" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +case "$1" in + start) + msg_begin "Loading device-tree overlays" + + if [[ -r ${SYS_DTOVERLAYS_FILE} ]]; then + cat ${SYS_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${BOOT_DTOVERLAYS_FILE} ]]; then + cat ${BOOT_DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + if [[ -r ${DTOVERLAYS_FILE} ]]; then + cat ${DTOVERLAYS_FILE} | while read line; do test -n "${line}" && ${PROG} ${line}; done + fi + + msg_done + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? + diff --git a/board/raspberrypi4/overlay/etc/init.d/S13btuart b/board/raspberrypi4/overlay/etc/init.d/S13btuart index 0ad4deda81..d0090f6612 100755 --- a/board/raspberrypi4/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi4/overlay/etc/init.d/S13btuart @@ -3,44 +3,50 @@ SYS_CONF="/etc/bluetooth.conf" BOOT_CONF="/boot/bluetooth.conf" CONF="/data/etc/bluetooth.conf" +NO_ON_BOARD_BT="/tmp/.no_on_board_bt" # used by RPi to explicitly indicate that no on-board BT was detected 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 +if ! [ -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" ]; then + touch ${NO_ON_BOARD_BT} + 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() { if [[ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ]] ; then - if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = " 16" ]] ; then - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null + if [[ "$(wc -c /proc/device-tree/soc/gpio@7e200000/uart0_pins/brcm\,pins | cut -f 1 -d ' ')" = "16" ]]; then + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 3000000 flow - &>/dev/null else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 921600 noflow - &>/dev/null fi else - /usr/bin/hciattach -t5 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null + /usr/bin/hciattach -t 10 /dev/serial1 bcm43xx 460800 noflow - &>/dev/null fi } case "$1" in start) - msg_begin "Attaching UART bluetooth modem" - # for some reason, sometimes the hciattach command needs to be run twice - (start || start) &>/dev/null & + msg_begin "Attaching UART bluetooth device" + start &>/dev/null & msg_background ;; stop) - msg_begin "Detaching UART bluetooth modem" + msg_begin "Detaching UART bluetooth device" killall hciattach &>/dev/null test $? == 0 && msg_done || msg_fail ;; *) - echo $"Usage: $0 {start}" + echo $"Usage: $0 {start|stop}" exit 1 esac exit $? - diff --git a/board/raspberrypi4/postscript.sh b/board/raspberrypi4/postscript.sh index 51e630b1d8..f2572d6296 100755 --- a/board/raspberrypi4/postscript.sh +++ b/board/raspberrypi4/postscript.sh @@ -12,3 +12,7 @@ cp ${IMG_DIR}/bcm2711-rpi-4-b.dtb ${BOOT_DIR} cp ${RPI_FW_DIR}/bootcode.bin ${BOOT_DIR} cp ${RPI_FW_DIR}/start4.elf ${BOOT_DIR} cp ${RPI_FW_DIR}/fixup4.dat ${BOOT_DIR} + +# copy overlays +mkdir -p ${BOOT_DIR}/overlays +cp ${RPI_FW_DIR}/overlays/*.dtbo ${BOOT_DIR}/overlays diff --git a/configs/bananapim1_defconfig b/configs/bananapim1_defconfig index 56e9170c70..3de74718b4 100644 --- a/configs/bananapim1_defconfig +++ b/configs/bananapim1_defconfig @@ -91,7 +91,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/nanopineo2_defconfig b/configs/nanopineo2_defconfig index b360f9c6af..11a25fe571 100644 --- a/configs/nanopineo2_defconfig +++ b/configs/nanopineo2_defconfig @@ -83,7 +83,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/nanopineo_defconfig b/configs/nanopineo_defconfig index 33d4586182..b29049d6a7 100644 --- a/configs/nanopineo_defconfig +++ b/configs/nanopineo_defconfig @@ -82,7 +82,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/odroidc1_defconfig b/configs/odroidc1_defconfig index 9cc19b5ab9..a48235d7f9 100644 --- a/configs/odroidc1_defconfig +++ b/configs/odroidc1_defconfig @@ -94,7 +94,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig index 8eab7d1f90..cdf1777e1e 100644 --- a/configs/odroidc2_defconfig +++ b/configs/odroidc2_defconfig @@ -83,7 +83,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/odroidxu4_defconfig b/configs/odroidxu4_defconfig index 2b0a175406..580b73102b 100644 --- a/configs/odroidxu4_defconfig +++ b/configs/odroidxu4_defconfig @@ -85,7 +85,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/orangepione_defconfig b/configs/orangepione_defconfig index 27773e19e3..b258645ceb 100644 --- a/configs/orangepione_defconfig +++ b/configs/orangepione_defconfig @@ -86,7 +86,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/orangepizero_defconfig b/configs/orangepizero_defconfig index 06bc6001d1..a3a0009f9e 100644 --- a/configs/orangepizero_defconfig +++ b/configs/orangepizero_defconfig @@ -86,7 +86,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/pine64_defconfig b/configs/pine64_defconfig index 50112cf0dd..21ba64fc9b 100644 --- a/configs/pine64_defconfig +++ b/configs/pine64_defconfig @@ -82,7 +82,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig index 91d2ff8653..f66e0ac74c 100644 --- a/configs/raspberrypi2_defconfig +++ b/configs/raspberrypi2_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi2/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/common/postscript.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/0b3be176533d99ffd13dc0a95793edbb67a1c238.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2709-rpi-2-b" @@ -114,7 +114,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig index 70f195d1fe..e8d0f25881 100644 --- a/configs/raspberrypi3_defconfig +++ b/configs/raspberrypi3_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi3/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/common/postscript.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/0b3be176533d99ffd13dc0a95793edbb67a1c238.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3" @@ -114,7 +114,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/raspberrypi4_defconfig b/configs/raspberrypi4_defconfig index 921a41b9fb..e52bf8d369 100644 --- a/configs/raspberrypi4_defconfig +++ b/configs/raspberrypi4_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi4/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/common/postscript.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/0b3be176533d99ffd13dc0a95793edbb67a1c238.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2711" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b" @@ -115,7 +115,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index a31aabfea8..b3fd3a09be 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -19,7 +19,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/common/postscript.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/0b3be176533d99ffd13dc0a95793edbb67a1c238.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-zero-w bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm" @@ -122,7 +122,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/configs/tinkerboard_defconfig b/configs/tinkerboard_defconfig index fd5dea641d..4ba890008c 100644 --- a/configs/tinkerboard_defconfig +++ b/configs/tinkerboard_defconfig @@ -86,7 +86,7 @@ BR2_PACKAGE_IW=y BR2_PACKAGE_NETCAT=y BR2_PACKAGE_NET_TOOLS=y BR2_PACKAGE_NTP=y -BR2_PACKAGE_NTP_NTPDATE=y +BR2_PACKAGE_NTP_SNTP=y BR2_PACKAGE_OPENSSH=y BR2_PACKAGE_PPPD=y BR2_PACKAGE_PROFTPD=y diff --git a/package/rpi-firmware/rpi-firmware.hash b/package/rpi-firmware/rpi-firmware.hash index d346fbd24d..713f912eb8 100644 --- a/package/rpi-firmware/rpi-firmware.hash +++ b/package/rpi-firmware/rpi-firmware.hash @@ -1 +1 @@ -sha256 b3a8bd532ca38f90e322be9fe4858a974e04ba8254248e416bf9e9ec5f176d95 rpi-firmware-66bafab005569e3eb92ec54cd3efeee3da338738.tar.gz +sha256 eec0287caa24b42d5460ed7c555e6871096ee7cfddd1582bf864930740095de1 rpi-firmware-01508e81ec1e918448227ca864616d56c430b46d.tar.gz diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index 465d606b91..ddb977676d 100644 --- a/package/rpi-firmware/rpi-firmware.mk +++ b/package/rpi-firmware/rpi-firmware.mk @@ -4,7 +4,7 @@ # ################################################################################ -RPI_FIRMWARE_VERSION = 66bafab005569e3eb92ec54cd3efeee3da338738 +RPI_FIRMWARE_VERSION = 01508e81ec1e918448227ca864616d56c430b46d RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk index 7d92158f0c..df32acb790 100644 --- a/package/rpi-userland/rpi-userland.mk +++ b/package/rpi-userland/rpi-userland.mk @@ -14,6 +14,13 @@ RPI_USERLAND_CONF_OPTS = -DVMCS_INSTALL_PREFIX=/usr \ RPI_USERLAND_PROVIDES = libegl libgles libopenmax libopenvg +define RPI_USERLAND_INSTALL_LIBFDT_TARGET + $(INSTALL) -m 0644 -D \ + $(@D)/build/lib/libfdt.so \ + $(TARGET_DIR)/usr/lib/libfdt.so +endef +RPI_USERLAND_POST_INSTALL_TARGET_HOOKS += RPI_USERLAND_INSTALL_LIBFDT_TARGET + ifeq ($(BR2_PACKAGE_RPI_USERLAND_HELLO),y) RPI_USERLAND_CONF_OPTS += -DALL_APPS=ON @@ -22,9 +29,6 @@ define RPI_USERLAND_EXTRA_LIBS_TARGET $(INSTALL) -m 0644 -D \ $(@D)/build/lib/libilclient.so \ $(TARGET_DIR)/usr/lib/libilclient.so - $(INSTALL) -m 0644 -D \ - $(@D)/build/lib/libfdt.so \ - $(TARGET_DIR)/usr/lib/libfdt.so endef RPI_USERLAND_POST_INSTALL_TARGET_HOOKS += RPI_USERLAND_EXTRA_LIBS_TARGET