Changeset aab9e07 in freewrt


Ignore:
Timestamp:
Jul 22, 2006, 8:50:05 PM (19 years ago)
Author:
Waldemar Brodkorb <wbx@…>
Branches:
freewrt_1_0, freewrt_2_0
Children:
374cdc5
Parents:
bee7cba
Message:

simplify. fix squashfs images, we only support overlay filesystem at the moment, I will add ramfs as another firmware type later

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

Location:
package/base-files/default
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • package/base-files/default/bin/firstboot

    rbee7cba raab9e07  
    5252fopivot() { # <rw_root> <ro_root> <dupe?>
    5353        root=$1
    54     {
    55       mount -t mini_fo -o base=/,sto=$1 $1 /mnt 2>&- && root=/mnt
    56     } || {
    57       [ "$3" = "1" ] && mount -o bind $1 $1 && dupe $1 $rom
    58     }
    59     pivot $root $2
     54        mount -t mini_fo -o base=/,sto=$1 $1 /mnt 2>&- && root=/mnt
     55        pivot $root $2
    6056}
    6157
     
    7369        }
    7470
    75         [ "$1" = "switch2jffs" ] && {
    76                 mtd erase data
    77                 mount -o remount,ro none / # try to avoid fs changing while copying
    78                 mount -o bind / /mnt
    79                 mount /dev/mtdblock/4 /rom/jffs -t jffs2
    80                 echo -n "copying files ... "
    81                 cp -a /mnt/* /rom/jffs
    82                 umount /mnt
    83                 echo "done"
    84                 pivot /rom /mnt
    85                 mount -o move /mnt /tmp/root
    86                 pivot /jffs /rom
    87                 jffs2root --clean
    88                 exit 0
    89         }
    90 
    9171        # script run manually
    9272        [ \! -z "$jffs" ] && {
  • package/base-files/default/sbin/mount_root

    rbee7cba raab9e07  
    11#!/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 }
    72
    83size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo)
     
    2116        else
    2217                . /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                 }
     18                echo "switching to overlay filesystem"
     19                mount /dev/mtdblock/4 /jffs -t jffs2
     20                fopivot /jffs /rom
    3221        fi
    3322fi
     
    3625mkdir -p /dev/pts
    3726mount none /dev/pts -t devpts
    38 mount -t sysfs none /sys 2>&-
Note: See TracChangeset for help on using the changeset viewer.