Skip to content

Commit fb1d76a

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

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

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: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then
157157
'BORDER_ROUTING=1'
158158
'NAT64=1'
159159
'DNS64=1'
160-
'DHCPV6_PD_REF=1'
161160
"OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\""
162161
)
163162
build_options+=("${LOCAL_OPTIONS[@]}")
@@ -167,7 +166,6 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then
167166
'BORDER_ROUTING=1'
168167
'NAT64=1'
169168
'DNS64=1'
170-
'DHCPV6_PD_REF=1'
171169
"OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]}\""
172170
)
173171
build_options+=("${LOCAL_OPTIONS[@]}")
@@ -178,9 +176,9 @@ fi
178176
configure_apt_source()
179177
{
180178
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
179+
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi
180+
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ bookworm main non-free contrib rpi' | sudo tee /etc/apt/sources.list
181+
echo 'deb http://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ bookworm main ui' | sudo tee /etc/apt/sources.list.d/raspi.list
184182
fi
185183
}
186184
configure_apt_source
@@ -189,38 +187,44 @@ echo "127.0.0.1 $(hostname)" >>/etc/hosts
189187
chown -R pi:pi /home/pi/repo
190188
cd /home/pi/repo/ot-br-posix
191189
apt-get update
192-
apt-get install -y --no-install-recommends git python3-pip
190+
apt-get install -y --no-install-recommends git python3-pip python3-venv
193191
su -c "DOCKER=1 ${build_options[*]} script/bootstrap" pi
194192

195193
rm -rf /home/pi/repo/ot-br-posix/third_party/openthread/repo
196194
cp -rp /home/pi/repo/openthread /home/pi/repo/ot-br-posix/third_party/openthread/repo
197195

198196
apt-get purge -y cmake
197+
198+
python3 -m venv /home/pi/.python3_venv
199+
source /home/pi/.python3_venv/bin/activate
200+
199201
pip3 install scikit-build
200202
pip3 install cmake==3.20.2
201203
cmake --version
202204

203205
pip3 install zeroconf
204-
205-
apt-get install -y --no-install-recommends libgirepository1.0-dev
206-
pip3 install dbus-python PyGObject
206+
apt-get install -y --no-install-recommends python3-gi python3-dbus
207207

208208
su -c "${build_options[*]} script/setup" pi
209209

210-
if [[ "$REFERENCE_RELEASE_TYPE" = "1.2" || "$REFERENCE_RELEASE_TYPE" = "1.3" || "$REFERENCE_RELEASE_TYPE" = "1.4" ]]; then
210+
if [[ $REFERENCE_RELEASE_TYPE == "1.2" || $REFERENCE_RELEASE_TYPE == "1.3" || $REFERENCE_RELEASE_TYPE == "1.4" ]]; then
211211
cd /home/pi/repo/
212212
./script/make-commissioner.bash
213213
fi
214214

215215
# nRF Connect SDK related actions
216216
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
217+
apt-get install -y --no-install-recommends vim
218+
219+
wget https://project-downloads.drogon.net/wiringpi-latest.deb
220+
sudo dpkg -i wiringpi-latest.deb
221+
222+
pip3 install wrapt==1.12.1
223+
pip3 install nrfutil
222224

223225
# add calling of link_dongle.py script at startup to update symlink to the dongle
226+
sudo touch /etc/rc.local
227+
sudo chmod +x /etc/rc.local
224228
sed -i '/exit 0/d' /etc/rc.local
225229
grep -qxF 'sudo systemctl restart otbr-agent.service' /etc/rc.local || echo 'sudo systemctl restart otbr-agent.service' >>/etc/rc.local
226230
echo 'exit 0' >>/etc/rc.local
@@ -237,4 +241,5 @@ elif [ "${REFERENCE_PLATFORM?}" = "efr32mg12" ]; then
237241
sed -i "s/OpenThread_BR/OTS${REFERENCE_RELEASE_TYPE//./}_BR/g" /usr/sbin/testharness-discovery
238242
fi
239243

244+
deactivate # deactivate the virtual python environment /home/pi/.python3_venv
240245
sync

0 commit comments

Comments
 (0)