mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-04-19 12:57:16 +00:00
Merge remote-tracking branch 'thingos/dev' into dev
This commit is contained in:
commit
502280244d
@ -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
|
||||
|
@ -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 $?
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -2,4 +2,4 @@
|
||||
|
||||
rm -rf ${TARGET}/opt/vc/src
|
||||
rm -rf ${TARGET}/opt/vc/include
|
||||
|
||||
rm -rf ${TARGET}/usr/bin/dtoverlay-*
|
||||
|
7
board/raspberrypi/overlay/etc/fstab.sys
Normal file
7
board/raspberrypi/overlay/etc/fstab.sys
Normal file
@ -0,0 +1,7 @@
|
||||
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||
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
|
41
board/raspberrypi/overlay/etc/init.d/S07dtoverlays
Executable file
41
board/raspberrypi/overlay/etc/init.d/S07dtoverlays
Executable file
@ -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 $?
|
||||
|
@ -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 $?
|
||||
|
||||
|
@ -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
|
||||
|
7
board/raspberrypi2/overlay/etc/fstab.sys
Normal file
7
board/raspberrypi2/overlay/etc/fstab.sys
Normal file
@ -0,0 +1,7 @@
|
||||
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||
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
|
41
board/raspberrypi2/overlay/etc/init.d/S07dtoverlays
Executable file
41
board/raspberrypi2/overlay/etc/init.d/S07dtoverlays
Executable file
@ -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 $?
|
||||
|
@ -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
|
||||
|
7
board/raspberrypi3/overlay/etc/fstab.sys
Normal file
7
board/raspberrypi3/overlay/etc/fstab.sys
Normal file
@ -0,0 +1,7 @@
|
||||
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||
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
|
41
board/raspberrypi3/overlay/etc/init.d/S07dtoverlays
Executable file
41
board/raspberrypi3/overlay/etc/init.d/S07dtoverlays
Executable file
@ -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 $?
|
||||
|
@ -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 $?
|
||||
|
||||
|
@ -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
|
||||
|
7
board/raspberrypi4/overlay/etc/fstab.sys
Normal file
7
board/raspberrypi4/overlay/etc/fstab.sys
Normal file
@ -0,0 +1,7 @@
|
||||
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||
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
|
41
board/raspberrypi4/overlay/etc/init.d/S07dtoverlays
Executable file
41
board/raspberrypi4/overlay/etc/init.d/S07dtoverlays
Executable file
@ -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 $?
|
||||
|
@ -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 $?
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -1 +1 @@
|
||||
sha256 b3a8bd532ca38f90e322be9fe4858a974e04ba8254248e416bf9e9ec5f176d95 rpi-firmware-66bafab005569e3eb92ec54cd3efeee3da338738.tar.gz
|
||||
sha256 eec0287caa24b42d5460ed7c555e6871096ee7cfddd1582bf864930740095de1 rpi-firmware-01508e81ec1e918448227ca864616d56c430b46d.tar.gz
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user