Skip to content

Latest commit

 

History

History
57 lines (46 loc) · 1.57 KB

README.md

File metadata and controls

57 lines (46 loc) · 1.57 KB

Linux-loader

Short-description

  • Parsing and loading vmlinux (raw ELF image) and bzImage images
  • Linux command line parsing and generation
  • Definitions and helpers for the Linux boot protocol

How to build

cd linux-loader
cargo build

Tests

Our Continuous Integration (CI) pipeline is implemented on top of Buildkite. For the complete list of tests, check our CI pipeline.

Each individual test runs in a container. To reproduce a test locally, you can use the dev-container on both x86 and arm64.

container_version=5
docker run -it \
           --security-opt seccomp=unconfined \
           --volume $(pwd):/linux-loader \
           rustvmm/dev:v${container_version}
cd linux-loader/
cargo test

bzImage test

As we don't want to distribute an entire kernel bzImage, the load_bzImage test is ignored by default. In order to test the bzImage support, one needs to locally build a bzImage, copy it to the src/loader directory and run cargo test:

# Assuming your linux-loader and linux-stable are both under ${LINUX_LOADER}:
git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git ${LINUX_LOADER}/linux-stable
cd linux-stable
make bzImage 
cp linux-stable/arch/x86/boot/bzImage ${LINUX_LOADER}/linux-loader/src/loader/
cd ${LINUX_LOADER}/linux-loader
container_version=5
docker run -it \
           --security-opt seccomp=unconfined \
           --volume $(pwd):/linux-loader \
           rustvmm/dev:v${container_version}
cd linux-loader/
cargo test