omea-kernel 0.1.1

Guest kernel facade for omea-vm: re-exports the x86_64 KVM kernel/init/agent asset crate.
Documentation
//! Pre-built runtime assets for [omea], packaged as a Rust crate so
//! embedders can `cargo add omea-kernel` instead of fetching binaries
//! out of band — with **no network at build time** (the bytes are
//! `include_bytes!`'d into the binary).
//!
//! ## A facade over per-arch sub-crates
//!
//! omea runs a **guest** Linux kernel matching the **host** arch (KVM
//! guest). Shipping every arch's kernel in one crate would bust the crates.io
//! ~10 MiB cap and make every consumer download kernels they can't use.
//!
//! So this crate is a thin facade. The actual bytes live in per-arch
//! sub-crates, declared as `[target.'cfg(target_arch = ...)']` dependencies:
//!
//! - [`omea-kernel-x86-64`]  — x86_64 `bzImage` + busybox + agent
//!
//! Cargo only resolves/downloads the dependency whose `cfg(target_arch)`
//! matches the **compilation target**, so building for x86_64 fetches *only*
//! other arch's multi-MiB kernel. This module re-exports the matching
//! sub-crate's public API (`KERNEL_BYTES`, `extract_kernel_to`, …) so callers
//! write arch-agnostic code:
//!
//! ```no_run
//! // Same call on any host; you get that host's guest kernel.
//! omea_kernel::extract_kernel_to(
//!     std::path::Path::new("/tmp/omea/kernel"),
//! ).unwrap();
//! ```
//!
//! ## Arch-specific surface
//!
//! Most of the API is common to both sub-crates: `KERNEL_BYTES` / `KERNEL_LEN`,
//! `OMEA_AGENT_BYTES` / `_LEN`, and the `extract_kernel_to{,_with_parents}`
//! / `extract_omea_agent_to{,_with_parents}` helpers.
//!
//! Some items exist only on one arch because the backends differ:
//!   `smpark.ko` module for multi-vCPU snapshot capture.
//! - **x86_64 only:** `BUSYBOX_BYTES` (+ `extract_busybox_to*` / `BUSYBOX_LEN`).
//!   The KVM backend builds the container rootfs (overlayfs + `switch_root`)
//!   directly in the agent initramfs, using a bundled busybox.
//!
//! Code that needs an arch-specific item should gate it with
//! `#[cfg(target_arch = "…")]` to stay portable.
//!
//! [omea]: https://crates.io/crates/omea
//! [`omea-kernel-x86-64`]: https://crates.io/crates/omea-kernel-x86-64

#[cfg(target_arch = "x86_64")]
pub use omea_kernel_x86_64::*;

// The facade only supports the arches omea itself runs on. Fail loudly
// rather than silently exporting an empty API on an unsupported target.
#[cfg(not(target_arch = "x86_64"))]
compile_error!(
    "omea-kernel supports only x86_64 (KVM) hosts; \
     no guest kernel is bundled for this target_arch"
);