Skip to content
Open
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
46 changes: 46 additions & 0 deletions .github/workflows/build-installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Builds the installer images:
# - on trixie and forky for the qcom-next kernel
# - on trixie for the qcom-7.3 kernel
#
# See docs/installer.md.

name: Build installer images

on:
schedule:
- cron: '00 13 * * *'
# allow manual runs
workflow_dispatch:
# HACK: temporary, drop before merging: build the installers on pushes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(reminder to drop)

# to the installer branch
push:
branches: [wip/obbardc/iso-installer]

# grant nothing by default; the job below declares the scopes it needs
permissions: {}

jobs:
build:
# don't run from forks of the main repository or from other branches;
# manual runs are allowed from any branch of the main repository so
# that changes to the workflows can be tested before they are merged
# HACK: temporary, drop before merging: also run on pushes to the
# installer branch
if: >-
github.repository == 'qualcomm-linux/qcom-deb-images' &&
(github.event_name == 'workflow_dispatch' ||
github.ref == 'refs/heads/main' ||
github.ref == 'refs/heads/wip/obbardc/iso-installer')
strategy:
fail-fast: false
matrix:
include:
- {kernel: qcom-next, suite: trixie}
- {kernel: qcom-next, suite: forky}
- {kernel: qcom-7.3, suite: trixie}
uses: $/.github/workflows/installer.yml
permissions:
contents: read
with:
kernel: ${{ matrix.kernel }}
suite: ${{ matrix.suite }}
4 changes: 4 additions & 0 deletions .github/workflows/build-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ permissions: {}
jobs:
event-file:
name: "Upload event file"
# HACK: temporary, drop before merging: skip PRs from the installer branch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

if: github.head_ref != 'wip/obbardc/iso-installer'
runs-on: ubuntu-26.04
permissions:
contents: read # actions/upload-artifact
Expand All @@ -20,6 +22,8 @@ jobs:
path: ${{ github.event_path }}

build:
# HACK: temporary, drop before merging: skip PRs from the installer branch
if: github.head_ref != 'wip/obbardc/iso-installer'
strategy:
fail-fast: false
matrix:
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/installer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Build installer image

on:
workflow_call:
inputs:
kernel:
description: >
Kernel the installer boots and installs: qcom-7.3 or qcom-next
(from the Qualcomm Linux APT repository)
required: true
type: string
suite:
description: Distribution suite (e.g. trixie, forky)
type: string
default: trixie

outputs:
artifacts_url:
description: "URL to retrieve build artifacts"
value: ${{ jobs.build-installer.outputs.url }}

# grant nothing by default; every job below declares the scopes it needs. these
# are also capped by the calling job's permissions: block, so callers have to
# grant at least as much.
permissions: {}

jobs:
build-installer:
name: Build and upload installer image (${{ inputs.kernel }}, ${{ inputs.suite }})
permissions:
contents: read # actions/checkout
outputs:
url: ${{ steps.upload_artifacts_s3.outputs.url }}
runs-on: [self-hosted, qcom-u2404, arm64]
# fail a hung build instead of letting it run to the 6-hour default
timeout-minutes: 120
# build in forky whatever the target suite; see
# installer/setup-build-host.sh
container:
image: public.ecr.aws/debian/debian:forky
options: --privileged
env:
KERNEL: ${{ inputs.kernel }}
SUITE: ${{ inputs.suite }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

# live-build from git, its dependencies, stubble and the Qualcomm
# Linux APT repository
- name: Set up build host
run: |
set -ux
installer/setup-build-host.sh --suite "${SUITE}"

# bmaptool and pigz: stage the image for publishing below
- name: Install publishing tools
run: |
set -ux
apt-get -y install bmaptool pigz

- name: Download kernel package
run: |
set -ux
installer/download-kernel.sh "${KERNEL}" kernel

- name: Build installer image
run: |
set -ux
installer/build-installer.sh --suite "${SUITE}" \
--kernel-name "${KERNEL}" \
kernel/*.deb

- name: Stage installer artifacts for publishing
run: |
set -ux
dir="installer-artifacts"
# every job of a run uploads to the same destination, so name
# everything after the kernel and suite
name="installer-${KERNEL}-${SUITE}"
mkdir -v "${dir}"
img=$(ls installer/build/"${SUITE}-${KERNEL}"/*.iso)
bmaptool create "${img}" >"${dir}/${name}.iso.bmap"
pigz -c "${img}" >"${dir}/${name}.iso.gz"
# generate sha256sums for all artifacts
(cd "${dir}" && sha256sum * | tee "${name}-sha256sums.txt")

# upload to a cloud storage space accessible by Axiom
- name: Upload private artifacts (S3)
uses: qualcomm-linux/upload-private-artifact-action@4940e9327cd7386acdb908b61c714c079b7d754b # aws-v4
id: upload_artifacts_s3
with:
path: installer-artifacts
# these should be the defaults
s3_bucket: qcom-prd-gh-artifacts
destination: ${{ github.repository_owner }}/${{ github.event.repository.name }}/${{ github.run_id }}-${{ github.run_attempt }}/

- name: "Print output"
env:
build_url: ${{ steps.upload_artifacts_s3.outputs.url }}
run: |
echo "Downloads URL: ${build_url}"
echo "## Download URL" >> $GITHUB_STEP_SUMMARY
echo "[${build_url}](${build_url})" >> $GITHUB_STEP_SUMMARY
6 changes: 5 additions & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ jobs:
runs-on: ubuntu-26.04
permissions:
contents: read # actions/github-script
if: ${{ github.event.workflow_run.conclusion == 'success' }}
# HACK: temporary, drop before merging: Build on PR skips PRs from the
# installer branch, but its run still succeeds, so skip them here too
if: >-
${{ github.event.workflow_run.conclusion == 'success' &&
github.event.workflow_run.head_branch != 'wip/obbardc/iso-installer' }}
outputs:
url: ${{ steps.set-build-url.outputs.url }}
pr_number: ${{ steps.pr-details.outputs.pr_number }}
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,30 @@ flash: debos-recipes/qualcomm-linux-debian-flash.yaml dtbs.tar.gz
# make PYTEST_OPTS=--verbose test
PYTEST_OPTS ?=

# The installer boots the kernel from KERNEL_DEB, a linux-image .deb, and
# installs SUITE, e.g.:
# make installer KERNEL_DEB=linux-image-custom.deb SUITE=forky
# INSTALLER_OPTS are passed to the installer build script, e.g.:
# make installer KERNEL_DEB=... INSTALLER_OPTS="--kernel-name qcom-next"
# live-build has to run as root, so the installer targets use sudo unless make
# already runs as root.
KERNEL_DEB ?=
SUITE ?= trixie
INSTALLER_OPTS ?=
INSTALLER_SUDO := $(if $(filter 0,$(shell id -u)),,sudo)

.PHONY: installer
installer:
@if [ -z "$(KERNEL_DEB)" ]; then \
echo "Set KERNEL_DEB to the kernel's linux-image .deb" >&2; \
exit 1; \
fi
$(INSTALLER_SUDO) installer/build-installer.sh --suite $(SUITE) $(INSTALLER_OPTS) $(KERNEL_DEB)

.PHONY: clean-installer
clean-installer:
$(INSTALLER_SUDO) rm -rf installer/build

# run all the tests
.PHONY: test
test: test-qemu test-unit
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,20 @@ never pull a Qualcomm Linux package on upgrade. Expect reduced hardware support
compared to the default image, as the Debian kernel does not carry the
Qualcomm platform patches which `linux-image-qcom-next` does.

## Build an installer image

A customised, standalone installer image can be built with `live-build`, for
now for the Glymur CRD only. It boots a kernel from the Qualcomm Linux APT
repository, or from a kernel `.deb` you provide. The simplest way is to build
it in a forky container, which only needs podman or docker:

```bash
installer/build-installer-container.sh --suite forky --kernel qcom-next
```

See [docs/installer.md](docs/installer.md) for more information about the
installer.

## Development

Want to join in the development? Changes welcome! See [CONTRIBUTING.md file](CONTRIBUTING.md) for step by step instructions.
Expand Down
Loading
Loading