Skip to content

kerf 0.4.0

Latest

Choose a tag to compare

@github-actions github-actions released this 26 Oct 21:56

Highlights

This release adds kerf exec, which runs a command inside a running instance the way docker exec does, served by kerf-init over the multikernel vsock transport. Booting an instance moves to kerf start. It also adds kerf sign for hosts that enforce kexec signatures, reworks how kerf update grows and shrinks memory to match what the kernel actually does, and ships kerf as deb and rpm packages.

Breaking changes

  • kerf exec no longer boots an instance; use kerf start, as with docker start
  • kerf create and kerf update drop --memory-base. The kernel always placed the memory itself, so the base was never used
  • kerf load now passes console=mktty0 by default. Pass --console=ttynull (needs CONFIG_NULL_TTY in the spawn kernel) or a console= in --cmdline to choose otherwise

kerf exec

  • Run a command inside an instance with -i, -t, -e, -w and -u, and its exit status passed through
  • -u names are resolved against the instance rootfs on the host, so kerf-init never parses passwd or group files
  • kerf-init serves exec on vsock port 1023, one session process per connection, and accepts only host root from a reserved port
  • Stdin is flow controlled, so a command that does not read its stdin cannot hold up signals, resizes or disconnect
  • The terminal is restored on SIGTERM and SIGHUP, and a closed stdout exits 141 like SIGPIPE instead of printing a traceback
  • PID 1 never blocks in accept

kerf sign

  • Append a module-format PKCS#7 signature to a spawn kernel's ELF vmlinux, extracting it from a bzImage when needed, with an RSA or ECDSA key
  • kerf load warns when it loads an unsigned bzImage on a host that enforces signatures, and explains signature errors from kexec_file_load(), including EPERM from lockdown

kerf update

  • Shrink an instance by removing its newest whole regions, as the kernel requires, instead of cutting one range from its base
  • Grow an instance wherever a pool chunk has room, naming the highest free range so it stays clear of boot memory and a spawn kernel's padding
  • Align growth to the memory granule the kernel publishes in its device tree, and refuse a size that is not a multiple of it before asking the kernel
  • Any region with nothing allocated in it can leave an instance, not only those added after creation

kerf load

  • Default the console to mktty0, so kerf start --console works without extra flags

Parser

  • Read each PCI bus of a tree as a root bus of its own, following the kernel's flatter host bridge layout; trees from older kernels with bridges still parse

Build and packaging

  • kerf-init is rebuilt from source whenever the package is built, so no wheel or install carries a stale binary. Building from source now needs musl-gcc
  • The PyPI wheel is tagged py3-none for manylinux and musllinux, since the static kerf-init is its only native code
  • Releases now include deb and rpm packages that install under /usr/lib/kerf and use the distro's Python

Full Changelog: v0.3.0...v0.4.0