fix typos in CONFIG_SITE files
[openwrt/svn-archive/openwrt.git] / openwrt / package / base-files / default / sbin / mount_root
1 #!/bin/sh
2 is_dirty() {
3 grep Broadcom /proc/cpuinfo >&- || return 1
4 OFFSET="$(($(hexdump -v /dev/mtdblock/1 -s 20 -n 2 -e '"%d"')-1))"
5 return $(hexdump -v /dev/mtdblock/1 -s $OFFSET -n 1 -e '"%d"')
6 }
7
8 if [ "$1" != "failsafe" -a "$(nvram get no_root_swap)" != 1 ]; then
9 mtd unlock linux
10 mount | grep jffs2 >&-
11 if [ $? = 0 ] ; then
12 grep "mini_fo" /proc/filesystems >&- ||
13 mount -o remount,rw /dev/root /
14 else
15 . /bin/firstboot
16 is_dirty
17 [ $? != 0 ] && {
18 echo "switching to jffs2"
19 mount /dev/mtdblock/4 /jffs -t jffs2
20 fopivot /jffs /rom
21 } || {
22 echo "jffs2 not ready yet; using ramdisk"
23 ramoverlay
24 }
25 fi
26 fi
27
28 mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
29 mkdir -p /dev/pts
30 mount none /dev/pts -t devpts 2>&-
31 mount -t sysfs none /sys 2>&-