source: freewrt/package/base-files/default/sbin/mount_root@ 28df043

freewrt_1_0 freewrt_2_0
Last change on this file since 28df043 was 28df043, checked in by Waldemar Brodkorb <wbx@…>, 20 years ago

enable automatic reboot after jffs2move, from OpenWrt ticketsystem, thx consulting@…, rename OpenWrt partition to data, add mini-fo as default kernel module

git-svn-id: svn://www.freewrt.org/trunk/freewrt@34 afb5a338-a214-0410-bd46-81f09a774fd1

  • Property mode set to 100755
File size: 907 bytes
Line 
1#!/bin/sh
2is_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
8size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
9mount none /tmp -t tmpfs -o size=$size
10
11if [ "$1" != "failsafe" ]; then
12 mtd unlock linux
13 mount | grep jffs2 >&-
14 if [ $? = 0 ] ; then
15 if [ $(cat /proc/mtd | wc -l) = 6 ]; then
16 mtd erase data
17 jffs2root --move --reboot
18 else
19 mount -o remount,rw /dev/root /
20 fi
21 else
22 . /bin/firstboot
23 is_dirty
24 [ $? != 0 ] && {
25 echo "switching to jffs2"
26 mount /dev/mtdblock/4 /jffs -t jffs2
27 pivot /jffs /rom
28 } || {
29 echo "jffs2 unusable; using ramdisk"
30 ramoverlay
31 }
32 fi
33fi
34
35mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
36mkdir -p /dev/pts
37mount none /dev/pts -t devpts
38mount -t sysfs none /sys 2>&-
Note: See TracBrowser for help on using the repository browser.