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 2 commits 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
7 changes: 2 additions & 5 deletions script/make-commissioner.bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ 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
pip3 install -r tools/commissioner_thci/requirements.txt
./script/bootstrap.sh || true

mkdir -p build
cd build

/usr/local/bin/cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON ..
cmake -GNinja -DCMAKE_INSTALL_PREFIX=/usr -DOT_COMM_REFERENCE_DEVICE=ON ..
ninja -j10
ninja install

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
33 changes: 19 additions & 14 deletions script/otbr-setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then
'BORDER_ROUTING=1'
'NAT64=1'
'DNS64=1'
'DHCPV6_PD_REF=1'
"OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]} -DOT_RCP_RESTORATION_MAX_COUNT=100 -DCMAKE_CXX_FLAGS='-DOPENTHREAD_CONFIG_MAC_CSL_REQUEST_AHEAD_US=5000'\""
)
build_options+=("${LOCAL_OPTIONS[@]}")
Expand All @@ -167,7 +166,6 @@ elif [ "${REFERENCE_RELEASE_TYPE?}" = "1.4" ]; then
'BORDER_ROUTING=1'
'NAT64=1'
'DNS64=1'
'DHCPV6_PD_REF=1'
"OTBR_OPTIONS=\"${OTBR_THREAD_1_4_OPTIONS[@]}\""
)
build_options+=("${LOCAL_OPTIONS[@]}")
Expand All @@ -178,9 +176,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,21 +187,23 @@ 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/.python3_venv
source /home/pi/.python3_venv/bin/activate

pip3 install scikit-build
pip3 install cmake==3.20.2
cmake --version

pip3 install zeroconf

apt-get install -y --no-install-recommends libgirepository1.0-dev
pip3 install dbus-python PyGObject
apt-get install -y --no-install-recommends python3-gi python3-dbus

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

Expand All @@ -214,13 +214,17 @@ fi

# nRF Connect SDK related actions
if [ "${REFERENCE_PLATFORM?}" = "ncs" ]; then
wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
sudo python2 get-pip.py
apt-get install -y --no-install-recommends vim wiringpi
pip install wrapt==1.12.1
pip install nrfutil
apt-get install -y --no-install-recommends vim

wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb

pip3 install wrapt==1.12.1
pip3 install nrfutil

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

deactivate # deactivate the virtual python environment /home/pi/.python3_venv
sync
Loading