From 93c38be3afbdaf54097982f5840da2dd3060ace8 Mon Sep 17 00:00:00 2001 From: "Cameron (3539)" Date: Sun, 2 Jun 2024 13:05:41 -0400 Subject: [PATCH 1/8] Bump PI image base (#15) --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e881fb4..ed9439e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,16 +17,16 @@ jobs: include: - name: limelight script: ./install_limelight.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: limelight3 script: ./install_limelight3.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: raspi script: ./install_pi.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: snakeyes script: ./install_snakeyes.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2023-12-11/2023-12-11-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: opi5 script: ./install_opi5.sh base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.33/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz From e76c6d880f0ddf2ca82e981ae12765c84771dcd8 Mon Sep 17 00:00:00 2001 From: "Cameron (3539)" Date: Thu, 4 Jul 2024 14:44:36 -0400 Subject: [PATCH 2/8] Bump orangepi versions to 24.04 (#16) * Bump orangepi versions to 24.04 Fixes https://github.com/PhotonVision/photonvision/issues/1307 * oops * double oops... there are to many to pick from! * Add libc6 and libstdc++6 * Latest version from Joshua Riek * Comment out images that aren't needed for testing the OPi build * enable all images * update checkout runner * master was a very old branch * pin all runners to specific versions to avoid reversions and breaking changes * typo in one runner * try to fix OPi errors in arm-runner-action * add jammy to list of sources on 24.04 * network management is caussing boot problems * don't remove snapd until the snaps are removed * better test for chroot * if syntax * try add-apt-repository * forgot main * put it at the end * no need to write the file --------- Co-authored-by: Craig Schardt --- .github/workflows/main.yml | 14 +++++++------- install_opi5.sh | 26 +++++++++++++++++++------- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ed9439e..66e96f6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,15 +29,15 @@ jobs: base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: opi5 script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.33/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5.img.xz + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.2.1/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz - name: opi5plus script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v1.33/ubuntu-22.04.3-preinstalled-server-arm64-orangepi-5-plus.img.xz + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.1.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus.img.xz name: "Build for ${{ matrix.name }}" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4.1.7 with: fetch-depth: 0 - name: Fetch tags @@ -58,7 +58,7 @@ jobs: mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img sudo xz -T 0 -v photonvision_${{ matrix.name }}.img - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v4.3.3 with: name: photonvision_${{ matrix.name }}.img.xz path: photonvision_${{ matrix.name }}.img.xz @@ -70,10 +70,10 @@ jobs: runs-on: ubuntu-22.04 steps: # Download literally every single artifact - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4.1.7 - run: find # Push to dev release - - uses: pyTooling/Actions/releaser@r0 + - uses: pyTooling/Actions/releaser@v1.0.5 with: token: ${{ secrets.GITHUB_TOKEN }} tag: 'Dev' @@ -82,7 +82,7 @@ jobs: **/*.xz if: github.event_name == 'push' # Upload all xz archives to GH tag if tagged - - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v2.0.6 with: files: | **/*.xz diff --git a/install_opi5.sh b/install_opi5.sh index ae43ad9..8c5f004 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -17,27 +17,39 @@ chmod +x install.sh sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh -./install.sh +./install.sh -n -q rm install.sh # Remove extra packages echo "Purging extra things" -apt-get remove -y gdb gcc g++ linux-headers* libgcc*-dev -apt-get remove -y snapd +# apt-get remove -y gdb gcc g++ linux-headers* libgcc*-dev +# apt-get remove -y snapd apt-get autoremove -y echo "Installing additional things" sudo apt-get update apt-get install -y network-manager net-tools libatomic1 + +apt-get install -y libc6 libstdc++6 + +# cat > /etc/netplan/00-default-nm-renderer.yaml < /etc/netplan/00-default-nm-renderer.yaml < Date: Sun, 21 Jul 2024 19:22:48 -0700 Subject: [PATCH 3/8] Don't ask for password on SUDO for OPi5 images (#21) The photonvision dev tooling expects the 'pi' user to not ask for password on sudo when running `./gradlew deploy -PArchOverride=linuxarm64`, since this is the default on RPI OS. We should do the same here so that gradle behaves on Orange Pi 5 devices as well. --- install_opi5.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install_opi5.sh b/install_opi5.sh index 8c5f004..146ff29 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -8,6 +8,9 @@ else usermod -a -G sudo pi mkdir /home/pi chown -R pi /home/pi + + echo 'pi ALL=(ALL) NOPASSWD: ALL' | tee -a /etc/sudoers.d/010_pi-nopasswd >/dev/null + chmod 0440 /etc/sudoers.d/010_pi-nopasswd fi echo "pi:raspberry" | chpasswd From fbaa80270894a35f6eff2009daeced6220e060a5 Mon Sep 17 00:00:00 2001 From: Craig Schardt Date: Mon, 29 Jul 2024 19:19:07 -0500 Subject: [PATCH 4/8] Improvements for the OPi image (#19) Improve network configuration and boot behavior for the OrangePi5 Ubuntu 24.04 image and add support for the OrangePi5 Pro. --- .github/workflows/main.yml | 9 ++- OPi5_CIDATA/meta-data | 18 ++++++ OPi5_CIDATA/network-config | 35 +++++++++++ OPi5_CIDATA/user-data | 118 +++++++++++++++++++++++++++++++++++++ install_opi5.sh | 77 +++++++++++++++++------- 5 files changed, 232 insertions(+), 25 deletions(-) create mode 100644 OPi5_CIDATA/meta-data create mode 100644 OPi5_CIDATA/network-config create mode 100644 OPi5_CIDATA/user-data diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66e96f6..e86d241 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,9 @@ jobs: - name: opi5plus script: ./install_opi5.sh base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.1.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus.img.xz + - name: opi5pro + script: ./install_opi5.sh + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.1.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-pro.img.xz name: "Build for ${{ matrix.name }}" @@ -58,7 +61,7 @@ jobs: mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img sudo xz -T 0 -v photonvision_${{ matrix.name }}.img - - uses: actions/upload-artifact@v4.3.3 + - uses: actions/upload-artifact@v4.3.4 with: name: photonvision_${{ matrix.name }}.img.xz path: photonvision_${{ matrix.name }}.img.xz @@ -70,7 +73,7 @@ jobs: runs-on: ubuntu-22.04 steps: # Download literally every single artifact - - uses: actions/download-artifact@v4.1.7 + - uses: actions/download-artifact@v4.1.8 - run: find # Push to dev release - uses: pyTooling/Actions/releaser@v1.0.5 @@ -82,7 +85,7 @@ jobs: **/*.xz if: github.event_name == 'push' # Upload all xz archives to GH tag if tagged - - uses: softprops/action-gh-release@v2.0.6 + - uses: softprops/action-gh-release@v2.0.8 with: files: | **/*.xz diff --git a/OPi5_CIDATA/meta-data b/OPi5_CIDATA/meta-data new file mode 100644 index 0000000..c0ec3f7 --- /dev/null +++ b/OPi5_CIDATA/meta-data @@ -0,0 +1,18 @@ +# This is the meta-data configuration file for cloud-init. Please refer to the +# cloud-init documentation for more information: +# +# https://cloudinit.readthedocs.io/ + +# Set the datasource mode to "local". This ensures that user-data is acted upon +# prior to bringing up the network (because everything about the datasource is +# assumed to be local). If you wish to use an HTTP datasource instead, you can +# change this to "net" or override it on the kernel cmdline (see README). +dsmode: local + +# Specifies the "unique" identifier of the instance. Typically in cloud-init +# this is generated by the owning cloud and is actually unique (to some +# degree). Here our data-source is local, so this is just a fixed string. +# Warning: changing this will cause cloud-init to assume it is running on a +# "new" instance, and to go through first time setup again (the value is +# compared to a cached copy). +instance-id: cloud-image diff --git a/OPi5_CIDATA/network-config b/OPi5_CIDATA/network-config new file mode 100644 index 0000000..b5465a2 --- /dev/null +++ b/OPi5_CIDATA/network-config @@ -0,0 +1,35 @@ +# This file contains a netplan-compatible configuration which cloud-init will +# apply on first-boot (note: it will *not* update the config after the first +# boot). Please refer to the cloud-init documentation and the netplan reference +# for full details: +# +# https://netplan.io/reference +# https://cloudinit.readthedocs.io/en/latest/topics/network-config.html +# https://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v2.html +# +# Please note that the YAML format employed by this file is sensitive to +# differences in whitespace; if you are editing this file in an editor (like +# Notepad) which uses literal tabs, take care to only use spaces for +# indentation. See the following link for more details: +# +# https://en.wikipedia.org/wiki/YAML + +# Some additional examples are commented out below + +network: + version: 2 + renderer: NetworkManager + ethernets: + zz-all-en: + renderer: NetworkManager + match: + name: "en*" + dhcp4: true + optional: true + zz-all-eth: + renderer: NetworkManager + match: + name: "eth*" + dhcp4: true + optional: true + diff --git a/OPi5_CIDATA/user-data b/OPi5_CIDATA/user-data new file mode 100644 index 0000000..a4bd227 --- /dev/null +++ b/OPi5_CIDATA/user-data @@ -0,0 +1,118 @@ +#cloud-config + +# This is the user-data configuration file for cloud-init. By default this sets +# up an initial user called "ubuntu" with password "ubuntu", which must be +# changed at first login. However, many additional actions can be initiated on +# first boot from this file. The cloud-init documentation has more details: +# +# https://cloudinit.readthedocs.io/ +# +# Please note that the YAML format employed by this file is sensitive to +# differences in whitespace; if you are editing this file in an editor (like +# Notepad) which uses literal tabs, take care to only use spaces for +# indentation. See the following link for more details: +# +# https://en.wikipedia.org/wiki/YAML +# +# Some additional examples are provided in comments below the default +# configuration. + +# The (default) ubuntu user must be in the video group for hardware acceleration +users: + - default + - name: ubuntu + groups: video + +# On first boot, set the (default) ubuntu user's password to "ubuntu" and +# expire user passwords +chpasswd: + expire: true + users: + - name: ubuntu + password: ubuntu + type: text + +## Set the system's hostname. Please note that, unless you have a local DNS +## setup where the hostname is derived from DHCP requests (as with dnsmasq), +## setting the hostname here will not make the machine reachable by this name. +## You may also wish to install avahi-daemon (see the "packages:" key below) +## to make your machine reachable by the .local domain +hostname: photonvision + +## Set up the keyboard layout. See localectl(1), in particular the various +## list-x11-* sub-commands, to determine the available models, layouts, +## variants, and options +#keyboard: +# model: pc105 +# layout: gb +# variant: +# options: ctrl:nocaps + +# Enable password authentication with the SSH daemon +ssh_pwauth: true + +## On first boot, use ssh-import-id to give the specific users SSH access to +## the default user +#ssh_import_id: +#- lp:my_launchpad_username +#- gh:my_github_username + +## Add users and groups to the system, and import keys with the ssh-import-id +## utility +#groups: +#- robot: [robot] +#- robotics: [robot] +#- pi +# +#users: +#- default +#- name: robot +# gecos: Mr. Robot +# primary_group: robot +# groups: users +# ssh_import_id: foobar +# lock_passwd: false +# passwd: $5$hkui88$nvZgIle31cNpryjRfO9uArF7DYiBcWEnjqq7L1AQNN3 + +## Update apt database and upgrade packages on first boot +#package_update: true +#package_upgrade: true + +## Install additional packages on first boot +#packages: +#- avahi-daemon +#- rng-tools +#- python3-gpiozero +#- [python3-serial, 3.5-1] + +## Write arbitrary files to the file-system (including binaries!) +#write_files: +#- path: /etc/default/console-setup +# content: | +# # Consult the console-setup(5) manual page. +# ACTIVE_CONSOLES="/dev/tty[1-6]" +# CHARMAP="UTF-8" +# VIDEOMODE= +# FONT="Lat15-Terminus18x10.psf.gz" +# FONTFACE= +# FONTSIZE= +# CODESET="Lat15" +# permissions: '0644' +# owner: root:root +#- encoding: gzip +# path: /root/Makefile +# content: !!binary | +# H4sICF2DTWIAA01ha2VmaWxlAFNWCM8syVBILMjPyU/PTC1WKMlXiPB2dlFQNjSx5MpNteLi +# dLDiSoRQxYl5KeWZyRkgXrSCkoqKRmaKgm6pppKCbmqhgoFCrIKamkK1QmpyRr6Ckn92YqWS +# NdC80uQMBZhOa4VahZoaqIrwjMQSewXfxOxUhcwShcr80qLi1Jw0RSUuAIYfEJmVAAAA +# owner: root:root +# permissions: '0644' + +## Run arbitrary commands at rc.local like time +#runcmd: +#- [ ls, -l, / ] +#- [ sh, -xc, "echo $(date) ': hello world!'" ] +#- [ wget, "http://ubuntu.com", -O, /run/mydir/index.html ] + +runcmd: +- [ touch, /etc/cloud/cloud-init.disabled ] diff --git a/install_opi5.sh b/install_opi5.sh index 146ff29..4f313d9 100755 --- a/install_opi5.sh +++ b/install_opi5.sh @@ -4,58 +4,91 @@ if id "$1" >/dev/null 2>&1; then echo 'user found' else echo "creating pi user" - useradd pi -b /home + useradd pi -m -b /home -s /bin/bash usermod -a -G sudo pi - mkdir /home/pi - chown -R pi /home/pi - echo 'pi ALL=(ALL) NOPASSWD: ALL' | tee -a /etc/sudoers.d/010_pi-nopasswd >/dev/null chmod 0440 /etc/sudoers.d/010_pi-nopasswd fi echo "pi:raspberry" | chpasswd -apt-get update +apt-get update --quiet + +before=$(df --output=used / | tail -n1) +# clean up stuff +echo 'Purging snaps' +# get rid of snaps +rm -rf /var/lib/snapd/seed/snaps/* +rm -f /var/lib/snapd/seed/seed.yaml +apt-get purge --yes --quiet lxd-installer lxd-agent-loader +apt-get purge --yes --quiet snapd + +# remove bluetooth daemon +apt-get purge --yes --quiet bluez + +apt-get --yes --quiet autoremove + +after=$(df --output=used / | tail -n1) +freed=$(( before - after )) + +echo "Freed up $freed KiB" + +# run Photonvision install script wget https://git.io/JJrEP -O install.sh chmod +x install.sh -sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' install.sh +sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=0-7/g' install.sh -./install.sh -n -q +./install.sh -m -q rm install.sh +echo "Installing additional things" -# Remove extra packages -echo "Purging extra things" -# apt-get remove -y gdb gcc g++ linux-headers* libgcc*-dev -# apt-get remove -y snapd -apt-get autoremove -y +apt-get install --yes --quiet network-manager net-tools libatomic1 +# let netplan create the config during cloud-init +rm -f /etc/netplan/00-default-nm-renderer.yaml -echo "Installing additional things" -sudo apt-get update -apt-get install -y network-manager net-tools libatomic1 +# set NetworkManager as the renderer in cloud-init +cp -f ./OPi5_CIDATA/network-config /boot/network-config -apt-get install -y libc6 libstdc++6 +# add customized user-data file for cloud-init +cp -f ./OPi5_CIDATA/user-data /boot/user-data -# cat > /etc/netplan/00-default-nm-renderer.yaml < /etc/NetworkManager/conf.d/50-ignore-carrier.conf < Date: Sat, 17 Aug 2024 10:35:23 -0500 Subject: [PATCH 5/8] Add image for Opi5b (#22) * Add image for Opi5b * use same version for all OPi images * update OPi5 images to latest from Joshu Riek (fixes USB3 on OPi5Pro) --- .github/workflows/main.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e86d241..8fade3d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,13 +29,16 @@ jobs: base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz - name: opi5 script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.2.1/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.3.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz + - name: opi5b + script: ./install_opi5.sh + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.3.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5b.img.xz - name: opi5plus script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.1.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus.img.xz + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.3.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-plus.img.xz - name: opi5pro script: ./install_opi5.sh - base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.1.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-pro.img.xz + base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.3.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5-pro.img.xz name: "Build for ${{ matrix.name }}" From 66a7d5f9e2a12df4c6a8285f043c051ca0d2c16b Mon Sep 17 00:00:00 2001 From: Craig Schardt Date: Sun, 18 Aug 2024 19:51:38 -0500 Subject: [PATCH 6/8] Move-install-script-to-image-modifier (#25) Copy the install.sh script to here and redirect the image installation scripts to use this version. Clean up the redundancies in the install scripts. Once this is accepted, the https://git.io/JJrEP short URL should be updated to point to install.sh in this repo and it should be deleted from the Photonvision repo. --- install.sh | 203 ++++++++++++++++++++++++++++++++++++++++++ install_limelight.sh | 17 ++-- install_limelight3.sh | 1 + install_opi5.sh | 35 ++------ install_pi.sh | 18 ++-- install_snakeyes.sh | 1 + 6 files changed, 220 insertions(+), 55 deletions(-) create mode 100755 install.sh mode change 100644 => 100755 install_limelight3.sh mode change 100644 => 100755 install_snakeyes.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..43b9eee --- /dev/null +++ b/install.sh @@ -0,0 +1,203 @@ +#!/bin/bash + +package_is_installed(){ + dpkg-query -W -f='${Status}' "$1" 2>/dev/null | grep -q "ok installed" +} + +help() { + echo "This script installs Photonvision." + echo "It must be run as root." + echo + echo "Syntax: sudo ./install.sh [-h|m|n|q]" + echo " options:" + echo " -h Display this help message." + echo " -m Install and configure NetworkManager (Ubuntu only)." + echo " -n Disable networking. This will also prevent installation of NetworkManager." + echo " -q Silent install, automatically accepts all defaults. For non-interactive use." + echo +} + +INSTALL_NETWORK_MANAGER="false" + +while getopts ":hmnq" name; do + case "$name" in + h) + help + exit 0 + ;; + m) INSTALL_NETWORK_MANAGER="true" + ;; + n) DISABLE_NETWORKING="true" + ;; + q) QUIET="true" + ;; + \?) + echo "Error: Invalid option -- '$OPTARG'" + echo "Try './install.sh -h' for more information." + exit 1 + esac +done + +shift $(($OPTIND -1)) + +if [ "$(id -u)" != "0" ]; then + echo "This script must be run as root" 1>&2 + exit 1 +fi + +ARCH=$(uname -m) +ARCH_NAME="" +if [ "$ARCH" = "aarch64" ]; then + ARCH_NAME="linuxarm64" +elif [ "$ARCH" = "armv7l" ]; then + echo "ARM32 is not supported by PhotonVision. Exiting." + exit 1 +elif [ "$ARCH" = "x86_64" ]; then + ARCH_NAME="linuxx64" +else + if [ "$#" -ne 1 ]; then + echo "Can't determine current arch; please provide it (one of):" + echo "" + echo "- linuxarm64 (64-bit Linux ARM)" + echo "- linuxx64 (64-bit Linux)" + exit 1 + else + echo "Can't detect arch (got $ARCH) -- using user-provided $1" + ARCH_NAME=$1 + fi +fi + +echo "This is the installation script for PhotonVision." +echo "Installing for platform $ARCH_NAME" + +DISTRO=$(lsb_release -is) +if [[ "$DISTRO" = "Ubuntu" && "$INSTALL_NETWORK_MANAGER" != "true" && -z "$QUIET" && -z "$DISABLE_NETWORKING" ]]; then + echo "" + echo "Photonvision uses NetworkManager to control networking on your device." + read -p "Do you want this script to install and configure NetworkManager? [y/N]: " response + if [[ $response == [yY] || $response == [yY][eE][sS] ]]; then + INSTALL_NETWORK_MANAGER="true" + fi +fi + +echo "Update package list" +apt-get update + +echo "Installing curl..." +apt-get install --yes curl +echo "curl installation complete." + +echo "Installing avahi-daemon..." +apt-get install --yes avahi-daemon +echo "avahi-daemon installation complete." + +echo "Installing cpufrequtils..." +apt-get install --yes cpufrequtils +echo "cpufrequtils installation complete." + +echo "Setting cpufrequtils to performance mode" +if [ -f /etc/default/cpufrequtils ]; then + sed -i -e 's/^#\?GOVERNOR=.*$/GOVERNOR=performance/' /etc/default/cpufrequtils +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 net-tools + systemctl disable systemd-networkd-wait-online.service + cat > /etc/netplan/00-default-nm-renderer.yaml < /lib/systemd/system/photonvision.service < /etc/NetworkManager/conf.d/50-ignore-carrier.conf < Date: Wed, 21 Aug 2024 18:48:54 -0400 Subject: [PATCH 7/8] Update RPI Image 7/4/24 (#20) We update again. YAY! The new pi image requires raspberrypi-sys-mods to be installed to boot. We removed something that needed it so it was uninstalled when we removed all unused stuff. --------- Co-authored-by: Craig Schardt --- .github/workflows/main.yml | 8 ++++---- install_limelight.sh | 7 +++---- install_pi.sh | 7 +++---- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8fade3d..ddf07cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,16 +17,16 @@ jobs: include: - name: limelight script: ./install_limelight.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz - name: limelight3 script: ./install_limelight3.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz - name: raspi script: ./install_pi.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz - name: snakeyes script: ./install_snakeyes.sh - base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-03-15/2024-03-15-raspios-bookworm-arm64-lite.img.xz + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz - name: opi5 script: ./install_opi5.sh base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.3.0/ubuntu-24.04-preinstalled-server-arm64-orangepi-5.img.xz diff --git a/install_limelight.sh b/install_limelight.sh index 3ca4779..728af24 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -23,16 +23,15 @@ systemctl enable pigpiod # Remove extra packages too echo "Purging extra things" -apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev libqt* wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods device-tree-compiler +apt-get purge -y gdb gcc g++ linux-headers* libgcc*-dev libqt* wpasupplicant wireless-tools firmware-atheros firmware-brcm80211 firmware-libertas firmware-misc-nonfree firmware-realtek raspberrypi-net-mods apt-get autoremove -y echo "Installing additional things" sudo apt-get update -apt-get install -y pigpiod pigpio device-tree-compiler libraspberrypi-bin +apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager net-tools # libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0.1 libgbm1 - +apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera0.3 libgbm1 rm -rf /var/lib/apt/lists/* apt-get clean diff --git a/install_pi.sh b/install_pi.sh index af63120..80e08a6 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -20,16 +20,15 @@ systemctl enable pigpiod # Remove extra packages too echo "Purging extra things" -apt-get purge -y python3 gdb gcc g++ linux-headers* libgcc*-dev device-tree-compiler +apt-get purge -y gdb gcc g++ linux-headers* libgcc*-dev apt-get autoremove -y echo "Installing additional things" sudo apt-get update -apt-get install -y pigpiod pigpio device-tree-compiler libraspberrypi-bin +apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager net-tools # libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libopencv-core406 libgl1-mesa-dri libcamera0.1 libgbm1 - +apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera0.3 libgbm1 rm -rf /var/lib/apt/lists/* apt-get clean From 744897ea1c72537a5266e368ce3e22a81e90eb7c Mon Sep 17 00:00:00 2001 From: "Cameron (3539)" Date: Sat, 31 Aug 2024 12:31:36 -0400 Subject: [PATCH 8/8] Add Dev Images (#28) --- .github/workflows/main.yml | 3 +++ install_dev_pi.sh | 37 +++++++++++++++++++++++++++++++++++++ install_limelight.sh | 2 +- install_pi.sh | 2 +- 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 install_dev_pi.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ddf07cc..80f6745 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,6 +24,9 @@ jobs: - name: raspi script: ./install_pi.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz + - name: raspi_dev + script: ./install_dev_pi.sh + base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz - name: snakeyes script: ./install_snakeyes.sh base_image: https://downloads.raspberrypi.com/raspios_lite_arm64/images/raspios_lite_arm64-2024-07-04/2024-07-04-raspios-bookworm-arm64-lite.img.xz diff --git a/install_dev_pi.sh b/install_dev_pi.sh new file mode 100644 index 0000000..1548160 --- /dev/null +++ b/install_dev_pi.sh @@ -0,0 +1,37 @@ +# Run normal photon installer +chmod +x ./install.sh +./install.sh -q + +# and edit boot partition +install -m 644 config.txt /boot/ +install -m 644 userconf.txt /boot/ + +# Kill wifi and other networking things +install -v -m 644 files/wait.conf /etc/systemd/system/dhcpcd.service.d/ +install -v files/rpi-blacklist.conf /etc/modprobe.d/blacklist.conf + +# Update pigipio service file to listen locally +install -v -m 644 files/pigpiod.service /lib/systemd/system/pigpiod.service +systemctl daemon-reload + +# Enable ssh/pigpiod +systemctl enable ssh +systemctl enable pigpiod + +# Remove extra packages too +echo "Purging extra things" +apt-get purge -y gdb gcc g++ linux-headers* libgcc*-dev +apt-get autoremove -y + +echo "Installing additional things" +sudo apt-get update +apt-get install -y pigpiod pigpio device-tree-compiler +apt-get install -y network-manager net-tools +# libcamera-driver stuff +apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libgbm1 libegl1-mesa-dev libcamera-dev cmake build-essential libdrm-dev libgbm-dev default-jdk openjdk-17-jdk + +rm -rf /var/lib/apt/lists/* +apt-get clean + +rm -rf /usr/share/doc +rm -rf /usr/share/locale/ diff --git a/install_limelight.sh b/install_limelight.sh index 728af24..27b358b 100755 --- a/install_limelight.sh +++ b/install_limelight.sh @@ -31,7 +31,7 @@ sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager net-tools # libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera0.3 libgbm1 +apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera-dev libgbm1 rm -rf /var/lib/apt/lists/* apt-get clean diff --git a/install_pi.sh b/install_pi.sh index 80e08a6..940a691 100755 --- a/install_pi.sh +++ b/install_pi.sh @@ -28,7 +28,7 @@ sudo apt-get update apt-get install -y pigpiod pigpio device-tree-compiler apt-get install -y network-manager net-tools # libcamera-driver stuff -apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera0.3 libgbm1 +apt-get install -y libegl1 libopengl0 libgl1-mesa-dri libcamera-dev libgbm1 rm -rf /var/lib/apt/lists/* apt-get clean