Skip to content

florianl/bluebox

Repository files navigation

bluebox Go Go Reference

bluebox is intended to fast build a low overhead environment to be able to run tests against Linux kernel APIs like netlink or ebpf. It embeds given statically linked executables into the resulting archive. In a virtual environment with this archive the embedded executables will be executed in a sequential order. bluebox does not provide a shell or other executables.

Installation

$ go install github.com/florianl/bluebox@latest

API

Note: APIs subject to change while bluebox is still in an experimental phase. You can use it but we suggest you pin a version with your package manager of choice.

Example usage

In the following example qemu-system-x86_64 is required to start the virtual environment. For the kernel image a self compiled kernel or a prepared kernel like they are offered by github.com/cilium/ci-kernels can be used. If the kernel is compiled for a different architecture, then a different version of qemu is required as well bluebox also need to know about the target architecture.

  # Generate a very basic initial ramdisk
$ bluebox -o my-initramfs.cpio
  # Boot a kernel in a virtual environment with the generated archive
$ qemu-system-x86_64 -m 4096 -kernel my-linux.bz -initrd my-initramfs.cpio

A more detailed example of how bluebox can be used is given in EXAMPLE.md.

Requirements

A version of Go that is supported by upstream

Similar projects