aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@cs.stonybrook.edu>2012-07-17 16:13:57 -0400
committerRichard Yao <ryao@cs.stonybrook.edu>2012-07-17 16:13:57 -0400
commite2189311fc8c036327c1c8263807b274d5ff039b (patch)
treef6ca03231db59f7ac7d486f8fd34b9344c134c91 /defaults/initrd.scripts
parentFix bad ZFS case statement, bug #425122 (diff)
downloadgenkernel-e2189311fc8c036327c1c8263807b274d5ff039b.tar.gz
genkernel-e2189311fc8c036327c1c8263807b274d5ff039b.tar.bz2
genkernel-e2189311fc8c036327c1c8263807b274d5ff039b.zip
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.
Diffstat (limited to 'defaults/initrd.scripts')
-rwxr-xr-xdefaults/initrd.scripts12
1 files changed, 8 insertions, 4 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index 258f2bd0..a2edeeec 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() {