Skip to content

Commit

Permalink
Handle bluetooth service correctly (PhotonVision#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
crschardt authored Jan 3, 2025
1 parent 303e72d commit b9b2e92
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions install_opi5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,18 @@ cat /etc/systemd/system/photonvision.service
# networkd isn't being used, this causes an unnecessary delay
systemctl disable systemd-networkd-wait-online.service

# the bluetooth service isn't needed and causes a delay at boot
systemctl disable ap6275p-bluetooth.service
# the bluetooth service isn't needed and causes problems with cloud-init
# the chip has different names on different boards. Examples are:
# OrangePi5: ap6275p-bluetooth.service
# OrangePi5pro: ap6256s-bluetooth.service
# OrangePi5b: ap6275p-bluetooth.service
# OrangePi5max: ap6611s-bluetooth.service
# instead of keeping a catalog of these services, find them based on a pattern and mask them
btservices=$(systemctl list-unit-files *bluetooth.service | tail -n +2 | head -n -1 | awk '{print $1}')
for btservice in $btservices; do
echo "Masking: $btservice"
systemctl mask "$btservice"
done

rm -rf /var/lib/apt/lists/*
apt-get --yes --quiet clean
Expand Down

0 comments on commit b9b2e92

Please sign in to comment.