[oe-commits] Ben Shelton : busybox: mdev: Ensure /dev/initctl exists after tmpfs mount
git at git.openembedded.org
git at git.openembedded.org
Thu Jul 24 21:16:46 UTC 2014
Module: openembedded-core.git
Branch: master-next
Commit: 53543363a8ab4424c17ed7aec0e8aefc4df86b3d
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=53543363a8ab4424c17ed7aec0e8aefc4df86b3d
Author: Ben Shelton <ben.shelton at ni.com>
Date: Mon Jul 21 11:53:47 2014 -0500
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.
Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
Signed-off-by: Ben Shelton <ben.shelton at ni.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/recipes-core/busybox/files/mdev | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/meta/recipes-core/busybox/files/mdev b/meta/recipes-core/busybox/files/mdev
index c4447ef..9625247 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
touch /dev/mdev.seq
echo "/sbin/mdev" > /proc/sys/kernel/hotplug
mdev -s
+
+#
+# We might have mounted something over /dev, see if /dev/initctl is there.
+#
+if test ! -p /dev/initctl
+then
+ rm -f /dev/initctl
+ mknod -m 600 /dev/initctl p
+fi
+
More information about the Openembedded-commits
mailing list