Skip to content

packaging: our kernel, amdxdna and the AXB35 EC as deb, rpm and Arch packages, with the NPU config (Fixes #1280) - #1297

Merged
bong-water-water-bong merged 3 commits into
mainfrom
1bit/kpkg-1280
Nov 6, 2026
Merged

bong-water-water-bong merged 3 commits into
mainfrom
1bit/kpkg-1280

Conversation

@bong-water-water-bong

@bong-water-water-bong bong-water-water-bong commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1280.

The engine package is userspace only; the NPU and the board's EC need the kernel side too, and until now
that side existed only as 1bit OS's own build. This adds the package set: one script, one staged payload
per package, three families.

package deb rpm Arch
kernel (from the OS build's own debs) linux-image-7.4.0-rc1-1bit + linux-headers-… 1bit-kernel + 1bit-kernel-devel linux-1bit + linux-1bit-headers
our amdxdna amdxdna-1bit-dkms same same
the AXB35 EC driver ec-su-axb35-dkms same same
memlock + keep-awake udev + modules-load + public MOK cert 1bit-npu-config same same

The drivers are DKMS source, not binaries. amdxdna-1bit-dkms is amd/xdna-driver at 526c6081 plus
third_party/patches/amdxdna 0001,0002,0004,0005,0003 — the series the c26 image and this box run. 0006
and 0007 stay carried and unapplied here: loading them is the owner's call (engine#812), so a package
does not decide it. They build against your kernel headers through dkms and sign with your MOK, land in
/lib/modules/<ver>/updates/ (Debian, Arch) or /extra/ (Fedora) — in front of the in-tree amdxdna — and
uninstalling puts the in-tree driver back.

ec-su-axb35-dkms is GPL-2.0 upstream cmetz/ec-su_axb35-linux at f62c2c22 (source shipped in the
package) plus the one patch the issue asks for: it attaches only on an AXB35 board
(dmi_get_system_info(DMI_BOARD_NAME), third_party/patches/ec_su_axb35/0001), so having it installed on
any machine is inert.

The kernel is not rebuilt three times: rpm and Arch carry the deb payload in that family's layout, so all
three families ship the same bits.

Measured

  • the kernel payload is the kernel this box runs: its vmlinuz is sha256 6f3c6764…, byte-identical to
    /boot/vmlinuz-7.4.0-rc1-1bit, and sbverify --cert MOK-Kernel.der → Signature verification OK
  • the dkms payload reproduces the driver this box runs: a container build against 7.0.0-43-generic comes
    out at srcversion EE1F36A2B9BA294CE11AD80, the srcversion of the installed
    /lib/modules/7.4.0-rc1-1bit/updates/amdxdna.ko
  • scripts/pkg-proof.sh, 22 rows per family, clean container of that family: install → dkms builds and
    installs both modules against the container's own headers → modprobe --show-depends amdxdna resolves to
    the dkms build, not the in-tree one → the AXB35 gate string is in the built EC module → the kernel package
    installs with its payload and build tree → uninstall leaves nothing and a clean dkms status
family container headers it built against rows
deb ubuntu:26.04 7.0.0-43-generic 24/24 PASS
rpm fedora:latest (fc45) 7.2.15-300.fc45.x86_64 22/22 PASS
arch archlinux:latest 7.2.14-arch1-1 22/22 PASS

(PROOF-RC=0 in all three; deb has two extra rows — the kernel image is present and sbverifys against
the shipped certificate.)

  • hardware row: this box, npu-hold, read-only, two tickets of 2 s and 5 s of token time. 1bit serve --device npu on Qwen3-0.6B, /v1/completions greedy, twice: The capital of France is →
    Paris. The capital of Italy is Rome. The capital of Spain is Madrid. identically on both runs
    (56.9 / 50.7 tok/s, load 2.2 s), 0 amdxdna lines in both windows, and the loaded module is
    srcversion EE1F36A2B9BA294CE11AD80 — the build this package's source produces in a container. No
    install, no modprobe, no udev reload, nothing outside /tmp. For the record: a ring-buffer count of
    amdxdna errors reads 9, all at 17:12:45–46 — between the two probes, Populate ranges failed, ret -14 (the engine#812 signature), another lane's work, not mine.

Not in this PR, deliberately

No release and no upload. No weekly-release wiring (scripts/weekly.sh calling the new script is #1279's
cadence and pi-pkg's call), no AUR entry, and no bootloader integration: the doc gives
depmod/dracut/mkinitcpio -P and leaves grub/systemd-boot to the distribution's own tooling. rpm and
Arch kernel packages are unsigned until the release pipeline signs them, which the doc says plainly
(dnf install --nogpgcheck, zypper --allow-unsigned-rpm, pacman's warning).

The MOK private key is not in this PR and cannot be: the packages ship only the public certificate, and
scripts/mk-kernel-packages.sh refuses a --mok-cert whose text carries PRIVATE KEY.

Docs are in the same PR: docs/install-any-distro.md gets the per-family install, the Secure Boot step, the
source offer and six measured rows; docs/kernel.md's out-of-tree-modules bullet names the two dkms packages.

bong-water-water-bong and others added 2 commits November 6, 2026 17:06
…packages, with the NPU config (#1280)

The engine package is userspace only; the NPU and the board's EC need the kernel side
too, and until now that side existed only as 1bit OS's own build. This adds the package
set, one script, one staged payload per package, three families:

  kernel   linux-image/linux-headers (deb, the OS build's own), 1bit-kernel +
           1bit-kernel-devel (rpm), linux-1bit + linux-1bit-headers (Arch)
  drivers  amdxdna-1bit-dkms: amd/xdna-driver at 526c6081 plus third_party/patches/amdxdna
           0001,0002,0004,0005,0003 — the series the c26 image and this box run; 0006/0007
           stay carried and unapplied, because loading them is the owner's call
           ec-su-axb35-dkms: the AXB35-02 EC driver (GPL-2.0, upstream f62c2c22) plus a DMI
           gate, so it attaches only on an AXB35 board and is inert everywhere else
  config   1bit-npu-config: unlimited memlock, the NPU keep-awake udev rule, modules-load.d
           for the EC, and the PUBLIC kernel MOK certificate

Both drivers build through dkms against the user's own kernel headers and sign with the
user's own MOK, which is what makes them work on a distribution kernel and not only on
ours; they land in updates/ (Debian, Arch) or extra/ (Fedora), in front of the in-tree
amdxdna, and uninstalling puts the in-tree driver back.

The kernel is not rebuilt three times: rpm and Arch carry the deb payload in that family's
layout, so all three families ship the same bits. Measured: the payload's vmlinuz is
sha256 6f3c6764..., byte-identical to /boot/vmlinuz-7.4.0-rc1-1bit here, and sbverify says
Signature verification OK against the certificate in 1bit-npu-config.

scripts/pkg-proof.sh proves each family in a clean container of that family: install, build
both modules against the container's own headers, amdxdna resolving ahead of the in-tree
one, the DMI gate in the built EC module, the kernel package's payload and build tree, then
uninstall. 22/22 rows PASS on ubuntu:26.04, fedora (fc45) and archlinux.

No private key is packaged, printed or committed; the script refuses a --mok-cert that
carries one. Nothing was installed, removed or reloaded on this box, and no release or
upload is part of this change: docs/install-any-distro.md carries the per-family install,
the Secure Boot step and the measured rows.

Fixes #1280
@bong-water-water-bong
bong-water-water-bong merged commit 82bae01 into main Nov 6, 2026
8 of 9 checks passed
@bong-water-water-bong
bong-water-water-bong deleted the 1bit/kpkg-1280 branch November 6, 2026 21:14
@bong-water-water-bong

Copy link
Copy Markdown
Collaborator Author

#1297 ready for review at 38a01869 — scripts/mk-kernel-packages.sh (the five packages × deb/rpm/Arch from one staged payload each), scripts/pkg-proof.sh (the per-family proof), third_party/patches/ec_su_axb35/0001 (the AXB35 DMI gate the issue asks for), docs in the same PR.

Measured, same three clean containers, PROOF-RC=0 in all three: deb 24/24, rpm 22/22, arch 22/22 rows PASS — install, dkms builds both modules against the container's own headers, amdxdna resolves to the dkms build ahead of the in-tree one, the gate is in the built EC module, the kernel package's payload and build tree, uninstall leaves nothing. The kernel the packages ship is the kernel this box runs (payload vmlinuz sha256 6f3c6764…, sbverify clean against the certificate in 1bit-npu-config), and the dkms source reproduces the running driver (srcversion EE1F36A2B9BA294CE11AD80). Hardware row: NPU known answer Paris. The capital of Italy is Rome. The capital of Spain is Madrid. twice, identical, 0 amdxdna lines in both windows, under npu-hold, nothing installed or reloaded.

Two things a reviewer should push back on if they disagree: (1) rpm and Arch carry the deb's kernel payload rearranged rather than rebuilding the kernel twice — one kernel, three formats, no drift; (2) 0006/0007 are deliberately not applied in the dkms package (owner-gated, engine#812), so the package ships the series the c26 image and this box run. No release, no upload; the rpm/Arch kernel packages are unsigned until the release pipeline signs them, and the doc says so with the --nogpgcheck line.

bong-water-water-bong added a commit that referenced this pull request Nov 7, 2026
… submodule check (#1324)

The #1297 squash captured a mid-state of the branch: scripts/mk-kernel-packages.sh
landed in its pre-shellcheck form and scripts/pkg-proof.sh without the EC-gate fix, so
main's gate row is the string-only form that failed true-false on Arch, and
docs/install-any-distro.md still says 22/22 rows with the take-1 hardware wording.
This ports the two follow-up commits that the squash dropped and adds one new fix:

* mk-kernel-packages.sh: the lint set (split assignments, the arch tar array, the rpm
  echo), and the submodule check. `git -C third_party/xdna-driver rev-parse HEAD` on an
  UNINITIALIZED submodule walks up to the enclosing repository, so a plain clone of main
  reported the driver as 'at 0f45221' (the engine's commit) instead of 'not
  initialized'. The toplevel must now be the driver directory itself, and the failure
  names `git submodule update --init third_party/xdna-driver`.
* pkg-proof.sh: the EC gate row decompresses to a file and accepts the undefined
  `dmi_get_system_info` reference or the message (grep -q on a pipe ends it early and
  pipefail then fails the row with the match in hand — measured on arch); the Arch
  `vmlinuz-1bit` row; `krel` as a constant; the leftover-module count as a loop.
* docs: 'all 24 / all 22 / all 22 rows PASS' and the take-2 known-answer row
  (/v1/completions, twice, identical). pi-pkg's edits in the same file are untouched.

Verified: a clean clone of main with the submodule initialized builds all five debs
(kernel payload hashes unchanged); without it, the new message. Re-proved deb and arch
from the repaired script in their containers.

Refs #1280

Co-authored-by: bong-water-water-bong <bong-water-water-bong@1bit.gg>
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.

packages: our kernel (7.4.0-rc1-1bit), amdxdna and ec_su_axb35 drivers as .deb/.rpm/Arch packages (DKMS), with the NPU config

1 participant