package/base-files: add support for devtmpfs (thank you rauchwolke at gmx.net)
authorAlexandros C. Couloumbis <alex@ozo.com>
Sat, 24 Jul 2010 19:21:27 +0000 (19:21 +0000)
committerAlexandros C. Couloumbis <alex@ozo.com>
Sat, 24 Jul 2010 19:21:27 +0000 (19:21 +0000)
SVN-Revision: 22379

package/base-files/files/lib/preinit/20_device_fs_mount

index f82f9a6f45f89d52ad194b13bec4e0c33f7a8840..6ba7ccc6f18337ffaf58c1d992df54ebc49294db 100644 (file)
@@ -2,6 +2,16 @@
 # Copyright (C) 2006 OpenWrt.org
 # Copyright (C) 2010 Vertical Communications
 
+do_move_devtmpfs() {
+    foo="`grep devtmpfs /proc/mounts`"
+    x=${foo#* }
+    x=${x%% *}
+
+    if [ "$x" != "/dev" ] ; then
+       mount -o move "$x" /dev
+    fi
+}
+
 do_mount_devfs() {
     mount devfs /dev -t devfs
 }
@@ -15,7 +25,9 @@ do_mount_udev() {
 }
 
 choose_device_fs() {
-    if grep -q devfs /proc/filesystems; then
+    if grep -q devtmpfs /proc/mounts; then
+       do_move_devtmpfs
+    elif grep -q devfs /proc/filesystems; then
         do_mount_devfs
     elif [ -x /sbin/hotplug2 ]; then
         do_mount_hotplug