Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
11bb261
use native arm runner for all images
crschardt Nov 16, 2025
503bd9c
Clean up some messages
crschardt Nov 16, 2025
8747386
Mount CIDATA partition
crschardt Nov 16, 2025
d223319
install_common handles this now
crschardt Nov 16, 2025
fe272bb
make loopdev available for install_opi
crschardt Nov 16, 2025
d2bbd75
don't need /dev
crschardt Nov 16, 2025
cd4d1e1
zero fill empty space on rubik
crschardt Nov 16, 2025
0763e26
maybe this
crschardt Nov 16, 2025
2bd53ed
another try
crschardt Nov 16, 2025
6ffb8e8
testing
crschardt Nov 16, 2025
3f33f33
type
crschardt Nov 16, 2025
e4616e6
more debugging
crschardt Nov 16, 2025
dc96b5f
make it writable
crschardt Nov 16, 2025
0d96e9e
try writing it not in root
crschardt Nov 16, 2025
725348a
Try it in the chroot?
crschardt Nov 16, 2025
2484b8e
minor cleanup
crschardt Nov 16, 2025
ca61ee3
gotta build 'em all
crschardt Nov 16, 2025
9c6907e
raspi-dev needs more space
crschardt Nov 16, 2025
8e7834f
need to preserve the environment
crschardt Nov 16, 2025
da1e58b
try --quiet before the command in apt-get
crschardt Nov 17, 2025
a484a27
maybe qq helps?
crschardt Nov 17, 2025
b096171
supress messages from dpkg too
crschardt Nov 17, 2025
ab9a309
set apt conf to quiet Dpkg
crschardt Nov 17, 2025
4581143
quiet Dpkg spam on other distros
crschardt Nov 17, 2025
3b35512
use photon-image-runner to build images
crschardt Nov 21, 2025
c532e49
add rubikpi to matrix
crschardt Nov 23, 2025
05eae8b
build all the images
crschardt Nov 23, 2025
0424bae
allow -v to have a missing argument
crschardt Nov 23, 2025
d0d495c
allow setting the version of photonvision installed in the image
crschardt Nov 23, 2025
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
94 changes: 48 additions & 46 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,14 @@ concurrency:

jobs:
rubik:
env:
script: "./tmp/build/install_rubikpi3.sh"
base_image: "https://people.canonical.com/~platform/images/qualcomm-iot/rubikpi3/ubuntu-server-24.04/x00/ubuntu-24.04-preinstalled-server-arm64+rubikpi3-20250912-127.yaml"

runs-on: ubuntu-24.04-arm

runs-on: ubuntu-24.04-arm
name: "Build for RubikPi3"

steps:
- uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags --force

- name: Build rubikpi3 with mounting
run: |
chmod +x ./mount_rubikpi3.sh
./mount_rubikpi3.sh ${{ env.base_image }} ${{ env.script }} ${{ github.ref_name }}

- name: Compress built image
run: |
tar -I 'xz -T0' -cf photonvision_rubikpi3.tar.xz photonvision_rubikpi3 --checkpoint=10000 --checkpoint-action=echo='%T'

- uses: actions/upload-artifact@v4.3.4
with:
name: photonvision_rubikpi3.tar.xz
path: photonvision_rubikpi3.tar.xz
if-no-files-found: error
retention-days: 1
- name: Dummy
run: echo "This is a dummy step. Remove when the ""Build for RubikPi3"" job is no longer required"

build:
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-arm

strategy:
fail-fast: false
Expand Down Expand Up @@ -93,44 +68,71 @@ jobs:
- name: rock5c
script: ./install_opi5.sh
base_image: https://github.com/Joshua-Riek/ubuntu-rockchip/releases/download/v2.4.0/ubuntu-24.04-preinstalled-server-arm64-rock-5c.img.xz
- name: rubikpi3
script: ./install_rubikpi3.sh
base_image: https://people.canonical.com/~platform/images/qualcomm-iot/rubikpi3/ubuntu-server-24.04/x00/ubuntu-24.04-preinstalled-server-arm64+rubikpi3-20250912-127.yaml
root_location: "offset=569376768"

name: "Build for ${{ matrix.name }}"

steps:
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --tags --force

- uses: pguyot/arm-runner-action@HEAD
- name: Install dependencies and build image
uses: photonvision/photon-image-runner@HEAD
id: install_deps
with:
image_additional_mb: 1500
bind_mount_repository: true
base_image: ${{ matrix.base_image }}
minimum_free_mb: 2000
image_url: ${{ matrix.base_image }}
root_location: ${{ contains('rubikpi3', matrix.name) && 'offset=569376768' || 'partition=2' }}
shrink_image: ${{ contains('rubikpi3', matrix.name) && 'no' || 'yes' }}
commands: |
chmod +x ${{matrix.script}}
${{ matrix.script }}
chmod +x ./install_common.sh
./install_common.sh
mkdir -p /opt/photonvision/
echo "${{ github.ref_name }};${{ matrix.name }}" > /opt/photonvision/image-version
echo "Running ${{ matrix.script }}"
chmod +x "${{ matrix.script }}"
"./${{ matrix.script }}" "v2026.0.0-alpha-2"
echo "Running install_common.sh"
chmod +x "./install_common.sh"
"./install_common.sh"

- name: Compress built image
- name: Compress built image
if: ${{ ! endsWith(matrix.base_image, 'yaml') }}
run: |
mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img
sudo mv ${{ steps.install_deps.outputs.image }} photonvision_${{ matrix.name }}.img
sudo xz -T 0 -v photonvision_${{ matrix.name }}.img
echo "artifact=photonvision_${{ matrix.name }}.img.xz" >> "$GITHUB_ENV"

- name: Tar built image
if: ${{ endsWith(matrix.base_image, 'yaml') }}
run: |
imagedir=$(dirname ${{ steps.install_deps.outputs.image }})
target=photonvision_${{ matrix.name }}
tardir=${RUNNER_TEMP}/${target}
mkdir --parents ${tardir}
if ls ${imagedir}*.tar.gz 1>/dev/null 2>&1; then
sudo tar -xzf ${imagedir}*.tar.gz -C ${tardir}
fi
sudo mv ${imagedir}/rawprogram*.xml ${tardir}/ 2>/dev/null || true
sudo mv ${imagedir}/dtb.bin ${tardir}/ 2>/dev/null || true
sudo mv ${imagedir}/*.img ${tardir}/ 2>/dev/null || true
sudo find ${tardir} -mindepth 2 -type f -exec mv {} ${tardir}/ \;
sudo find ${tardir} -mindepth 1 -type d -empty -delete
sudo tar -I 'xz -T0' -cf ${target}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
echo "artifact=${target}.tar.xz" >> "$GITHUB_ENV"

- uses: actions/upload-artifact@v4.3.4
- uses: actions/upload-artifact@v4
with:
name: photonvision_${{ matrix.name }}.img.xz
path: photonvision_${{ matrix.name }}.img.xz
name: ${{ env.artifact }}
path: ${{ env.artifact }}
if-no-files-found: error
retention-days: 1

release:
needs: [build, rubik]
# needs: [build, rubik]
needs: [build]
runs-on: ubuntu-24.04
steps:
# Download literally every single artifact
Expand Down
12 changes: 6 additions & 6 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Exit on errors
set -e
set -e +u

needs_arg() {
if [ -z "$OPTARG" ]; then
Expand Down Expand Up @@ -42,7 +42,7 @@ install_if_missing() {

debug "Installing $1..."
if [[ -z $TEST ]]; then
apt-get install --yes "$1"
apt-get --yes install "$1"
# Always mark our upstream apt deps as held back, which will prevent the package
# from being automatically installed, upgraded or removed
apt-mark manual "$1"
Expand Down Expand Up @@ -113,7 +113,7 @@ fi
INSTALL_NETWORK_MANAGER="ask"
VERSION="latest"

while getopts "hlv:a:mnqt-:" OPT; do
while getopts "hlva:mnqt-:" OPT; do
if [ "$OPT" = "-" ]; then
OPT="${OPTARG%%=*}" # extract long option name
OPTARG="${OPTARG#"$OPT"}" # extract long option argument (may be empty)
Expand All @@ -137,8 +137,8 @@ while getopts "hlv:a:mnqt-:" OPT; do
exit 0
;;
v | version)
needs_arg
VERSION=${OPTARG}
# needs_arg
VERSION=${OPTARG:-latest}
;;
a | arch) needs_arg; ARCH=$OPTARG
;;
Expand Down Expand Up @@ -245,7 +245,7 @@ fi

debug "Updating package list..."
if [[ -z $TEST ]]; then
apt-get update
apt-get -q update
fi
debug "Updated package list."

Expand Down
9 changes: 6 additions & 3 deletions install_common.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash -v

#!/bin/bash
# Verbose and exit on errors
set -ex
# set -ex

# Do additional tasks that are common across all images,
# but not suitable for inclusion in install.sh
Expand Down Expand Up @@ -29,3 +28,7 @@ echo "photon:vision" | chpasswd
cp -f ./files/issue.txt /etc/issue
cp -f /etc/issue /etc/issue.net
sed -i 's/#Banner none/Banner \/etc\/issue.net/g' /etc/ssh/sshd_config

# Add photon version file
mkdir -p /opt/photonvision/
echo "${GITHUB_REF_NAME};${image_name}" > /opt/photonvision/image-version
8 changes: 8 additions & 0 deletions install_dev_pi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

# Verbose and exit on errors
set -ex

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Dpkg::Progress-Fancy "0";
APT::Color "0";
Dpkg::Use-Pty "0";
EOF

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
Expand Down
9 changes: 8 additions & 1 deletion install_limelight.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
# Verbose and exit on errors
set -ex

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Dpkg::Progress-Fancy "0";
APT::Color "0";
Dpkg::Use-Pty "0";
EOF

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes --arch=aarch64 --version="$1"

# edit boot partition
install -m 644 limelight/config.txt /boot/
Expand Down
41 changes: 26 additions & 15 deletions install_opi5.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash -v

#!/bin/bash
set +u
# Verbose and exit on errors
set -ex
# set -ex

# Create pi/raspberry login
if id "$1" >/dev/null 2>&1; then
if id "pi" >/dev/null 2>&1; then
echo 'user found'
else
echo "creating pi user"
Expand All @@ -15,7 +15,14 @@ else
fi
echo "pi:raspberry" | chpasswd

apt-get update --quiet
# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Dpkg::Progress-Fancy "0";
APT::Color "0";
Dpkg::Use-Pty "0";
EOF

apt-get -q update

before=$(df --output=used / | tail -n1)
# clean up stuff
Expand All @@ -24,13 +31,13 @@ before=$(df --output=used / | tail -n1)
echo "Purging 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
apt-get --yes -q purge lxd-installer lxd-agent-loader
apt-get --yes -q purge snapd

# remove bluetooth daemon
apt-get purge --yes --quiet bluez
apt-get --yes -q purge bluez

apt-get --yes --quiet autoremove
apt-get --yes -q autoremove

# remove firmware that (probably) isn't needed
rm -rf /usr/lib/firmware/mrvl
Expand All @@ -46,19 +53,23 @@ echo "Freed up $freed KiB"

# run Photonvision install script
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes --arch=aarch64 --version="$1"

echo "Installing additional things"
apt-get install --yes --quiet libc6 libstdc++6
apt-get --yes -qq install libc6 libstdc++6

# let netplan create the config during cloud-init
rm -f /etc/netplan/00-default-nm-renderer.yaml

mkdir --parents /mnt/CIDATA
mount "${loopdev}p1" /mnt/CIDATA
# set NetworkManager as the renderer in cloud-init
cp -f ./OPi5_CIDATA/network-config /boot/network-config

cp -f ./OPi5_CIDATA/network-config /mnt/CIDATA/network-config
# add customized user-data file for cloud-init
cp -f ./OPi5_CIDATA/user-data /boot/user-data
cp -f ./OPi5_CIDATA/user-data /mnt/CIDATA/user-data

umount /mnt/CIDATA
rmdir /mnt/CIDATA

# modify photonvision.service to enable big cores
sed -i 's/# AllowedCPUs=4-7/AllowedCPUs=4-7/g' /lib/systemd/system/photonvision.service
Expand Down Expand Up @@ -86,7 +97,7 @@ for btservice in $btservices; do
done

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

rm -rf /usr/share/doc
rm -rf /usr/share/locale/
13 changes: 10 additions & 3 deletions install_pi.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# set -ex

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Dpkg::Progress-Fancy "0";
APT::Color "0";
Dpkg::Use-Pty "0";
EOF

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh -v "$1" --install-nm=yes --arch=aarch64 --version="$1"

# and edit boot partition
install -m 644 config.txt /boot/
Expand Down
6 changes: 1 addition & 5 deletions install_rubikpi3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ wget -qO - https://thundercomm.s3.dualstack.ap-northeast-1.amazonaws.com/uploads

# Run normal photon installer
chmod +x ./install.sh
./install.sh --install-nm=yes --arch=aarch64
./install.sh --install-nm=yes --arch=aarch64 --version="$1"

# Install packages from the RUBIK Pi PPA, we skip calling apt-get update here because install.sh already does that
apt-get -y install libqnn1 libsnpe1 qcom-adreno1 device-tree-compiler
Expand Down Expand Up @@ -60,7 +60,3 @@ rm -rf /usr/share/locale/
echo '=== Running install_common.sh ==='
chmod +x ./install_common.sh
./install_common.sh
echo '=== Creating version file ==='
mkdir -p /opt/photonvision/
echo '{$1};rubikpi3' > /opt/photonvision/image-version
echo '=== Installation complete ==='
Loading