summaryrefslogtreecommitdiffstats
path: root/target/linux/package/base-files/files/au1000-2.6/sbin/mount_root
diff options
context:
space:
mode:
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-05-30 19:38:38 +0000
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>2006-05-30 19:38:38 +0000
commitbe8ad0190d689eb7f797bdc0618d7e87892a831d (patch)
treeeb392a5dc848616550a5c47b5a2481f8e6b8bc1f /target/linux/package/base-files/files/au1000-2.6/sbin/mount_root
parente240cc0ea62aa7404ccf6187cc95cf6370212bef (diff)
resync with kamikaze
git-svn-id: svn://svn.openwrt.org/openwrt/branches/buildroot-ng/openwrt@3844 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/package/base-files/files/au1000-2.6/sbin/mount_root')
-rwxr-xr-xtarget/linux/package/base-files/files/au1000-2.6/sbin/mount_root23
1 files changed, 23 insertions, 0 deletions
diff --git a/target/linux/package/base-files/files/au1000-2.6/sbin/mount_root b/target/linux/package/base-files/files/au1000-2.6/sbin/mount_root
new file mode 100755
index 000000000..5dd1b0c56
--- /dev/null
+++ b/target/linux/package/base-files/files/au1000-2.6/sbin/mount_root
@@ -0,0 +1,23 @@
+#!/bin/sh
+size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
+mount none /tmp -t tmpfs -o size=$size
+
+if [ "$1" != "failsafe" ]; then
+ mtd unlock filesystem
+ mount | grep jffs2 >&-
+ if [ $? = 0 ] ; then
+ if [ $(cat /proc/mtd | wc -l) = 6 ]; then
+ mtd erase filesystem
+ jffs2root --move
+ else
+ mount -o remount,rw /dev/root /
+ fi
+ else
+ . /bin/firstboot
+ fi
+fi
+
+mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
+mkdir -p /dev/pts
+mount none /dev/pts -t devpts
+mount -t sysfs none /sys 2>&-