Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ pull request.
`ghcr.io/hyperstructure/sandbox-kernel:<version>`, the version each fctl
release pins, and boots the file `/vmlinux` in it: an uncompressed kernel
(x86_64's ELF `vmlinux`, aarch64's `Image`) with everything built in, and
with ext4, overlayfs, virtio's MMIO devices, vsock and TAP devices, which
with ext4, overlayfs, virtio's MMIO devices, vsock, TAP devices and 9p
with its fd transport (for the package caches, from `6.18.59-1`), which
its init needs (`kernel/check.sh` checks them). Publish a tag before fctl
pins it. A tag never moves (the Kernel workflow builds no published
version again): a change to how the kernel is built takes a new version
Expand Down
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fctl's `firecracker` driver runs each session in a
image, which boots a kernel published from here too:

```sh
docker buildx imagetools inspect ghcr.io/hyperstructure/sandbox-kernel:6.18.59
docker buildx imagetools inspect ghcr.io/hyperstructure/sandbox-kernel:6.18.59-1
```

It is Linux's long-term release in [`kernel/VERSION`](kernel/VERSION),
Expand All @@ -201,13 +201,16 @@ configured as Firecracker configures its own CI's guests
[`kernel/microvm-aarch64.config`](kernel/microvm-aarch64.config), from
Firecracker's `resources/guest_configs`): every driver built in, with ext4,
overlayfs, vsock, TAP devices, cgroups, nftables and the balloon's free
page reporting. [`kernel/fctl.config`](kernel/fctl.config) adds only
`/proc/config.gz`. The image holds the kernel as `/vmlinux`, and its
configuration as `/vmlinux.config`.
page reporting. [`kernel/fctl.config`](kernel/fctl.config) adds
`/proc/config.gz`, and 9p with its fd transport, with which a sandbox
mounts its project's package caches over the VM's vsock (Firecracker has
no virtio-fs or virtio-9p). The image holds the kernel as `/vmlinux`, and
its configuration as `/vmlinux.config`.

| Tag | Kernel |
|---|---|
| `6.18.59` | Linux 6.18.59. Each fctl release pins the one its hosts boot. A tag never moves: a change to how the kernel is built takes a new one, `6.18.59-2` for the same release. |
| `6.18.59-1` | Linux 6.18.59 with 9p, for the package caches. Each fctl release pins the one its hosts boot. A tag never moves: a change to how the kernel is built takes a new one, `6.18.59-2` for the same release. |
| `6.18.59` | Linux 6.18.59, without 9p: the one fctl pinned before. |
| `6.18` | The newest 6.18 built here. |

```sh
Expand Down
2 changes: 1 addition & 1 deletion kernel/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.18.59
6.18.59-1
15 changes: 11 additions & 4 deletions kernel/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Boots the kernel at $1 in Firecracker, as fctl's firecracker driver boots
# its sandboxes (an initramfs, a drive, a vsock), and checks that it reaches
# userspace with what fctl-agent's init needs: virtio's MMIO devices, its
# drive mounted as ext4 with an overlay on it, vsock's transport and TAP
# devices. Needs /dev/kvm and mkfs.ext4; without KVM, says so and checks
# nothing.
# drive mounted as ext4 with an overlay on it, vsock's transport, TAP
# devices and 9p with its fd transport. Needs /dev/kvm and mkfs.ext4;
# without KVM, says so and checks nothing.
set -euo pipefail

kernel=$(realpath "$1")
Expand Down Expand Up @@ -61,6 +61,13 @@ grep -q hello /merged/hello 2>/dev/null || missing "the drive's file through the
ls /sys/bus/virtio/drivers/vmw_vsock_virtio_transport 2>/dev/null | grep -q virtio ||
missing "vsock's virtio transport"
[ -e /dev/net/tun ] || missing /dev/net/tun
# 9p and its fd transport, with which the VM mounts the package caches the
# host serves over its vsock. A mount over /dev/null fails, but without the
# transport the kernel says it can't find it.
grep -qw 9p /proc/filesystems || missing 9p
mkdir -p /share
mount -t 9p -o trans=fd,rfdno=0,wfdno=1 none /share </dev/null >/dev/null 2>&1
dmesg | grep -q "Could not find request transport" && missing "9p's fd transport"
echo "fctl-kernel: booted $(uname -r)"
reboot -f
INIT
Expand Down Expand Up @@ -89,4 +96,4 @@ if grep -q "fctl-kernel: no" console.log; then
echo "The kernel lacks what fctl-agent's init needs." >&2
exit 1
fi
echo "Booted in Firecracker $firecracker_version: a drive with ext4 and an overlay on it, vsock's transport and TAP devices work."
echo "Booted in Firecracker $firecracker_version: a drive with ext4 and an overlay on it, vsock's transport, TAP devices and 9p's fd transport work."
8 changes: 8 additions & 0 deletions kernel/fctl.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@
# know what their sandbox's kernel can do.
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y

# 9p over a file descriptor (trans=fd), for the package caches a project's
# sandboxes share: the host serves them over the VM's vsock, and fctl-agent
# mounts the connection at /var/cache/fctl. Firecracker has no virtio-fs or
# virtio-9p.
CONFIG_NET_9P=y
CONFIG_NET_9P_FD=y
CONFIG_9P_FS=y