2010-01-25 19:11:17 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Copyright (C) 2006 OpenWrt.org
|
|
|
|
# Copyright (C) 2010 Vertical Communications
|
|
|
|
|
2010-07-24 22:21:27 +03:00
|
|
|
do_move_devtmpfs() {
|
2010-07-24 22:33:11 +03:00
|
|
|
local mnt="$(grep devtmpfs /proc/mounts)"
|
|
|
|
mnt="${mnt#* }"; mnt="${mnt%% *}"
|
2010-07-24 22:21:27 +03:00
|
|
|
|
2012-12-19 18:07:46 +02:00
|
|
|
[ "$mnt" = "/dev" ] || mount -o noatime,move "$mnt" /dev
|
2010-07-24 22:21:27 +03:00
|
|
|
}
|
|
|
|
|
2010-01-25 19:11:17 +02:00
|
|
|
do_mount_devfs() {
|
2012-12-19 18:07:46 +02:00
|
|
|
mount -o noatime -t devfs devfs /dev
|
2010-01-25 19:11:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
do_mount_hotplug() {
|
2012-12-19 18:07:46 +02:00
|
|
|
mount -t tmpfs -o noatime,mode=0755,size=512K tmpfs /dev
|
2010-01-25 19:11:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
do_mount_udev() {
|
2012-12-19 18:07:46 +02:00
|
|
|
mount -n -t tmpfs -o noatime,mode=0755 udev /dev
|
2010-01-25 19:11:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
choose_device_fs() {
|
2010-07-24 22:21:27 +03:00
|
|
|
if grep -q devtmpfs /proc/mounts; then
|
|
|
|
do_move_devtmpfs
|
|
|
|
elif grep -q devfs /proc/filesystems; then
|
2010-01-25 19:11:17 +02:00
|
|
|
do_mount_devfs
|
|
|
|
elif [ -x /sbin/hotplug2 ]; then
|
|
|
|
do_mount_hotplug
|
|
|
|
elif [ -x /sbin/udevd ]; then
|
|
|
|
do_mount_udev
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
boot_hook_add preinit_essential choose_device_fs
|
|
|
|
|