Skip to content

SDK built by CI (ecosystem step E2)

Status: design and expectations, 2026-11-09, written before the workflow exists (owner-approved step E2 of the HAVEN ecosystem plan; owner rules of 2026-11-09: CI first, CI outputs private, protected main).

Today the kernel that KDAL’s CI and HAVEN’s Linux runs use was built by ELMOS on the owner’s Mac and uploaded by hand as public releases (demo-linux-v6.18-1 here, ci-kernel-v6.18-kunit in KDAL). The Mac’s resources are limited, a hand-made release cannot be rebuilt by anyone else, and its version string carries the build machine’s user and host name. The SDK moves that build to GitHub Actions and publishes it where only the three project repositories can read it.

.github/workflows/sdk.yml, on workflow_dispatch and on pushes to main that change sdk/ or the workflow (not on every push: a kernel build is long):

  1. Kernel: Linux 6.18 from kernel.org (tarball hash checked against the value pinned in sdk/versions.env), arm64 defconfig plus the fragment sdk/kernel.cfg (CONFIG_KUNIT=y, as today’s releases), built with LLVM natively on GitHub’s arm64 runner (ubuntu-24.04-arm), with KBUILD_BUILD_USER=haven, KBUILD_BUILD_HOST=ci and a fixed KBUILD_BUILD_TIMESTAMP. Outputs: Image.gz, config, Module.symvers, kernel.release (the files KDAL’s scripts/ci/kernel-prepare.sh reads today).
  2. Root filesystem: elmos rootfs create (OCI engine, alpine:3, the same /init), built from this commit, in a fresh ELMOS workspace on the runner; output rootfs.ext4.gz.
  3. Smoke boot: the kernel and root filesystem in QEMU virt (cortex-a72, two CPUs, TCG) on the runner, until the kernel runs /init.
  4. Manifest: manifest.json (Linux version and tarball hash, config hash, ELMOS commit, build user and host, file hashes) and SHA256SUMS.
  5. Publish: the files as one OCI artifact with oras to ghcr.io/nguyentrongphuc552003/elmos-sdk:linux-6.18-<run number> (and :linux-6.18), with GITHUB_TOKEN (packages: write). A GHCR package is private when first published and does not take the repository’s visibility; it is linked to this repository by the org.opencontainers.image.source annotation so it inherits its access permissions. KDAL and HAVEN read it after the owner grants them Read access in the package settings (step E3 uses that).
  6. Privacy check: an anonymous fetch of the manifest is expected to be refused, and the workflow fails if it is not.
Check Expected
S1: dispatched run on ubuntu-24.04-arm succeeds; the kernel build takes under 90 minutes (prediction, recorded either way)
S2: version string in the built Image Linux version 6.18.0 with (haven@ci); no personal user or host name
S3: root filesystem on a Linux runner elmos rootfs create works there (risk: ELMOS was used on macOS until now; if it fails, the reason is recorded and the rootfs step is fixed or deferred, not faked)
S4: smoke boot the kernel log shows Run /init as init process within 5 minutes
S5: package elmos-sdk exists in GHCR with visibility private (GitHub API) and the run’s tag
S6: anonymous fetch refused (HTTP 401 or 403)
S7: contents SHA256SUMS matches the files; manifest.json names this commit
S8: nothing public no release, no Actions artifact, no public link is created

Results are added below after the first run.

Run 1 (2026-11-09, commit 8ba6332, started by the merge push)

Section titled “Run 1 (2026-11-09, commit 8ba6332, started by the merge push)”
Check Observed Verdict
S1 the kernel build took 2311 s (38.5 minutes) on 4 CPUs; the run failed later, at the smoke boot build time as expected; the run did not succeed
S2 Linux version 6.18.0 (haven@ci) (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD 18.1.3) # SMP PREEMPT 2026-01-01 00:00:00 UTC as expected
S3 sdk/rootfs wrote out/rootfs.ext4 in 13 s on the Linux runner as expected (the risk did not occur)
S4 QEMU stopped at once: failed to find romfile "efi-virtio.rom" not as expected
S5 to S8 not reached (steps skipped) not judged

S4: QEMU’s default network card loads an iPXE ROM from the ipxe-qemu package, which --no-install-recommends leaves out. The smoke boot needs no network, so it now runs with -nic none (the ROM is not installed).

Correction to pull request #9. Its message said GitHub runs bash with pipefail, so strings Image | grep -m1 would fail the kernel build step. Run 1 shows the default shell is bash -e {0}, without pipefail, and the step passed: that bug did not exist. The change is kept because it is harmless and makes the step safe if shell: bash (which adds pipefail) is ever set. The second fix in #9 (the manifest step not seeing sdk/versions.env) was needed and is not yet observed. Run 2 (commit cebfa4d) was cancelled during its kernel build because it still had the S4 failure.

Run 3 (2026-11-09, commit ba1653d, started by the merge push)

Section titled “Run 3 (2026-11-09, commit ba1653d, started by the merge push)”
Check Observed Verdict
S1 kernel build 2443 s (40.7 minutes) on 4 CPUs; the run failed at the privacy check build time as expected; the run did not succeed
S2 Linux version 6.18.0 (haven@ci) (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD 18.1.3) # SMP PREEMPT 2026-01-01 00:00:00 UTC as expected
S3 sdk/rootfs wrote the root filesystem on the Linux runner as expected
S4 Run /init as init process at 4.4 s of kernel time as expected
S5 elmos-sdk:linux-6.18-3 pushed (manifest digest sha256:b92524371cfc...), tagged linux-6.18; visibility public not as expected
S6 the workflow’s logged-out fetch succeeded (“the package can be fetched without credentials: it is public”); an anonymous token request and manifest fetch from another host returned HTTP 200 not as expected
S7 SHA256SUMS was written and pushed; not yet checked against a pulled copy not judged
S8 no release and no Actions artifact were created, but the package itself is publicly readable not as expected

What was exposed: the kernel (Image.gz, built from the public 6.18 tarball with the neutral build names), its config, Module.symvers and kernel.release, the Alpine root filesystem with ELMOS’s /init, the manifest (ELMOS commit, run number, runner type) and SHA256SUMS. No personal name, path or credential is in them.

Design error: the design assumed a GHCR package is private when it is first published. It was public at once. The cause is not confirmed; the likely one is that the package is linked to this public repository by the org.opencontainers.image.source annotation. The privacy check ran after the upload, so it could only report the exposure, not prevent it.

Status: SDK publishing is paused (no run is started by hand and nothing under sdk/ or the workflow changes) until the owner has made the package private or deleted it. Proposed change before the next run: push an empty probe tag first and stop before uploading anything if an anonymous fetch of the probe succeeds; if the package has to be deleted, also drop the repository-link annotation.

Run 4 (2026-11-09, commit 4eb897c, dispatched after the owner made the package private)

Section titled “Run 4 (2026-11-09, commit 4eb897c, dispatched after the owner made the package private)”

The owner set elmos-sdk to private and gave kdal and haven Read access. An anonymous token and manifest request for linux-6.18-3 then returned HTTP 403 (it was 200 before).

Check Observed Verdict
S1 the run succeeded; kernel build 40.4 minutes as expected
S2 Linux version 6.18.0 (haven@ci) (in the manifest) as expected
S3 root filesystem built in 18 s as expected
S4 Run /init as init process found; the step always lasts the full 300 s because /init does not power the machine off as expected
S5 elmos-sdk:linux-6.18-4 pushed and tagged linux-6.18; private (anonymous fetch refused) as expected
S6 the workflow’s logged-out fetch was refused as expected
S7 KDAL’s CI pulled the package and sha256sum -c SHA256SUMS passed; the manifest names commit 4eb897c and run 4 as expected
S8 no release, no Actions artifact; the package is private as expected

The probe-before-upload change proposed after run 3 is not made: the package’s visibility is now set, and a new package name would need it.

Smoke boot ends when /init is done (design and expectations, 2026-11-13)

Section titled “Smoke boot ends when /init is done (design and expectations, 2026-11-13)”

Written before the change (owner-approved maintenance item 2 of the ELMOS positioning note).

Problem. The smoke boot always lasts the full timeout 300 (run 4, S4: the step took 5 min 5 s): ELMOS’s embedded /init (assets/templates/init/init.sh.tmpl) ends with exec /bin/sh, so the guest waits for input that never comes, and the step’s || true hides whether QEMU exited or was killed.

Change.

  • /init: just before exec /bin/sh, if the kernel command line has elmos_poweroff=1 (the kernel passes such a parameter, which has no dot, to init’s environment), print elmos: elmos_poweroff=1, powering off. and power off (poweroff -f, else the sysrq o trigger). Without the parameter nothing changes: users still get the shell.
  • sdk.yml, smoke boot: the command line gains elmos_poweroff=1; QEMU’s exit status is printed and must be 0 (a timeout, status 124, now fails the step); besides Run /init as init process, the log must contain the power-off line.
  • CHANGELOG.md: one line under Changed.

The SDK workflow runs only on pushes to main that touch sdk/** or the workflow, so the change is checked by the run that its merge starts (run 5). It publishes elmos-sdk:linux-6.18-5 (private, as run 4) and moves linux-6.18; KDAL and HAVEN stay pinned to run 4.

Check Expected
P1: the change’s pull request CI green (Go tests and build unchanged)
P2: run 5 succeeds
P3: boot.log Run /init as init process, System ready., then elmos: elmos_poweroff=1, powering off.; QEMU exit status 0
P4: smoke step time under 90 s (run 4: 5 min 5 s)
P5: the rest of the run S1 to S8 as in run 4 (kernel haven@ci, package private, no release or artifact); only the root filesystem’s /init differs

Results: run 5 (2026-11-13, commit 8ae1437, started by the merge of #15)

Section titled “Results: run 5 (2026-11-13, commit 8ae1437, started by the merge of #15)”
Check Observed Verdict
P1 pull request #15 merged with every check green as expected
P2 run 5 succeeded as expected
P3 Run /init as init process, System ready., elmos: elmos_poweroff=1, powering off., reboot: Power down; the step’s own check passed (the exit status itself is not printed) as expected
P4 smoke step 9 s (01:50:18 to 01:50:27 UTC) as expected (run 4: 5 min 5 s)
P5 kernel Linux version 6.18.0 (haven@ci), build 2347 s on 4 CPUs; elmos-sdk:linux-6.18-5 pushed and linux-6.18 moved to it; anonymous fetch refused; no release or artifact as expected

HAVEN and KDAL keep using linux-6.18-4, pinned by digest in HAVEN’s ecosystem.lock.json and by tag in KDAL’s CI; moving them to run 5 is a reviewed change in those repositories.