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 install.sh for OPi5 Ubuntu 24.04 #1390

Merged
merged 9 commits into from
Aug 13, 2024
19 changes: 16 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,14 @@ else
echo 'GOVERNOR=performance' > /etc/default/cpufrequtils
fi

echo "Installing libatomic"
apt-get install --yes libatomic1
echo "libatomic installation complete."

if [[ "$INSTALL_NETWORK_MANAGER" == "true" ]]; then
echo "Installing network-manager..."
apt-get install --yes network-manager
apt-get install --yes network-manager net-tools
systemctl disable systemd-networkd-wait-online.service
cat > /etc/netplan/00-default-nm-renderer.yaml <<EOF
network:
renderer: NetworkManager
Expand All @@ -121,6 +126,10 @@ fi
echo "JRE installation complete."

echo "Installing additional math packages"
if [[ "$DISTRO" = "Ubuntu" && -z $(apt-cache search libcholmod3) ]]; then
echo "Adding jammy to list of apt sources"
add-apt-repository -y -S 'deb http://ports.ubuntu.com/ubuntu-ports jammy main universe'
fi
apt-get install --yes libcholmod3 liblapack3 libsuitesparseconfig5

echo "Installing v4l-utils..."
Expand All @@ -143,8 +152,7 @@ echo "Downloaded latest stable release of PhotonVision."
echo "Creating the PhotonVision systemd service..."

# service --status-all doesn't list photonvision on OrangePi use systemctl instead:
#if systemctl --quiet is-active photonvision; then
if service --status-all | grep -Fq 'photonvision'; then
if systemctl --quiet is-active photonvision; then
echo "PhotonVision is already running. Stopping service."
systemctl stop photonvision
systemctl disable photonvision
Expand Down Expand Up @@ -180,6 +188,11 @@ if [ "$DISABLE_NETWORKING" = "true" ]; then
sed -i "s/photonvision.jar/photonvision.jar -n/" /lib/systemd/system/photonvision.service
fi

if [[ -n $(cat /proc/cpuinfo | grep "RK3588") ]]; then
echo "This has a Rockchip RK3588, enabling all cores"
sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=0-7/g' /lib/systemd/system/photonvision.service
fi

cp /lib/systemd/system/photonvision.service /etc/systemd/system/photonvision.service
chmod 644 /etc/systemd/system/photonvision.service
systemctl daemon-reload
Expand Down
Loading