NixModule 
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.
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
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:
[[]]
= "4.19.237"
= "https://files.sboc.dev"
= "linux-headers/linux-4.19.237-headers.tar.gz"
= "linux-kernels/bzImage-linux-4.19.237"
= "qemu-system-x86_64"
[]
= "stretch"
= "https://files.sboc.dev"
= "images/stretch/stretch.img"
= "images/stretch/stretch.id_rsa"
= "/dev/sda"
You can optionally disable kvm with:
= false
And increase the boot timeout with:
= 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:
[]
= "stretch"
= "https://files.sboc.dev"
= "images/stretch/stretch.img"
= "images/stretch/stretch.id_rsa"
= "/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"