Files
linuxkit/test/kmod/run_test.sh
Rolf Neugebauer 6cfadcd26e test: Add a simple test/example for compiling a kernel module
The test is currently not hooked up, but it pulls the latest 4.9.x
kernel image, builds a simple kernel module against it and then creates
a test package containing the kernel module and a shell script.

The shell script prints out the 'modinfo' and then tries to 'insmod'
the module. It checks the output of 'dmesg' of the load succeeded.

Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
2017-05-03 16:46:12 +01:00

11 lines
241 B
Bash
Executable File

#! /bin/sh
# Make sure we have the latest kernel image
docker pull linuxkit/kernel:4.9.x
# Build a package
docker build -t kmod-test .
# Build a LinuxKit image with kernel module (and test script)
moby build kmod
# Run it
linuxkit run kmod