Fixes #144 Current kata containers can't run with kernel 4.1 built from current x86 config, it will report error: ``` $ docker run -ti --runtime kata busybox sh docker: Error response from daemon: oci runtime error: rpc error: code = Internal desc = Could not run process: container_linux.go:348: starting container process caused "process_linux.go:402: container init caused \"open /dev/ptmx: no such file or directory\"". ``` This is caused by bogus devpts mount options. When run container with docker, docker will assign a default devpts mount for every container which equals to command below: ``` $ mount -t devpts -o nosuid,noexec,newinstance,ptmxmode=0666,mode=0620,gid=5 \ devpts /dev/pts ``` This requires kernel config `CONFIG_DEVPTS_MULTIPLE_INSTANCES=y` to work properly under kernel-4.1, but this option is already removed from latest kernel. It's better to add it back for support older kernel than current 4.14. Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
Build Kata Containers Kernel
This document explains the steps to build a compatible kernel with Kata Containers. To do this use build-kernel.sh, this script automates the process to build a kernel for Kata Containers.
Setup kernel source code
./build-kernel.sh setup
The script ./build-kernel.sh
tries to apply the patches from
${GOPATH}/src/github.com/kata-containers/packaging/kernel/patches/
when it
sets up a kernel. If you want to add a source modification, add a patch on this
directory.
The script also adds a kernel config file from
${GOPATH}/src/github.com/kata-containers/packaging/kernel/configs/
to .config
in the kernel source code. You can modify it as needed.
Build the kernel
After the kernel source code is ready it is possible to build the kernel.
./build-kernel.sh build
Install the Kernel in the default path for Kata
Kata Containers uses some default path to search a kernel to boot. To install on this path, the following command will install it to the default Kata containers path.
./build-kernel.sh install