kata-containers/tools/osbuilder/rootfs-builder/ubuntu
Jeremi Piotrowski fcab7c3a01 osbuilder: Include minimal set of device nodes in ubuntu initrd
When starting an initrd the kernel expects to find /dev/console in the initrd,
so that it can connect it as stdin/stdout/stderr to the /init process. If the
device node is missing the kernel will complain that it was unable to open an
initial console. If kata-agent is the initrd init process, it will also result
in log messages not being logged to console and thus not forwarded to host
syslog.

Add a set of standard device nodes for completeness, so that console logging
works. To do that we install the makedev packge which provides a MAKEDEV helper
that knows the major/minor numbers. Unfortunately the debian package tries to
create devnodes from postinst, which can be suppressed if systemd-detect-virt
is present. That's why we create a small dummy script that matches what
systemd-detect-virt would output (anything is enough to suppress mknod).

Fixes: #6261
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
(cherry picked from commit 76e926453a)
Signed-off-by: Greg Kurz <groug@kaod.org>
2023-03-20 16:25:42 +01:00
..
config.sh agent: support systemd cgroup for kata agent 2022-10-25 13:57:09 +08:00
Dockerfile.in osbuilder: Include minimal set of device nodes in ubuntu initrd 2023-03-20 16:25:42 +01:00
rootfs_lib.sh osbuilder: Include minimal set of device nodes in ubuntu initrd 2023-03-20 16:25:42 +01:00