From 9d82cae6bc512215387136d8b0e5d4679055173a Mon Sep 17 00:00:00 2001 From: Christian Wiese Date: Tue, 9 Oct 2007 06:48:48 +0300 Subject: [PATCH] Fixed mkinitrd initrd init checking the right way for /dev/{console,null,zero} - We have to use test -c while checking for character devices. --- base/mkinitrd/initrdinit.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/base/mkinitrd/initrdinit.sh b/base/mkinitrd/initrdinit.sh index 362ee5adc..b88b32fdd 100644 --- a/base/mkinitrd/initrdinit.sh +++ b/base/mkinitrd/initrdinit.sh @@ -25,6 +25,16 @@ mount -t usbfs none /proc/bus/usb mount -t sysfs none /sys ln -s /proc/self/fd /dev/fd +if [ ! -c /dev/console ]; then + mknod /dev/console c 5 1 +fi +if [ ! -c /dev/null ]; then + mknod /dev/null c 1 3 +fi +if [ ! -c /dev/zero ]; then + mknod /dev/zero c 1 5 +fi + echo "Populating /dev (u/dev) ..." udevd --daemon udevtrigger @@ -79,10 +89,16 @@ if [ "$root" ]; then mount -t none /proc -o move /rootfs/proc mount -t none /sys -o move /rootfs/sys - if [ ! -f /rootfs/dev/console ]; then + if [ ! -c /rootfs/dev/console ]; then mknod /rootfs/dev/console c 5 1 + fi + if [ ! -c /rootfs/dev/null ]; then mknod /rootfs/dev/null c 1 3 + fi + if [ ! -c /rootfs/dev/zero ]; then mknod /rootfs/dev/zero c 1 5 + fi + if [ ! -c /rootfs/dev/tty ]; then mknod /rootfs/dev/tty c 5 0 fi