From: Richard Yao Date: Tue, 17 Jul 2012 20:13:57 +0000 (-0400) Subject: Verify in /proc/mounts that devtmpfs is unmounted before mounting it X-Git-Tag: v3.4.39~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e2189311fc8c036327c1c8263807b274d5ff039b;p=genkernel.git Verify in /proc/mounts that devtmpfs is unmounted before mounting it For consistency, we do the same with devpts. WilliamH reported this to me in IRC. --- diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index 258f2bd..a2edeee 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -307,12 +307,16 @@ mount_devfs () { fi # Options copied from /etc/init.d/udev-mount, should probably be kept in sync - mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev \ - || bad_msg "Failed to mount /dev as ${devfs}" + if grep -qs grep '^devtmpfs' /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 - mkdir -m 0755 /dev/pts - mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" + if grep -qs grep '^devpts' /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 } test_success() {