Skip to content

Commit

Permalink
Update the Rasbian image to Debian 12 Bookworm to support Raspi 5
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsong-cnyn committed Dec 16, 2024
1 parent 57722d0 commit 5e2efd6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions script/make-commissioner.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ set -euxo pipefail

cd ot-commissioner

sudo apt-get install python2.7
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py

Expand Down
5 changes: 3 additions & 2 deletions script/make-raspbian.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down
11 changes: 7 additions & 4 deletions script/otbr-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5e2efd6

Please sign in to comment.