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

freewrt_1_0 freewrt_2_0
Last change on this file since e4ba301 was e4ba301, checked in by Waldemar Brodkorb <wbx@…>, 19 years ago
  • add a specific preinit.arch which executes brcm specific stuff
  • for squashfs based images, use mini_fo as default, no ugly symlinks anymore
  • add a "version" command, which can be used later, to exactly know which FreeWRT version is used (good for postinst scripts and bugreports), some users like to recreate the shell banner, but still need to know which version is used
  • remove nvram sepcific stuff from some of the startup scripts, like syslogd startup params
  • add some checks if ldd / arp is installed in /etc/profile

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

  • Property mode set to 100755
File size: 909 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 fopivot /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.