Skip to content
Merged
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
30 changes: 20 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ jobs:
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"
shrink_image: "no"

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

Expand All @@ -80,39 +81,49 @@ jobs:
with:
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' }}
root_location: ${{ matrix.root_location || 'partition=2' }}
shrink_image: ${{ matrix.shrink_image || 'yes' }}
commands: |
echo "Running ${{ matrix.script }}"
chmod +x "${{ matrix.script }}"
"./${{ matrix.script }}" "v2026.0.0-alpha-2"
"./${{ matrix.script }}"
echo "Running install_common.sh"
chmod +x "./install_common.sh"
"./install_common.sh"

- name: Compress built image
if: ${{ ! endsWith(matrix.base_image, 'yaml') }}
# Compress the standard images
if: ${{ ! startsWith(matrix.name, 'rubik') }}
run: |
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') }}
# Build the RubikPi3-specific tar file
if: ${{ startsWith(matrix.name, 'rubik') }}
run: |
imagedir=$(dirname ${{ steps.install_deps.outputs.image }})
target=photonvision_${{ matrix.name }}
tardir=${RUNNER_TEMP}/${target}
tardir=${target}
mkdir --parents ${tardir}
if ls ${imagedir}*.tar.gz 1>/dev/null 2>&1; then
sudo tar -xzf ${imagedir}*.tar.gz -C ${tardir}
echo "Contents of imagedir: ${imagedir}"
ls -la ${imagedir}
if ls ${imagedir}/*.tar.gz 1>/dev/null 2>&1; then
sudo tar -xzf ${imagedir}/*.tar.gz -C ${tardir} --strip-components=1
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 "Contents of tardir: ${tardir}"
ls -la ${tardir}
sudo tar -I 'xz -T0' --create --file=${target}.tar.xz ${tardir} --checkpoint=10000 --checkpoint-action=echo='%T'
echo "Contents of tar file:"
# Expenive operation (has to unzip the file), only use for debugging
# echo "Contents of tar file:"
# tar --list --file=${target}.tar.xz
echo "artifact=${target}.tar.xz" >> "$GITHUB_ENV"

- uses: actions/upload-artifact@v4
Expand All @@ -123,7 +134,6 @@ jobs:
retention-days: 1

release:
# needs: [build, rubik]
needs: [build]
runs-on: ubuntu-24.04
steps:
Expand Down
5 changes: 3 additions & 2 deletions install_common.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# Verbose and exit on errors
# set -ex

# Exit on errors, print commands, ignore unset variables
set -ex +u

# Do additional tasks that are common across all images,
# but not suitable for inclusion in install.sh
Expand Down
6 changes: 3 additions & 3 deletions install_dev_pi.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Expand Down
6 changes: 3 additions & 3 deletions install_limelight.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Expand Down
6 changes: 3 additions & 3 deletions install_limelight3.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# Run the pi install script
chmod +x ./install_pi.sh
Expand Down
6 changes: 3 additions & 3 deletions install_limelight3g.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# Run the pi install script
chmod +x ./install_pi.sh
Expand Down
6 changes: 3 additions & 3 deletions install_limelight4.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# Run the pi install script
chmod +x ./install_pi.sh
Expand Down
6 changes: 3 additions & 3 deletions install_luma_p1.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# Run the pi install script
chmod +x ./install_pi.sh
Expand Down
6 changes: 3 additions & 3 deletions install_opi5.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
set +u
# Verbose and exit on errors
# set -ex

# Exit on errors, print commands, ignore unset variables
set -ex +u

# Create pi/raspberry login
if id "pi" >/dev/null 2>&1; then
Expand Down
4 changes: 2 additions & 2 deletions install_pi.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Verbose and exit on errors
# set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# silence log spam from dpkg
cat > /etc/apt/apt.conf.d/99dpkg.conf << EOF
Expand Down
12 changes: 4 additions & 8 deletions install_rubikpi3.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash -v
# Verbose and exit on errors
set -ex
#!/bin/bash

# Exit on errors, print commands, ignore unset variables
set -ex +u

cd /tmp/build
echo '=== Current directory: \$(pwd) ==='
Expand Down Expand Up @@ -40,7 +41,6 @@ apt-get -y install libqnn1 libsnpe1 qcom-adreno1 device-tree-compiler
# Enable ssh
systemctl enable ssh


# Remove extra packages too
echo "Purging extra things"

Expand All @@ -56,7 +56,3 @@ apt-get clean

rm -rf /usr/share/doc
rm -rf /usr/share/locale/

echo '=== Running install_common.sh ==='
chmod +x ./install_common.sh
./install_common.sh
6 changes: 3 additions & 3 deletions install_snakeyes.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash -v
#!/bin/bash

# Verbose and exit on errors
set -ex
# Exit on errors, print commands, ignore unset variables
set -ex +u

# Run the pi install script
chmod +x ./install_pi.sh
Expand Down