From 12ee72a9b34ef33411cf1bfd5ea059676ee6e482 Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Thu, 28 Jan 2021 12:31:57 -0600 Subject: [PATCH] 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. --- init.d/devfs.in | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/init.d/devfs.in b/init.d/devfs.in index 61ba45f8..548a0847 100644 --- a/init.d/devfs.in +++ b/init.d/devfs.in @@ -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