Skip to content

docs(lib): preload-gate example + Library mode README section#58

Merged
ErenAri merged 1 commit into
mainfrom
docs/library-mode-example
Jun 27, 2026
Merged

docs(lib): preload-gate example + Library mode README section#58
ErenAri merged 1 commit into
mainfrom
docs/library-mode-example

Conversation

@ErenAri

@ErenAri ErenAri commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

Addresses two things:

  1. "Library mode" was missing from the README and the Go import path had no working destination (people clicking github.com/kernel-guard/bpfcompat/pkg/bpfcompat or pkg.go.dev hit a 404 — it's a module path, not a web URL, and pkg.go.dev hasn't indexed it). Fixed by adding a Library mode section that links the real, browsable package source (/tree/main/pkg/bpfcompat, 200) and pkg/bpfcompat/README.md.

  2. A real program using library mode, with screenshots. New runnable examples/preload-gate — a bpfman-style pre-load gate built on ValidateBeforeLoad (real load on the node's own kernel, no VM). The README section embeds:

    • the program (code screenshot)
    • a real run: a good object loads (exit 0), a CO-RE failure is blocked with the kernel's own verdict + classification (exit 1)

Both screenshots are from actual runs on this host (kernel 6.17.0-35-generic).

Also bumps the stale install VER=v0.1.6v0.2.0.

go build ./... green; examples/preload-gate builds with and without -tags hostload and runs as shown.

🤖 Generated with Claude Code

Adds examples/preload-gate — a complete, runnable program using
pkg/bpfcompat.ValidateBeforeLoad as a bpfman-style pre-load gate (real load on
the node's own kernel, no VM). New README "Library mode" section embeds the
program and a real pass/blocked run (screenshots), and links the working
package source + pkg/bpfcompat/README.md. Bumps the stale install VER to v0.2.0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ErenAri ErenAri merged commit d0c52a0 into main Jun 27, 2026
7 of 8 checks passed
@ErenAri ErenAri deleted the docs/library-mode-example branch June 27, 2026 16:23
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.

1 participant