ADR-0004: Native Debian & UKI Dual Packaging Architecture¶
Date: 2026-09-10
Status¶
Accepted
Context¶
Kernels compiled by cordanaLLM/nucleus are consumed across two fundamentally different deployment patterns:
- Standard Cloud & Virtual Machine Instances (
cordanaLLM/imago): - VM flavors (Proxmox VE, VMware, KVM, Docker, Kubernetes) rely on standard Debian/Ubuntu package managers (
apt,dpkg). - Third-party out-of-tree drivers (e.g. OpenZFS 2.3, NVIDIA Open Kernel Modules) require matching C development headers (
linux-headers) to compile kernel modules via DKMS during golden image provisioning. - High-Assurance Bare-Metal & Confidential Computing:
- Modern bare-metal clusters, edge appliances, and confidential computing microVMs require Unified Kernel Images (UKI).
- Traditional
/bootpartitions containing separate kernel binaries (vmlinuz), initial ramdisks (initrd.img), and bootloader configurations (grub.cfg) are vulnerable to tampering: an attacker with disk write access can modify the initramfs or inject malicious kernel cmdline parameters (init=/bin/sh) without breaking UEFI Secure Boot signatures onvmlinuz.
Decision¶
We establish a Dual Packaging Architecture delivering both package formats from every kernel build:
graph TD
BUILD["Hermetic Compilation (vmlinux & modules)"] --> PKG_DEB["Debian Packaging Engine (bindeb-pkg)"]
BUILD --> PKG_UKI["systemd-ukify Synthesis Engine"]
PKG_DEB --> DEB1["linux-image-*.deb"]
PKG_DEB --> DEB2["linux-headers-*.deb (DKMS Ready)"]
PKG_DEB --> DEB3["linux-libc-dev-*.deb"]
PKG_UKI --> UKI_EFI["BOOTX64.EFI (UKI Binary)"]
UKI_EFI --> SIGN["UEFI sbsign + Cosign OIDC Signature"]
DEB1 --> APT["Authenticated APT Archive (apt.example.com)"]
DEB2 --> APT
DEB3 --> APT
SIGN --> OCI["OCI Registry Artifact (ghcr.io/lusoris/kernels)"]
1. Native Debian Packaging (bindeb-pkg)¶
- Executed via upstream kernel target
make bindeb-pkg. - Generates
linux-image,linux-headers, andlinux-libc-devDebian packages. - Features reproducible localversion strings (e.g.
-lusoris1-mainstream-amd64), preventing name clashes with stock Debian/Ubuntu kernels. - Published to
https://apt.example.com/kernels/viarepreprowith GPG detached signatures.
2. Unified Kernel Images (systemd-ukify)¶
- Synthesizes a single executable UEFI PE binary conforming to the UAPI Boot Loader Specification.
- Embeds
.linux,.initrd(Dracut initramfs + CPU microcode),.cmdline,.osrel, and.sbat. - Measured into TPM 2.0 PCR 11, enabling tamper-proof disk encryption key sealing via
systemd-cryptenroll. - Signed cryptographically and published as OCI artifacts to
ghcr.io/lusoris/kernels.
Consequences¶
Positive¶
- Complete Ecosystem Coverage: Traditional cloud golden images install
.debpackages via apt; modern bare-metal systems stream signed UKI.efibinaries over iPXE or deploy to EFI system partitions. - Full DKMS Compatibility:
linux-headers-*.debprovides the full kernel build environment necessary for compiling NVIDIA 565/615 and OpenZFS 2.3 modules without full source tree checkout. - Tamper-Proof Boot Security: UKI eliminates mutable
/boot/initrd.imgtampering attacks by cryptographically binding kernel, initramfs, and cmdline into a single signed entity.
Negative¶
- Dual Pipeline Maintenance: CI must execute both Debian packaging and
ukifyassembly steps, requiringdracut,systemd-ukify,sbsign, anddpkg-devin the builder image.
Compliance¶
Enforced via automated test gates:
1. Packaging Script Audits (tests/test_scripts.py): Asserts scripts/package-deb.sh and scripts/package-uki.sh are executable, comply with set -euo pipefail, have functions $\le 60$ lines, and pass ShellCheck.
2. Artifact Verification in CI: The release pipeline verifies the generation, checksum digests, and cryptographic signatures of both .deb archives and .efi UKI binaries before dispatching release events downstream.