Skip to content

Testing new stable kernel by ermine breeder

Masami HIRAMATSU edited this page Jun 28, 2017 · 1 revision

Since the ermine-breeder mounts work/ directory on /mnt and run work/run.sh automatically, it can be used for testing new/stable kernel.

Preparation

At first you need to build the target kernel by ermine-breeder, which is currently supports x86(64,32), arm(64,32), as below (e.g. making arm64 kernel).

 $ cd mincs
 $ ./ermine-breeder --arch arm64

This downloads the latest stable kernel from kernel.org and build it. If you would like to use your local source tree (yes, that's what you really need), write ermine.config and setup LINUX_URL as below, before building.

LINUX_URL=file://somewhere/to/linux

If you need to setup(enable) some kconfigs, you can do it by defining user_configure_kernel() in ermine.config as below.

user_configure_kernel() {
  kconfigs_y REQUIRED_FEATURE1 REQUIRED_FEATURE2
  kconfigs_n DISABLED_FEATURE1 DISABLED_FEATURE2
  kconfig_string STRING_FEATURE "configure-string"
}

And run ./ermine-breeder --rebuild [--arch ARCH].

After building the kernel, please do a testrun to check the kernel image is bootable, e.g.

 $ ./ermine-breeder testrun --arch arm64

Run tests

To run tests, you can choose 2 way, running the test in container, or running the test out of container (directly on ermine OS).

Run tests in container

To run the tests in container environment, you can use minc command with --qemu. The advantage of this method is that you can use your own rootfs for test.

 $ sudo ./minc --qemu --arch arm64 --bind somewhere/test/is:/opt bash
 # cd /opt
 # run-test-command

Run tests out of container (in qemu)

You can also run your tests directly on ermine OS by ermine-breeder testrun. However, since the ermine OS only has busybox, your test apps maybe linked statically or written by shellscript.

At first, you need to copy your test tools under work/ directory, and run the ermine-breeder. For example, run the ftracetest (which is written by shellscript and core-utils).

 $ cp -r somewhere/linux/kernel/tools/testing/selftests/ftrace work/
 $ ./ermine-breeder testrun
 [...]
 # cd /mnt/ftrace/
 # mount -t debugfs debugfs /sys/kernel/debug
 # ./ftracetest
Clone this wiki locally