Changeset 1e3c84d in freewrt
- Timestamp:
- Aug 2, 2007, 4:27:19 PM (18 years ago)
- Children:
- deb59c9
- Parents:
- 492449f
- File:
-
- 1 edited
-
target/linux/brcm-2.4/ramovl/files/sbin/mount_root (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
target/linux/brcm-2.4/ramovl/files/sbin/mount_root
r492449f r1e3c84d 1 1 #!/bin/sh 2 3 pivot() { # <new_root> <old_root>4 mount -o move /proc $1/proc && \5 pivot_root $1 $1$2 && {6 mount -o move $2/dev /dev7 mount -o bind $2/etc /etc8 mount -o move $2/tmp /tmp9 return 010 }11 }12 13 dupe() { # <new_root> <old_root>14 cd $115 echo -n "creating directories... "16 {17 cd $218 find . -xdev -type d19 echo "./dev ./jffs ./mnt ./proc ./tmp"20 # xdev skips mounted directories21 cd $122 } | xargs mkdir -p23 echo "done"24 25 echo -n "setting up symlinks... "26 for file in $(cd $2; find . -xdev -type f); do27 case "$file" in28 ./etc*|./rom/note) ;; #nothing29 ./usr/lib/ipkg/info) cp -af $2/$file $file;;30 *) ln -sf /rom/${file#./*} $file;;31 esac32 done33 for file in $(cd $2; find . -xdev -type l); do34 cp -af $2/${file#./*} $file35 done36 echo "done"37 }38 39 mountdp() { # <device> <mount_point> <ignored> <fs>40 dev=$1; mnt=$2; shift 2; opt=$*41 mount $dev $mnt $opt42 dupe $mnt $rom43 pivot $mnt /rom44 }45 2 46 3 size=$(awk '/Mem:/ {l=5242880;print((s=$2/2)<l)?$2-l:s}' /proc/meminfo) 47 4 mount none /tmp -t tmpfs -o size=$size 48 5 49 mkdir -p /tmp/root 50 mountdp /tmp/root /mnt -o bind 6 echo "switching to overlay filesystem" 7 mount -t tmpfs none /jffs 8 mount -t mini_fo -o base=/,sto=/jffs / /mnt 9 mount -o move /proc /mnt/proc 10 pivot_root /mnt /mnt/rom 11 mount -o move /rom/dev /dev 12 mount -o move /rom/tmp /tmp 51 13 52 14 mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
Note:
See TracChangeset
for help on using the changeset viewer.
