Prior commit to only mount devtmpfs and devpts if they were not already mounted made...
authorRobin H. Johnson <robbat2@gentoo.org>
Tue, 24 Jul 2012 08:26:43 +0000 (08:26 +0000)
committerRobin H. Johnson <robbat2@gentoo.org>
Tue, 24 Jul 2012 08:28:44 +0000 (08:28 +0000)
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
ChangeLog
defaults/initrd.scripts

index bc9ab5b20e5845a3a72c5efa700a177e23404718..de4fac882f27f2a0f444fef1a3ee1e9cbc8d658a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,11 @@
 # - 2008-2011 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 # $Id$
+  
+  24 Jul 2012; Robin H. Johnson <robbat2@gentoo.org> defaults/initrd.scripts:
+  Prior commit to only mount devtmpfs and devpts if they were not already
+  mounted made assumptions about the device names they were mounted as. Check
+  the filesystem column of /proc/mounts instead.
 
   21 Jul 2012; Sebastian Pipping <sping@gentoo.org> genkernel:
   Bump version to 3.4.39
index 4f0ce1b543e1e3eef575b53d31d8b4cf0095ffdd..fb64f84b3d021c0c88ab45636701e2fef5cf332c 100755 (executable)
@@ -307,13 +307,13 @@ mount_devfs () {
        fi
 
        # Options copied from /etc/init.d/udev-mount, should probably be kept in sync
-       if grep -qs '^devtmpfs' /proc/mounts; then
+       if awk 'BEGIN{m=1;} /devtmpfs/{if($3 == "devtmpfs") {m=0;} } END { exit m;}' /proc/mounts; then
                mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev \
                        || bad_msg "Failed to mount /dev as ${devfs}"
        fi
 
        # http://git.busybox.net/busybox/plain/docs/mdev.txt
-       if grep -qs '^devpts' /proc/mounts; then
+       if awk 'BEGIN{m=1;} /devtmpfs/{if($3 == "devpts") {m=0;} } END { exit m;}' /proc/mounts; then
                mkdir -m 0755 /dev/pts
                mount -t devpts -o gid=5,mode=0620 devpts /dev/pts  || bad_msg "Failed to mount /dev/pts"
        fi