Coder Social home page Coder Social logo

landhb / nixmodule Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 142 KB

Simple qemu wrapper to automatically test out-of-tree linux kernel modules against multiple kernel versions.

Rust 83.54% Shell 12.88% Makefile 1.72% C 1.86%
framework kernel linux linux-kernel lkm out-of-tree qemu qemu-kvm testing kasan

nixmodule's Introduction

NixModule cargo-badge

Simple qemu wrapper to automatically test out-of-tree linux kernel modules across multiple kernel versions. The provided images all have KASAN to aide your development.

cargo install nixmodule

Example below running it against a single kernel, running without arguments tests against every kernel in your nixmodule-config.toml:

Pre-Built Kernels

Check nixmodule-config.toml for an example configuration using all of these images.

Version BzImage Headers LTS?
5.17.2 bZimage Headers
5.15.33 bZimage Headers Yes
5.10.110 bZimage Headers Yes
5.8.9 bZimage Headers
5.4.188 bZimage Headers Yes
4.19.237 bZimage Headers Yes
4.14.275 bZimage Headers Yes
4.9.309 bZimage Headers Yes
4.4.302 bZimage Headers Yes

Pre-Built Disk Images

ImgName Link SSH Key
Cornerstone Image Key
Syzkaller Debian Buster Image Key
Syzkaller Debian Stretch Image Key

Using Other Kernels

Use the packing script

KERNEL=4.14.275 ./scripts/package.sh

This builds the required bzImage and an archive linux-$VERSION-headers.tar.gz containing the headers/module info required to build an out-of-tree kernel module.

Then add the new kernel to your configuration file nixmodule-config.toml:

[[kernels]]
version = "4.19.237"
url_base = "https://files.sboc.dev"
headers = "linux-headers/linux-4.19.237-headers.tar.gz" 
kernel = "linux-kernels/bzImage-linux-4.19.237"
runner = "qemu-system-x86_64"

[kernels.disk]
name = "stretch"
url_base = "https://files.sboc.dev"
path = "images/stretch/stretch.img"
sshkey = "images/stretch/stretch.id_rsa"
boot = "/dev/sda"

You can optionally disable kvm with:

kvm = false

And increase the boot timeout with:

timeout = 600

Without kvm you'll likely need to increase the default the timeout.

Using Other Disk Images

Fill out the [kernels.disk] entry for the kernel you'd like to use the new disk with:

[kernels.disk]
name = "stretch"
url_base = "https://files.sboc.dev"
path = "images/stretch/stretch.img"
sshkey = "images/stretch/stretch.id_rsa"
boot = "/dev/sda"

Boot should contain the partition to boot from. This is passed to qemu to append as kernel arguments:

-append "console=ttyS0 root=$BOOT earlyprintk=serial net.ifnames=0 nokaslr"

nixmodule's People

Contributors

dependabot[bot] avatar landhb avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.