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.
cleanup-cruft
Richard Yao 13 years ago
parent 65249bbcea
commit e2189311fc

@ -307,12 +307,16 @@ mount_devfs () {
fi fi
# Options copied from /etc/init.d/udev-mount, should probably be kept in sync # Options copied from /etc/init.d/udev-mount, should probably be kept in sync
if grep -qs grep '^devtmpfs' /proc/mounts; then
mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev \ mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev \
|| bad_msg "Failed to mount /dev as ${devfs}" || bad_msg "Failed to mount /dev as ${devfs}"
fi
# http://git.busybox.net/busybox/plain/docs/mdev.txt # http://git.busybox.net/busybox/plain/docs/mdev.txt
if grep -qs grep '^devpts' /proc/mounts; then
mkdir -m 0755 /dev/pts mkdir -m 0755 /dev/pts
mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts" mount -t devpts -o gid=5,mode=0620 devpts /dev/pts || bad_msg "Failed to mount /dev/pts"
fi
} }
test_success() { test_success() {

Loading…
Cancel
Save