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