Skip to content

Commit 6e71980

Browse files
committed
Update the Rasbian image to Debian 12 Bookworm to support Raspi 5
1 parent 57722d0 commit 6e71980

3 files changed

Lines changed: 19 additions & 16 deletions

File tree

script/make-commissioner.bash

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,13 @@ set -euxo pipefail
3131

3232
cd ot-commissioner
3333

34-
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
35-
sudo python2 get-pip.py
36-
37-
pip2 install -r tools/commissioner_thci/requirements.txt
34+
pip3 install -r tools/commissioner_thci/requirements.txt
3835
./script/bootstrap.sh || true
3936

4037
mkdir -p build
4138
cd build
4239

43-
/usr/local/bin/cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON ..
40+
cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON ..
4441
ninja -j10
4542
ninja install
4643

script/make-raspbian.bash

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,17 @@ main()
8888
[ -d "$IMAGES_DIR" ] || mkdir -p "$IMAGES_DIR"
8989

9090
# Download raspios image
91-
RASPIOS_URL=https://downloads.raspberrypi.org/raspios_lite_armhf/images/raspios_lite_armhf-2021-05-28/2021-05-07-raspios-buster-armhf-lite.zip
91+
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
9292
IMAGE_ARCHIVE=$(basename "${RASPIOS_URL}")
93-
IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .zip).img
9493
wget -q -O "$IMAGES_DIR/$IMAGE_ARCHIVE" -c "$RASPIOS_URL"
9594

9695
# Extract the downloaded archive
9796
mime_type=$(file "$IMAGES_DIR/$IMAGE_ARCHIVE" --mime-type)
9897
if [[ $mime_type == *"application/zip"* ]]; then
98+
IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .zip).img
9999
unzip -o "$IMAGES_DIR/$IMAGE_ARCHIVE" -d $IMAGES_DIR
100100
elif [[ $mime_type == *"application/"* ]]; then
101+
IMAGE_FILE=$(basename "${IMAGE_ARCHIVE}" .xz)
101102
xz -f -k -d "$IMAGES_DIR/$IMAGE_ARCHIVE"
102103
else
103104
echo "ERROR: Unrecognized archive type\n${mime_type}"

script/otbr-setup.bash

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ fi
178178
configure_apt_source()
179179
{
180180
if [ "$IN_CHINA" = 1 ]; then
181-
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi
182-
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main non-free contrib rpi' | sudo tee /etc/apt/sources.list
183-
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui' | sudo tee /etc/apt/sources.list.d/raspi.list
181+
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi
182+
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi' | sudo tee /etc/apt/sources.list
183+
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main ui' | sudo tee /etc/apt/sources.list.d/raspi.list
184184
fi
185185
}
186186
configure_apt_source
@@ -189,13 +189,16 @@ echo "127.0.0.1 $(hostname)" >>/etc/hosts
189189
chown -R pi:pi /home/pi/repo
190190
cd /home/pi/repo/ot-br-posix
191191
apt-get update
192-
apt-get install -y --no-install-recommends git python3-pip
192+
apt-get install -y --no-install-recommends git python3-pip python3-venv
193193
su -c "DOCKER=1 ${build_options[*]} script/bootstrap" pi
194194

195195
rm -rf /home/pi/repo/ot-br-posix/third_party/openthread/repo
196196
cp -rp /home/pi/repo/openthread /home/pi/repo/ot-br-posix/third_party/openthread/repo
197197

198198
apt-get purge -y cmake
199+
200+
python3 -m venv /home/pi/.venv
201+
source /home/pi/.venv/bin/activate
199202
pip3 install scikit-build
200203
pip3 install cmake==3.20.2
201204
cmake --version
@@ -214,11 +217,13 @@ fi
214217

215218
# nRF Connect SDK related actions
216219
if [ "${REFERENCE_PLATFORM?}" = "ncs" ]; then
217-
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
218-
sudo python2 get-pip.py
219-
apt-get install -y --no-install-recommends vim wiringpi
220-
pip install wrapt==1.12.1
221-
pip install nrfutil
220+
apt-get install -y --no-install-recommends vim
221+
222+
wget https://project-downloads.drogon.net/wiringpi-latest.deb
223+
sudo dpkg -i wiringpi-latest.deb
224+
225+
pip3 install wrapt==1.12.1
226+
pip3 install nrfutil
222227

223228
# add calling of link_dongle.py script at startup to update symlink to the dongle
224229
sed -i '/exit 0/d' /etc/rc.local

0 commit comments

Comments
 (0)