Skip to content

Add initial live-build ISO image scripts & integrate into CI workflow - #715

Open
Christopher Obbard (obbardc) wants to merge 15 commits into
mainfrom
wip/obbardc/iso-installer
Open

Christopher Obbard (obbardc) wants to merge 15 commits into
mainfrom
wip/obbardc/iso-installer

Conversation

@obbardc

@obbardc Christopher Obbard (obbardc) commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Add basic infrastructure for building Debian ISO images using live-build and integrating into the existing workflows.

These images boot to a live GNOME image, which contains the standard apps as well as the Calamares installer. Also, the standard Debian installer is available.

The main customisations in the image is around the integration of the Stubble DTB loader and kernel cmdline parameters, both in the installer and the installed image.

Depends on qualcomm-linux/pkg-linux-qcom#200

Closes #684

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@test-reporting-app

This comment was marked as outdated.

@obbardc Christopher Obbard (obbardc) changed the title feat(installer): add basic debian-installer build infrastructure Add initial installer ISO recipe and CI integration Oct 16, 2026
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown

Test results for commit 43904f4

qcom-next-trixie
Pass: 2 | Fail: 3 | Total: 5
Test glymur-crd qcs615-ride qcs6490-rb3gen2 qcs8300-ride qrb2210-rb1
boot ❌ fail ❌ fail ✅ pass ✅ pass ❌ fail
All jobs summary
Job ID Device State Health
493043 qrb2210-rb1 Running Unknown
493040 glymur-crd Running Unknown
493041 qcs6490-rb3gen2 Finished Complete
493044 qcs615-ride Running Unknown
493042 qcs8300-ride Finished Complete

@lool Loïc Minier (lool) left a comment

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.

I started reviewing this, but it's way too big; I'm worried that I won't have a block of time large enough to review this. Can we split this somehow? Ideas:

  • reduce scope
  • separate installer and live image work
  • keep improvements to initramfs-tools and dracut to separate PRs, ideally to overlay package
  • use our branch of live-build / send patches to upstream live-build

I've left a few suggested improvements, but I didn't manage to review everything.

Comment thread .github/workflows/build-installer.yml Resolved
- 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)

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

Comment thread .github/workflows/installer.yml Resolved
Comment thread .github/workflows/installer.yml Outdated
set -eux
mkdir -v kernel
case "${KERNEL}" in
qcom-7.2|qcom-next)

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.

7.2

Comment thread .github/workflows/installer.yml Outdated
EOF
apt update

# download the real linux-image-<version> package the kernel's

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.

this feels like a lot for github CI; let's maybe have a standalone script that does whatever is needed for the image, and call it from GH workflow?

@obbardc
Christopher Obbard (obbardc) force-pushed the wip/obbardc/iso-installer branch 2 times, most recently from 6ad1342 to 888f30c Compare November 13, 2026 19:50
@obbardc
Christopher Obbard (obbardc) force-pushed the wip/obbardc/iso-installer branch 2 times, most recently from e921fcd to 1d89d93 Compare November 26, 2026 14:35
@obbardc Christopher Obbard (obbardc) changed the title Add initial installer ISO recipe and CI integration Add initial live-build ISO image scripts & integrate into CI workflow Nov 26, 2026
@obbardc
Christopher Obbard (obbardc) marked this pull request as ready for review November 26, 2026 14:54
The installer image is an iso-hybrid image, which d-i's cdrom-detect
and live-boot mount as ISO 9660, so the kernel needs ISO9660_FS. The
values match Debian's kernel config. The live squashfs uses
live-build's default xz compression, which squashfs.config already
enables.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Debian's own installer images can't boot Qualcomm devices: they lack
the kernel, firmware and DTB handling these need. Add a live-build
based script that builds a debian-installer cdrom image as an
iso-hybrid image, which can be written to a USB stick and booted by
the UEFI firmware, as the base for the customisations that follow.

The image only carries the installer and its pool, so live-build's
rootfs stages are skipped.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The stock d-i kernel doesn't support the Qualcomm hardware. Replace the
installer's kernel and modules with the ones from the given linux-image
package, trimmed to what the installer needs, and add the package to
the pool so the target installs the same kernel. Drop the stock
kernel's packages and module udebs from the pool, which the custom
kernel can't use, along with the udebs for hardware the image doesn't
target.

Pass the kernel arguments the Qualcomm devices need from
kernel/kernel-cmdline to live-build's boot entries, and to the target
through d-i's add-kernel-opts, as d-i doesn't copy the arguments before
the "---" to the target. Name the build directory after the suite and
the kernel, so builds of different kernels don't collide, and add
Makefile targets to build and clean it.

Unpack the d-i initrds without their device nodes (dev/console and
dev/null) and write the nodes back as a second cpio archive after the
repacked one, which the kernel unpacks in turn. Unpacking made cpio
mknod them, which needs CAP_MKNOD, and a rootless (e.g. podman)
container lacks it even with --privileged. fakeroot isn't an option, as
it hung in the CI container.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
live-build's pool only holds the bootstrap packages and lb installer's
short list, all without Recommends, so steps of the install that
install more packages into the target fail without a network. Add the
packages d-i installs itself, and tasksel's standard task, so a
standard system can be installed offline.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The target needs the device firmware to bring up storage, display,
DSPs and wifi. Add the firmware packages to the pool and install them
on the target, and enable non-free-firmware there.

Stop lb installer from adding every package that ships firmware to the
pool, which pulls in many unrelated packages, and move the firmware
from the pool's non-free component, where live-build files it, to
non-free-firmware, which the image's Release lists. On trixie, take the
firmware from trixie-backports, as trixie's is too old for newer
kernels.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The device's firmware doesn't provide a usable device tree, so the
kernel can't boot from GRUB on its own. Wrap the installer kernel with
Stubble, bundling the DTBs from the kernel package that have a Stubble
HWID entry, so that the right device tree is loaded for the machine.

The installed system needs the same handling, but no package ships the
files it needs. Run a post-install step from d-i's late_command, which
sources the postinst.d parts from the image in the target, and add a
part that installs the dtb-loader kernel hooks there, from the rootfs
overlay in debos-recipes/overlays/ so the images and the installer
agree. Install stubble and systemd-boot-efi from the pool for them.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Installing from the pool alone leaves the target without an APT
mirror, so it can't install updates or more packages. Offer a network
mirror (and backports on stable suites) in the installer, which needs
apt-mirror-setup that live-build's udeb_exclude would otherwise drop.

Also skip the root login and swap questions, which don't make sense
for these machines, and add sudo to the pool for the first user.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Let the hardware be tried out before installing anything: build a live
GNOME system from live-build's chroot, with the custom kernel and the
firmware, and boot it by default from live-build's menu. Use the
kernel's version as the flavour so the live entry finds it, pass it the
kernel arguments too, and drop the fail-safe entry, which lacks them.
Add Calamares to it to install the live system to disk, running the
same post-install step as d-i does on the target. The installer stays
the same, and installs from the pool as before.

Also add GNOME's task to the pool and tick it by default in tasksel, so
the target can get the same desktop offline.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The image depends heavily on live-build's behaviour, and the suite's
live-build package differs between trixie and forky and changes
whenever the archive does. Add setup-build-host.sh, which installs
live-build from its git repository instead, pinned to a commit, so
every build uses the same live-build and it only changes when the pin
is bumped, along with its dependencies, stubble and the Qualcomm Linux
APT repository.

It expects a forky host for every target suite, so all builds share
the same host tools, matching the live-build from git, rather than the
target suite's older debootstrap, squashfs-tools and xorriso, and
stubble from trixie-backports. live-build bootstraps the target
suite's chroot itself, so the image still has the target suite's
packages.

Add download-kernel.sh to download the linux-image package a kernel
metapackage (e.g. linux-image-qcom-next) depends on from that
repository. Both are shared by CI and local container builds, so they
build the same way.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Build the installer images for the CI kernels every night, so that
changes to the installer or the kernels which break them are caught,
and so that there are recent images to test with.

Build in a forky container for every suite, with
installer/setup-build-host.sh. Anything lb runs on the host (e.g.
debootstrap, mksquashfs, the host stubble's HWID database) is then
forky's, which could make a trixie image differ from one built on
trixie; revert to a per-suite container if trixie builds misbehave.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Building the installer locally needs live-build and its dependencies on
the host, and the host's live-build and tools may differ from the ones
CI builds with. Add build-installer-container.sh, which sets up a
privileged forky container with setup-build-host.sh and builds in it,
as CI does, so a local build matches CI's and the host only needs
podman or docker.

Like CI, it downloads the kernel given by --kernel (e.g. qcom-next or
qcom-7.3) from the Qualcomm Linux APT repository for the suite, or
takes a locally built kernel package instead, so a kernel under
development can be tried without publishing it.

Rootless podman can't set up the loop devices live-build uses, even
with --privileged, so run podman as root through sudo when it is
rootless. Even as root, a privileged container gets a static copy of
the host's /dev, so loop devices that losetup creates during the build
do not show up in it; bind-mount the host's /dev so they do. The build
tree is then owned by root, so create installer/build as the calling
user first, and hand the tree back to them once the build succeeds.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Add run-installer-qemu.sh, which boots the image in QEMU on an arm64
host with KVM, attached as a USB stick with a virtio disk to install
to, so the installer can be tried without hardware.

Boot QEMU with a DT rather than ACPI: QEMU's SPCR table makes the
serial port the preferred console over the image's console=tty0, so
d-i would run on serial instead of the screen. Keep virtio-gpu and
simpledrm in the installer initrds, so d-i has a display in QEMU.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Explain how to build the installer image, run it in QEMU and how the
image and the target are customised, and point to it from the README.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The PR for the installer branch doesn't change the debos images, so
building and testing them for every push only wastes the runners and
LAVA. Drop before merging.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
The nightly installer builds only run from main, so the installer
branch can't be tested before it is merged. Also build on pushes to
it. Drop before merging.

Signed-off-by: Christopher Obbard <chris.obbard@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Request to compile ISO bootable image for Dual boot validation in Debian build

2 participants