Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the Rasbian image to Debian 12 Bookworm to support Raspi 5 #100

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions script/make-commissioner.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
Loading