From 79db124278584d59b860111f8491a8ab525ceb56 Mon Sep 17 00:00:00 2001 From: Yang Song Date: Mon, 16 Dec 2024 01:56:07 +0000 Subject: [PATCH] Update the Rasbian image to Debian 12 Bookworm to support Raspi 5 --- script/make-commissioner.bash | 4 ---- script/make-raspbian.bash | 5 +++-- script/otbr-setup.bash | 11 +++++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/script/make-commissioner.bash b/script/make-commissioner.bash index d35ba60..fab1b7e 100755 --- a/script/make-commissioner.bash +++ b/script/make-commissioner.bash @@ -31,10 +31,6 @@ set -euxo pipefail cd ot-commissioner -wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -sudo python2 get-pip.py - -pip2 install -r tools/commissioner_thci/requirements.txt ./script/bootstrap.sh || true mkdir -p build diff --git a/script/make-raspbian.bash b/script/make-raspbian.bash index 3aa7170..2bbd8ba 100755 --- a/script/make-raspbian.bash +++ b/script/make-raspbian.bash @@ -88,16 +88,17 @@ 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-2024-11-19/2024-11-19-raspios-bookworm-armhf-lite.img.xz IMAGE_ARCHIVE=$(basename "${RASPIOS_URL}") - IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .zip).img wget -q -O "$IMAGES_DIR/$IMAGE_ARCHIVE" -c "$RASPIOS_URL" # Extract the downloaded archive mime_type=$(file "$IMAGES_DIR/$IMAGE_ARCHIVE" --mime-type) if [[ $mime_type == *"application/zip"* ]]; then + IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .zip).img unzip -o "$IMAGES_DIR/$IMAGE_ARCHIVE" -d $IMAGES_DIR elif [[ $mime_type == *"application/"* ]]; then + IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .xz) xz -f -k -d "$IMAGES_DIR/$IMAGE_ARCHIVE" else echo "ERROR: Unrecognized archive type\n${mime_type}" diff --git a/script/otbr-setup.bash b/script/otbr-setup.bash index ac98d3d..de9ed8f 100755 --- a/script/otbr-setup.bash +++ b/script/otbr-setup.bash @@ -178,9 +178,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 @@ -189,13 +189,16 @@ 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-pip python3-venv su -c "DOCKER=1 ${build_options[*]} script/bootstrap" pi 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 +source /home/pi/.venv/bin/activate pip3 install scikit-build pip3 install cmake==3.20.2 cmake --version