Skip to content
Open
Show file tree
Hide file tree
Changes from 7 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
11 changes: 11 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,17 @@ jobs:
ls -lh "$OUTPUT_PATH"
test -s "$OUTPUT_PATH"

# Upload the particle_image_v1 OTA zip (section 6c) as a downloadable
# artifact so it can be tested against. Emission is best-effort, so warn
# (don't fail) if the build produced no .pimg.zip.
- name: Upload particle_image_v1 OTA zip
uses: actions/upload-artifact@v4
with:
name: particle-image-${{ matrix.region }}-${{ matrix.variant }}
path: .tmp/output/*.pimg.zip
if-no-files-found: warn
retention-days: 7

# ---------- PR uploads ----------
- name: Configure AWS (PR)
if: github.event_name == 'pull_request' &&
Expand Down
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1.7
# particle-dockerfile-version=1.4
# particle-dockerfile-version=1.5
# this is the Dockerfile version.
# Update this ARG to change the base image and recompile it!

Expand All @@ -15,6 +15,8 @@ ENV DEBIAN_FRONTEND=noninteractive
# - dosfstools (mkfs.vfat), e2fsprogs (mkfs.ext4), util-linux (losetup/sfdisk/partx, in base)
# - dpkg (dpkg-deb, in base): extract qcm6490-tachyon.dtb from the kernel deb
# - libxml2-utils (xmllint), jq, xz-utils, rsync, zip/unzip
# - nodejs/npm: run the particle-image CLI (@particle/tachyon-image) that emits
# and validates the particle_image_v1 OTA format from the assembled factory tree
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
python3-pip \
Expand All @@ -26,6 +28,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
unzip \
qemu-user-static \
qemu-utils \
nodejs \
npm \
e2fsprogs \
dosfstools \
mtools \
Expand Down
37 changes: 35 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,20 @@ OVERLAY_STACK := $(if $(strip $(INPUT_OVERLAY_STACK)),$(INPUT_OVERLAY_STACK),ubu
SIGNING_PROFILE ?= $(if $(strip $(call _SIGN,profile)),$(call _SIGN,profile),test)
SIGNING_KEY ?= $(call _SIGN,key)

# -------------------------------------------------------------------
# particle_image_v1 OTA format (@particle/tachyon-image)
# EMIT_FORMAT: factory (default) | ota-image | ota-boot ; EMIT_SLOT: a | b
# PARTICLE_IMAGE_LIB: path to the shared library repo (vendored into the image
# at build time as a tgz; the composer container runs its `particle-image` CLI).
# -------------------------------------------------------------------
EMIT_FORMAT ?= factory
EMIT_SLOT ?= a
PARTICLE_IMAGE_LIB ?= ../particle-tachyon-image
# Published npm version used as a fallback CLI source when PARTICLE_IMAGE_LIB is
# absent (e.g. CI builds only this repo). Installed from npm inside the container.
PARTICLE_IMAGE_VERSION ?= 0.1.0
VENDOR_DIR := $(TMP_ROOT_DIR)/vendor

# -------------------------------------------------------------------
# Validation helpers
# -------------------------------------------------------------------
Expand Down Expand Up @@ -366,8 +380,24 @@ fetch_tachyon_overlays: | docker/build
# -------------------------------------------------------------------
# Main build
# -------------------------------------------------------------------
# Build + pack the shared @particle/tachyon-image lib into .tmp/vendor/ as a tgz.
# compose_24_04.sh (section 6c) installs it inside the container and runs its CLI.
# Best-effort: if the lib repo is absent, the build still produces the legacy zip.
.PHONY: vendor_particle_image
vendor_particle_image:
@if [ -d "$(PARTICLE_IMAGE_LIB)" ]; then \
echo "Vendoring particle-image from $(PARTICLE_IMAGE_LIB) ..."; \
mkdir -p "$(VENDOR_DIR)"; \
rm -f "$(VENDOR_DIR)"/particle-tachyon-image-*.tgz; \
( cd "$(PARTICLE_IMAGE_LIB)" && npm ci --silent && npm run build --silent \
&& npm pack --silent --pack-destination "$(abspath $(VENDOR_DIR))" ) \
&& echo "Vendored: $$(ls "$(VENDOR_DIR)"/particle-tachyon-image-*.tgz)"; \
else \
echo "NOTE: $(PARTICLE_IMAGE_LIB) not found; particle_image_v1 emission will be skipped"; \
fi

.PHONY: build_24.04
build_24.04: version print-config check_qemu vendor_sectools fetch_24_04_unxz fetch_bp_fw fetch_kernel_deb fetch_overlay_tool fetch_tachyon_overlays docker/build
build_24.04: version print-config check_qemu vendor_sectools vendor_particle_image fetch_24_04_unxz fetch_bp_fw fetch_kernel_deb fetch_overlay_tool fetch_tachyon_overlays docker/build
@echo "Building Tachyon 24.04 (new-BP) System Image..."
$(call check_required_param,INPUT_REGION)
$(call check_required_param,INPUT_VARIANT)
Expand All @@ -389,7 +419,10 @@ build_24.04: version print-config check_qemu vendor_sectools fetch_24_04_unxz fe
"$(COMBINED_ENV)" \
"$(DEBUG)" \
"$(SIGNING_PROFILE)" \
"$(SIGNING_KEY)"
"$(SIGNING_KEY)" \
"$(EMIT_FORMAT)" \
"$(EMIT_SLOT)" \
"$(PARTICLE_IMAGE_VERSION)"
@echo ""
@echo "Build completed successfully!"
@echo "Output: $(abspath $(TMP_OUTPUT_DIR))/$(OUTPUT_24_04_SYSTEM_IMAGE)"
Expand Down
Loading
Loading