mount /proc earlier in /sbin/mount_root
[openwrt/svn-archive/archive.git] / openwrt / package / base-files / au1000-2.6 / sbin / mount_root
1 #!/bin/sh
2 mount none /proc -t proc
3 size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
4 mount none /tmp -t tmpfs -o size=$size
5
6 if [ "$1" != "failsafe" ]; then
7 mtd unlock filesystem
8 mount | grep jffs2 >&-
9 if [ $? = 0 ] ; then
10 if [ $(cat /proc/mtd | wc -l) = 6 ]; then
11 mtd erase filesystem
12 jffs2root --move
13 else
14 mount -o remount,rw /dev/root /
15 fi
16 else
17 . /bin/firstboot
18 fi
19 fi
20
21 mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
22 mkdir -p /dev/pts
23 mount none /dev/pts -t devpts
24 mount -t sysfs none /sys 2>&-