summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Shelton <ben.shelton@ni.com>2014-07-21 11:53:47 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-23 21:59:13 +0100
commitacfe054e32b9e60db3970d7546e759b37fde74c2 (patch)
tree48055d2717d473e6a63d83bdbdd057c7ceb72530
parent034790df8f4ca257c631de292dc003aee8e26231 (diff)
downloadpoky-acfe054e32b9e60db3970d7546e759b37fde74c2.tar.gz
busybox: mdev: Ensure /dev/initctl exists after tmpfs mount
During boot, there is a brief window during which /dev/initctl is missing, which breaks initscripts that would need to access it. This occurs because /etc/init.d/mountall.sh (rcS.d/S02...) attempts to ensure /dev/initctl is present, but /etc/init.d/mdev (rcS.d/S06...) mounts over /dev and clobbers the work done by mountall, and then does not wait synchronously until initctl is ready before continuing. To close this window, in /etc/init.d/mdev, we check whether /dev/initctl is present, and if not, we remove it and recreate it. This is the same thing that is done by /etc/init.d/mountall.sh, and we have verified that any writers of /dev/initctl will wait synchronously until sysvinit notices the change in fd and does the read, so no race exists. (From OE-Core rev: 53543363a8ab4424c17ed7aec0e8aefc4df86b3d) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Ben Shelton <ben.shelton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xmeta/recipes-core/busybox/files/mdev10
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
index c4447ef160..96252477e0 100755
--- a/meta/recipes-core/busybox/files/mdev
+++ b/meta/recipes-core/busybox/files/mdev
@@ -7,3 +7,13 @@ mount -t devpts devpts /dev/pts
7touch /dev/mdev.seq 7touch /dev/mdev.seq
8echo "/sbin/mdev" > /proc/sys/kernel/hotplug 8echo "/sbin/mdev" > /proc/sys/kernel/hotplug
9mdev -s 9mdev -s
10
11#
12# We might have mounted something over /dev, see if /dev/initctl is there.
13#
14if test ! -p /dev/initctl
15then
16 rm -f /dev/initctl
17 mknod -m 600 /dev/initctl p
18fi
19