[package] base-files: change /dev permissions to 0755 when hotplug2 is used (#6039)
[openwrt/svn-archive/archive.git] / package / base-files / files / lib / preinit / 20_device_fs_mount
index 6ba7ccc6f18337ffaf58c1d992df54ebc49294db..832b1cf399791a0d09feba8ec134a38ed6d2d3fe 100644 (file)
@@ -3,13 +3,10 @@
 # Copyright (C) 2010 Vertical Communications
 
 do_move_devtmpfs() {
-    foo="`grep devtmpfs /proc/mounts`"
-    x=${foo#* }
-    x=${x%% *}
+    local mnt="$(grep devtmpfs /proc/mounts)"
+          mnt="${mnt#* }"; mnt="${mnt%% *}"
 
-    if [ "$x" != "/dev" ] ; then
-       mount -o move "$x" /dev
-    fi
+    [ "$mnt" = "/dev" ] || mount -o move "$mnt" /dev
 }
 
 do_mount_devfs() {
@@ -17,7 +14,7 @@ do_mount_devfs() {
 }
 
 do_mount_hotplug() {
-    mount -t tmpfs tmpfs /dev -o size=512K
+    mount -t tmpfs tmpfs /dev -o mode=0755,size=512K
 }
 
 do_mount_udev() {