don't run mdev on hotplug pseudo-events that come from user space
[openwrt.git] / package / base-files / files / sbin / mount_root
1 #!/bin/sh
2 # Copyright (C) 2006 OpenWrt.org
3 . /etc/functions.sh
4
5 mount none /proc -t proc
6 size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
7 mount none /tmp -t tmpfs -o size=$size,nosuid,nodev,mode=1777
8
9 grep rootfs /proc/mtd >/dev/null 2>/dev/null && {
10         mtd unlock rootfs
11         grep rootfs_data /proc/mtd >/dev/null 2>/dev/null && {
12                 . /bin/firstboot
13                 echo "switching to jffs2"
14                 mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2
15                 fopivot /jffs /rom
16         }
17 } || mount -o remount,rw /dev/root /
18
19 mkdir -p /dev/pts
20 mount none /dev/pts -t devpts
21 grep sysfs /proc/filesystems >/dev/null && mount -t sysfs none /sys 2>&-