allow devfs to run on lxc

X-Gentoo-Bug: 761918
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=761918
Closes #272.
This commit is contained in:
William Hubbs 2021-01-28 12:31:57 -06:00
parent 170ce2624a
commit 12ee72a9b3

View File

@ -15,7 +15,7 @@ depend()
{
provide dev-mount
before dev
keyword -docker -lxc -prefix -systemd-nspawn -vserver
keyword -docker -prefix -systemd-nspawn -vserver
}
mount_dev()
@ -66,18 +66,20 @@ seed_dev()
{
# Seed /dev with some things that we know we need
# creating /dev/console, /dev/tty and /dev/tty1 to be able to write
# to $CONSOLE with/without bootsplash before udevd creates it
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
if [ "${RC_SYS}" != LXC ]; then
# creating /dev/console, /dev/tty and /dev/tty1 to be able to write
# to $CONSOLE with/without bootsplash before udevd creates it
[ -c /dev/console ] || mknod -m 600 /dev/console c 5 1
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
[ -c /dev/tty ] || mknod -m 666 /dev/tty c 5 0
# udevd will dup its stdin/stdout/stderr to /dev/null
# and we do not want a file which gets buffered in ram
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
# udevd will dup its stdin/stdout/stderr to /dev/null
# and we do not want a file which gets buffered in ram
[ -c /dev/null ] || mknod -m 666 /dev/null c 1 3
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
fi
# extra symbolic links not provided by default
[ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd