From 5b1ec9be09cb0c83629bc801242a515053d6b1bd Mon Sep 17 00:00:00 2001 From: Yang Song Date: Mon, 8 Dec 2025 02:04:43 +0000 Subject: [PATCH] update the Raspbian to Debian 12 Bookworm to support Raspi 5 --- script/make-commissioner.bash | 2 +- script/make-firmware.bash | 2 +- script/make-raspbian.bash | 2 +- script/otbr-setup.bash | 30 +++++++++++++++++++++--------- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/script/make-commissioner.bash b/script/make-commissioner.bash index 3217740f..d6483d17 100755 --- a/script/make-commissioner.bash +++ b/script/make-commissioner.bash @@ -37,7 +37,7 @@ pip3 install -r tools/commissioner_thci/requirements.txt mkdir -p build cd build -/usr/local/bin/cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON .. +/usr/bin/cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON .. ninja -j10 ninja install diff --git a/script/make-firmware.bash b/script/make-firmware.bash index 3c64cd3b..eea7f5c9 100755 --- a/script/make-firmware.bash +++ b/script/make-firmware.bash @@ -284,7 +284,7 @@ deploy_ncs() local commit_hash commit_hash=$(<"${script_dir}"'/../config/ncs/sdk-nrf-commit') - pip3 install --user west + pip3 install west mkdir -p "${script_dir}"/../ncs cd "${script_dir}"/../ncs unset ZEPHYR_BASE diff --git a/script/make-raspbian.bash b/script/make-raspbian.bash index a612f6f2..97561f2e 100755 --- a/script/make-raspbian.bash +++ b/script/make-raspbian.bash @@ -88,7 +88,7 @@ main() [ -d "$IMAGES_DIR" ] || mkdir -p "$IMAGES_DIR" # Download raspios image - RASPIOS_URL=https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-05-28/2021-05-07-raspios-buster-armhf-lite.zip + RASPIOS_URL=https://downloads.raspberrypi.com/raspios_lite_armhf/images/raspios_lite_armhf-2025-05-13/2025-05-13-raspios-bookworm-armhf-lite.img.xz IMAGE_ARCHIVE=$(basename "${RASPIOS_URL}") wget -q -O "$IMAGES_DIR/$IMAGE_ARCHIVE" -c "$RASPIOS_URL" diff --git a/script/otbr-setup.bash b/script/otbr-setup.bash index 46dac453..44d25744 100755 --- a/script/otbr-setup.bash +++ b/script/otbr-setup.bash @@ -167,7 +167,8 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then 'BORDER_ROUTING=1' 'NAT64=1' 'DNS64=1' - 'OTBR_DHCP6_PD_CLIENT=dhcpcd' + 'SYSTEMD_NETWORKD=1' + 'OTBR_DHCP6_PD_CLIENT=openthread' 'OTBR_MDNS=openthread' ) case "${REFERENCE_PLATFORM}" in @@ -198,9 +199,9 @@ fi configure_apt_source() { if [ "$IN_CHINA" = 1 ]; then - echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi -deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi' | sudo tee /etc/apt/sources.list - echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui' | sudo tee /etc/apt/sources.list.d/raspi.list + echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi +deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi' | sudo tee /etc/apt/sources.list + echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main ui' | sudo tee /etc/apt/sources.list.d/raspi.list fi } configure_apt_source @@ -209,13 +210,17 @@ echo "127.0.0.1 $(hostname)" >>/etc/hosts chown -R pi:pi /home/pi/repo cd /home/pi/repo/ot-br-posix apt-get update -apt-get install -y --no-install-recommends git python3-pip +apt-get install -y --no-install-recommends git python3-full python3-pip sh -c "DOCKER=1 ${build_options[*]} script/bootstrap" rm -rf /home/pi/repo/ot-br-posix/third_party/openthread/repo cp -rp /home/pi/repo/openthread /home/pi/repo/ot-br-posix/third_party/openthread/repo apt-get purge -y cmake + +python3 -m venv /home/pi/.venv-otbr --system-site-packages +source /home/pi/.venv-otbr/bin/activate + pip3 install scikit-build pip3 install cmake==3.20.2 cmake --version @@ -224,7 +229,6 @@ pip3 install zeroconf apt-get install -y --no-install-recommends libgirepository1.0-dev pip3 install dbus-python==1.3.2 -pip3 install PyGObject sh -c "${build_options[*]} script/setup" @@ -238,11 +242,19 @@ esac # nRF Connect SDK related actions if [ "${REFERENCE_PLATFORM?}" = "ncs" ]; then pip3 install -r /home/pi/repo/config/ncs/requirements-nrfutil.txt - pip3 install --no-dependencies nrfutil==6.0.1 - apt-get install -y --no-install-recommends vim wiringpi - pip3 install wrapt==1.12.1 + pip3 install --no-dependencies --ignore-requires-python nrfutil==6.0.1 + + apt-get install -y --no-install-recommends vim + + wget https://github.com/WiringPi/WiringPi/releases/download/3.16/wiringpi_3.16_armhf.deb + sudo dpkg -i ./wiringpi_3.16_armhf.deb # add calling of link_dongle.py script at startup to update symlink to the dongle + if [ ! -f /etc/rc.local ]; then + echo '#!/bin/sh -e' | sudo tee /etc/rc.local + echo 'exit 0' | sudo tee -a /etc/rc.local + sudo chmod +x /etc/rc.local + fi sed -i '/exit 0/d' /etc/rc.local grep -qxF 'sudo systemctl restart otbr-agent.service' /etc/rc.local || echo 'sudo systemctl restart otbr-agent.service' >>/etc/rc.local echo 'exit 0' >>/etc/rc.local