aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-06-03 13:07:45 +0200
committerThomas Bächler <thomas@archlinux.org>2010-06-03 13:07:45 +0200
commitcaa76df5f066e65f0dc39feba46013d205fc472b (patch)
tree34f75c0d35c638cd9931dd5cf4ead699b951c42b
parent6931135f3b243ea76cae70bec4070ce2c6ddd6fd (diff)
downloadinitscripts-caa76df5f066e65f0dc39feba46013d205fc472b.tar.xz
Only mount /proc, /sys and /dev if they haven't been mounted already, use devtmpfs instead of tmpfs if supported by the kernel
-rwxr-xr-xrc.sysinit16
1 files changed, 13 insertions, 3 deletions
diff --git a/rc.sysinit b/rc.sysinit
index c558745..d029458 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -17,9 +17,19 @@ printsep
run_hook sysinit_start
# mount /proc, /sys and our RAM /dev
-/bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid
-/bin/mount -n -t proc none /proc
-/bin/mount -n -t sysfs none /sys
+if ! /bin/mountpoint -q /proc; then
+ /bin/mount -n -t proc none /proc
+fi
+if ! /bin/mountpoint -q /sys; then
+ /bin/mount -n -t sysfs none /sys
+fi
+if ! /bin/mountpoint -q /dev; then
+ if grep -q devtmpfs /proc/filesystems 2>/dev/null; then
+ /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid
+ else
+ /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid
+ fi
+fi
# Copy static device nodes to /dev
/bin/cp -a /lib/udev/devices/* /dev/