Non-layered MAKE_ISO=yes builds (e.g. kubuntu) had no equivalent of
the lb_binary_layered kernel placement added in the previous commit:
lb binary_linux-image put the kernel in binary/casper/ but nothing
copied it into the ISO tree (CASPER_DIR).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
04-kernel-bits.binary only handled ubuntu-server; desktop builds
(ubuntu, ubuntu-budgie, lubuntu, etc.) had no equivalent and so the
kernel never reached the ISO casper directory for MAKE_ISO=yes builds.
Centralise the logic in lb_binary_layered, which already knows which
passes are live passes and is where the kernel is subsequently removed
from the chroot overlay. The flavor is determined by convention:
- passes ending in .live (desktop builds) use LB_LINUX_FLAVOURS
- other live passes (server installer passes such as
"...installer.generic-hwe") encode the flavor as the final
dot-separated component of the pass name
The netboot sub-passes (e.g. installer.generic.netboot) are never
added to LIVE_PASSES, so is_live_layer already guards against them;
the explicit exit-0 that 04-kernel-bits.binary needed is not required.
MAKE_ISO is always "yes" when lb_binary_layered runs — every code path
that sets PASSES_TO_LAYERS=true also sets MAKE_ISO=yes — so no
conditional is needed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
For MAKE_ISO=yes builds, squashfs, kernel, initrd, manifests, and sizes
are now placed directly into config/iso-dir/iso-root/casper/ during the
build rather than creating livecd.* intermediates that get linked as
for-iso.* files and then copied into casper/ by isobuild.
This stops publishing the intermediate livecd.* artifacts so that only
livecd.*.iso and livecd.*.netboot.tar.gz are published for ISO builds.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Hooks that only source config/functions (not config/common) would fail
with "LIVECD_ROOTFS_ROOT: parameter not set" when calling setup_mountpoint
or any function that transitively calls it. This affected ubuntu, ubuntu-cpc,
and buildd hooks.
Rather than adding `. config/common` to every hook, prepend the
LIVECD_ROOTFS_ROOT assignment to config/functions at config time so it is
available to all callers automatically.
- Adding parition ordering using imagecraft
- Removing redundant locales install
- Better logging for empty ARCH and SUBPROJECT
- Using mktemp for mountpoint
- Added manifest and filelist generation
- Currently, we only produce minimal images for amd64
- Tested the changes by booting an instance on OVH
- Hook was also tested to be run in a local CPC Jenkins pipeline
Read http-proxy from --http-proxy flag or build-livefs.conf and pass it
to the VM at launch time via cloud-init user-data (apt.http_proxy /
apt.https_proxy). Also set package_update: true so cloud-init runs
apt-get update on first boot, removing the need for an explicit call.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Creates (or reuses) a per-suite LXD VM, mounts the livecd-rootfs
checkout into it, waits for the VM to be ready, installs dependencies,
and runs build-livefs inside the VM — keeping the host clean.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Provides a single command to run a livecd-rootfs build, replacing the
manual setup of auto/ symlinks and env vars that lpbuildd's
build_livefs.py encapsulates. Works from a git checkout, an installed
deb, or via the /usr/bin/build-livefs symlink.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Builds a real Ubuntu ISO in ~2-3 minutes (vs 30-60 for production)
by keeping the package set minimal (casper + linux-generic only) and
using lz4 squashfs compression.
Design:
- Two-pass layered build (PASSES_TO_LAYERS=true):
- base: installs casper
- base.generic (LIVE_PASSES): installs linux-generic, triggers
update-initramfs with CASPER_GENERATE_UUID=1 to embed UUID
- No package pool (POOL_SEED_NAME=), no universe, amd64 only
- SQUASHFS_COMP=lz4 (~10x faster than xz); create_squashfs() now
respects ${SQUASHFS_COMP:-xz} so all other projects are unaffected
- Germinate is skipped (only add_package is used, no add_task/pool)
New files:
- live-build/ubuntu-test-iso/hooks/01-test-iso.chroot_early
- live-build/ubuntu-test-iso/hooks/02-test-iso-kernel.binary
Modified:
- live-build/functions: honour $SQUASHFS_COMP in create_squashfs()
- live-build/gen-iso-ids: add ubuntu-test-iso -> Ubuntu-Test-ISO
- live-build/auto/config: IMAGEFORMAT, fs, COMPONENTS, germinate
skip, SQUASHFS_COMP default + per-project override, project block,
write SQUASHFS_COMP to config/common, lxd exclusion, hook copying
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
For no very good reason this is what debian-cd does, and what the grub
config isobuilder generates still expects. It probably makes sense to
switch to 'vmlinuz' like every other arch apart from ppc64el does but
for now I want to maintain compatibility with the old ISOs.
There are case in CPC built images where we don't want to create an SBOM.
Add an argument in create_manifest which defaults to creating an SBOM, but can also skip generating an SBOM
A change in 2024 [0] was made to debootstrap in which the keyring is now
switched from ubuntu-archive-keyring.gpg to
ubuntu-archive-removed-keys.gpg after a given release goes EOL. This
means that the Release signature cannot be verified after EOL since the
Release is signed with the ubuntu-archive-keyring.gpg. It is expected
that we can continue to build any release even after the suite is
closed.
This change adds a debootstrap configuration to override this behavior
and ensure all of our images are verified against the main archive key.
Refs: [0] https://git.launchpad.net/ubuntu/+source/debootstrap/commit/?id=4f8b3405097b9f655938528ae7105ec534eb7d1b
Use consistent formatting across all architectures: 4-space indent,
two spaces after "linux", one space after "initrd". Also fix an extra
blank line before "fi" in amd64's UEFI section caused by f-string
interpolation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Separate config generation from file I/O by having generate_grub_config()
and its helpers return strings. The base class make_bootable() now handles
writing grub.cfg.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The debian-cd scripts did this game of placing boot-related files in a
separate directory that was then passed to xorriso to include on the
ISO. Stop doing that and just put the files directly into the ISO root
that is already passed to xorriso.
Package contents were being extracted into subdirectories of the boot
tree (grub_dir, shim_dir), which meant the boot tree contained both
the final boot files and the raw package extractions. Extract packages
into scratch directories instead, copying only the needed files into
the boot tree. This also removes the grub_dir/shim_dir instance
variables and the create_dirs overrides, and moves copy_grub_modules
to a standalone function in grub.py.
Set MAKE_ISO=yes so ubuntu-mini-iso uses the standard isobuilder
flow in auto/build. The binary hook is simplified to just creating
kernel/initrd artifacts; isobuilder handles .disk metadata, boot
configuration, and ISO creation.
The mini-iso's custom grub.cfg (single iso-chooser-menu entry) is
generated by a project-specific path in AMD64BootConfigurator.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the debian-cd git clone and shell script invocation in
ISOBuilder with the new Python boot configurators.
Key changes to builder.py:
- make_bootable() creates a boot configurator and calls its
make_bootable() method instead of cloning debian-cd
- make_iso() gets mkisofs_opts directly from the configurator
instead of reading a serialized file
- add_live_filesystem() links kernel/initrd with names expected
by the boot configurators (vmlinuz/initrd, hwe-vmlinuz/hwe-initrd)
- _extract_casper_uuids() updated for the new initrd naming scheme
- Refactor config storage to use a single _config dict
- Add limit_length parameter to Logger for long xorriso commands
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add architecture-specific boot configurators that translate the
debian-cd boot shell scripts (boot-amd64, boot-arm64, boot-ppc64el,
boot-riscv64, boot-s390x) into Python.
The package uses a class hierarchy:
- BaseBootConfigurator: abstract base with common functionality
- GrubBootConfigurator: shared GRUB config generation
- UEFIBootConfigurator: UEFI-specific shim/ESP handling
- Architecture classes: AMD64, ARM64, PPC64EL, RISCV64, S390X
A factory function make_boot_configurator_for_arch() creates the
appropriate configurator for each architecture.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract a download_direct() method from download() to enable downloading
packages to an arbitrary directory with an arbitrary specification string.
This will be used by the boot configuration code to download bootloader
packages.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ubuntukylin's /etc/apt/trusted.gpg.d/ubuntukylin-archive-keyring.gpg
contains a symlink to
"/usr/share/keyrings/ubuntukylin-archive-keyring.gpg" as an absolute
path. This obviously doesn't work when not chrooted into the chroot but
we don't need to copy it over to the apt config used to build the pool
as no package from any archive signed by this key is going to be
included in the pool...