Changeset 3388
- Timestamp:
- 08/02/07 16:18:14 (1 year ago)
- Files:
-
- trunk/freewrt/mk/targets.mk (modified) (1 diff)
- trunk/freewrt/package/base-files/Makefile (modified) (1 diff)
- trunk/freewrt/package/fwcf/Config.in (modified) (1 diff)
- trunk/freewrt/package/fwupdate/Config.in (modified) (1 diff)
- trunk/freewrt/package/fwupdate/Makefile (modified) (1 diff)
- trunk/freewrt/package/mini_fo/Config.in (modified) (1 diff)
- trunk/freewrt/package/mtd/Config.in (modified) (1 diff)
- trunk/freewrt/target/Config.in (modified) (2 diffs)
- trunk/freewrt/target/image/brcm/Makefile (modified) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.4/ramovl (added)
- trunk/freewrt/target/linux/brcm-2.4/ramovl/files (added)
- trunk/freewrt/target/linux/brcm-2.4/ramovl/files/sbin (added)
- trunk/freewrt/target/linux/brcm-2.4/ramovl/files/sbin/mount_root (copied) (copied from trunk/freewrt/target/linux/brcm-2.4/squashfs/files/sbin/mount_root) (2 diffs)
- trunk/freewrt/target/linux/brcm-2.4/squashfs/files/sbin/mount_root (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/freewrt/mk/targets.mk
r3335 r3388 94 94 $(eval $(call rootfs_template,jffs2,JFFS2,rootfstype=jffs2 root=/dev/mtdblock2)) 95 95 $(eval $(call rootfs_template,squashfs,SQUASHFS,rootfstype=squashfs root=/dev/mtdblock2)) 96 $(eval $(call rootfs_template,ramovl,RAMOVL,rootfstype=squashfs root=/dev/mtdblock2)) 96 97 $(eval $(call rootfs_template,nfs,NFS,root=/dev/nfs ip=dhcp)) 97 98 $(eval $(call rootfs_template,ext2-cf,EXT2_CF,root=/dev/cfa2)) trunk/freewrt/package/base-files/Makefile
r3385 r3388 380 380 ${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_TARGET_ROOTFS_JFFS2 381 381 ${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_TARGET_ROOTFS_SQUASHFS 382 ${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_TARGET_ROOTFS_RAMOVL 382 383 ${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_TARGET_ROOTFS_NFS 383 384 ${_IPKGS_COOKIE}: ${TOPDIR}/.cfg/FWRT_TARGET_ROOTFS_EXT2_CF trunk/freewrt/package/fwcf/Config.in
r3235 r3388 4 4 default y if FWRT_TARGET_ROOTFS_JFFS2 5 5 default y if FWRT_TARGET_ROOTFS_SQUASHFS 6 default y if FWRT_TARGET_ROOTFS_RAMOVL 6 7 default n 7 8 select FWRT_PACKAGE_MKSH trunk/freewrt/package/fwupdate/Config.in
r3326 r3388 4 4 default n 5 5 depends on FWRT_TARGET_ROOTFS_JFFS2 || FWRT_TARGET_ROOTFS_SQUASHFS || \ 6 FWRT_TARGET_ROOTFS_RAMOVL || \ 6 7 FWRT_TARGET_ROOTFS_EXT2_CF || FWRT_TARGET_ROOTFS_YAFFS2 7 8 select FWRT_PACKAGE_TAR if FWRT_TARGET_ROOTFS_EXT2_CF trunk/freewrt/package/fwupdate/Makefile
r3332 r3388 18 18 fs-script-${FWRT_TARGET_ROOTFS_JFFS2}=fs-mtd.sh 19 19 fs-script-${FWRT_TARGET_ROOTFS_SQUASHFS}=fs-mtd.sh 20 fs-script-${FWRT_TARGET_ROOTFS_RAMOVL}=fs-mtd.sh 20 21 fs-script-${FWRT_TARGET_ROOTFS_EXT2_CF}=fs-tar.sh 21 22 fs-script-${FWRT_TARGET_ROOTFS_YAFFS2}=fs-tar.sh trunk/freewrt/package/mini_fo/Config.in
r2557 r3388 3 3 tristate 4 4 default n 5 depends on ! FWRT_TARGET_ROOTFS_SQUASHFS5 depends on !FWRT_KERNEL_MINI_FO 6 6 help 7 7 The mini fanout overlay file system. trunk/freewrt/package/mtd/Config.in
r2557 r3388 4 4 default y if FWRT_TARGET_ROOTFS_JFFS2 5 5 default y if FWRT_TARGET_ROOTFS_SQUASHFS 6 default y if FWRT_TARGET_ROOTFS_RAMOVL 6 7 default n 7 8 depends on FWRT_TARGET_ROOTFS_JFFS2 || \ 9 FWRT_TARGET_ROOTFS_RAMOVL || \ 8 10 FWRT_TARGET_ROOTFS_SQUASHFS 9 11 help 10 12 Update utility for trx firmware images. 11 trunk/freewrt/target/Config.in
r3335 r3388 45 45 choice 46 46 prompt "Embedded Device" 47 default FWRT_DEVICE_BRCM_ASUS_WL500G_PREMIUM if FWRT_TARGET_CATEGORY_MIPS 47 48 48 49 # … … 300 301 select FWRT_PACKAGE_JFFS2ROOT 301 302 select FWRT_KERNEL_JFFS2_FS 302 select FWRT_KERNEL_SQUASHFS 303 select FWRT_KERNEL_SQUASHFS 303 304 select FWRT_KERNEL_MINI_FO 304 305 depends on FWRT_LINUX_2_4_BRCM || FWRT_LINUX_2_6_BRCM 305 306 help 306 307 Build firmware images with a read-only and highly compressed 307 (squashfs with lzma compression) root filesystem and a overlay308 (squashfs with lzma compression) root filesystem and an overlay 308 309 filesystem for a pseudo writable root filesystem. Only differences 309 310 to the read-only image are kept on a writable jffs2 partition. 311 312 config FWRT_TARGET_ROOTFS_RAMOVL 313 bool "read-only root filesystem and tmpfs (squashfs)" 314 select FWRT_PACKAGE_MTD 315 select FWRT_PACKAGE_FWCF 316 select FWRT_KERNEL_SQUASHFS 317 select FWRT_KERNEL_MINI_FO 318 depends on FWRT_LINUX_2_4_BRCM || FWRT_LINUX_2_6_BRCM 319 help 320 Build firmware images with a read-only and highly compressed 321 (squashfs with lzma compression) root filesystem and an overlay 322 filesystem for a pseudo writable root filesystem. Differences 323 to the read-only image are kept in RAM and lost on reboot. 310 324 311 325 config FWRT_TARGET_ROOTFS_NFS trunk/freewrt/target/image/brcm/Makefile
r3363 r3388 76 76 endif 77 77 78 ifeq ($(FWRT_TARGET_ROOTFS_SQUASHFS) ,y)79 $(KDIR)/root. squashfs:80 rm -f $(KDIR)/root. squashfs78 ifeq ($(FWRT_TARGET_ROOTFS_SQUASHFS)$(FWRT_TARGET_ROOTFS_RAMOVL),y) 79 $(KDIR)/root.$(FS): 80 rm -f $(KDIR)/root.$(FS) 81 81 $(STAGING_TOOLS)/bin/mksquashfs-lzma $(KDIR)/root \ 82 $(KDIR)/root. squashfs$(SQUASHFS_OPTS) $(MAKE_TRACE)82 $(KDIR)/root.$(FS) $(SQUASHFS_OPTS) $(MAKE_TRACE) 83 83 endif 84 84 … … 90 90 cp $(BUILD_DIR)/loader.elf $(BIN_DIR)/kernel/bootloader-$(BOARD)-$(KERNEL).elf 91 91 92 if eq ($(FS),squashfs)92 ifneq ($(filter squashfs ramovl,$(strip ${FS})),) 93 93 $(STAGING_DIR)/$(FWRT_PREFIX)-$(BOARD)-$(KERNEL)-$(FS).trx: $(KDIR)/loader.tmp.gz $(KDIR)/root.$(FS) $(KDIR)/vmlinux.lzma 94 94 $(STAGING_TOOLS)/bin/trx -o $@ $(KDIR)/loader.tmp.gz $(KDIR)/vmlinux.lzma -a 1024 $(KDIR)/root.$(FS) $(MAKE_TRACE) trunk/freewrt/target/linux/brcm-2.4/ramovl/files/sbin/mount_root
r1111 r3388 1 1 #!/bin/sh 2 is_dirty() {3 grep Broadcom /proc/cpuinfo >&- || return 14 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 2 8 3 pivot() { # <new_root> <old_root> 9 mount -o move /proc $1/proc && \ 10 pivot_root $1 $1$2 && { 11 mount -o move $2/dev /dev 12 mount -o move $2/tmp /tmp 13 return 0 14 } 4 mount -o move /proc $1/proc && \ 5 pivot_root $1 $1$2 && { 6 mount -o move $2/dev /dev 7 mount -o bind $2/etc /etc 8 mount -o move $2/tmp /tmp 9 return 0 10 } 15 11 } 16 12 17 13 dupe() { # <new_root> <old_root> 18 cd $119 echo -n "creating directories... "20 {21 cd $2 22 find . -xdev -type d23 echo "./dev ./jffs ./mnt ./proc ./tmp"24 # xdev skips mounted directories25 cd $1 26 } | xargs mkdir -p27 echo "done"14 cd $1 15 echo -n "creating directories... " 16 { 17 cd $2 18 find . -xdev -type d 19 echo "./dev ./jffs ./mnt ./proc ./tmp" 20 # xdev skips mounted directories 21 cd $1 22 } | xargs mkdir -p 23 echo "done" 28 24 29 echo -n "setting up symlinks... " 30 for file in $(cd $2; find . -xdev -type f;); do 31 case "$file" in 32 ./rom/note) ;; #nothing 33 ./etc/resolv.conf|\ 34 ./usr/lib/ipkg/info) cp -af $2/$file $file;; 35 *) ln -sf /rom/${file#./*} $file;; 36 esac 37 done 38 for file in $(cd $2; find . -xdev -type l;); do 39 cp -af $2/${file#./*} $file 40 done 41 echo "done" 25 echo -n "setting up symlinks... " 26 for file in $(cd $2; find . -xdev -type f); do 27 case "$file" in 28 ./etc*|./rom/note) ;; #nothing 29 ./usr/lib/ipkg/info) cp -af $2/$file $file;; 30 *) ln -sf /rom/${file#./*} $file;; 31 esac 32 done 33 for file in $(cd $2; find . -xdev -type l); do 34 cp -af $2/${file#./*} $file 35 done 36 echo "done" 42 37 } 43 38 44 39 mountdp() { # <device> <mount_point> <ignored> <fs> 45 dev=$1; mnt=$2; shift 2; opt=$*46 mount $dev $mnt $opt47 dupe $mnt $rom48 pivot $mnt /rom40 dev=$1; mnt=$2; shift 2; opt=$* 41 mount $dev $mnt $opt 42 dupe $mnt $rom 43 pivot $mnt /rom 49 44 } 50 45 … … 52 47 mount none /tmp -t tmpfs -o size=$size 53 48 54 mtd unlock linux 55 is_dirty 56 [ $? != 0 ] && { 57 echo "switching to overlay filesystem" 58 datanr=$(awk -F : '/data/ { print $1 }' /proc/mtd |sed "s#mtd##") 59 mount /dev/mtdblock/$datanr /jffs -t jffs2 60 mount -t mini_fo -o base=/,sto=/jffs /jffs /mnt 61 pivot /mnt /rom 62 } || { 63 echo "jffs2 unusable; using ramdisk" 64 mkdir -p /tmp/root 65 mountdp /tmp/root /mnt -o bind 66 } 49 mkdir -p /tmp/root 50 mountdp /tmp/root /mnt -o bind 67 51 68 52 mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777 trunk/freewrt/target/linux/brcm-2.4/squashfs/files/sbin/mount_root
r1111 r3388 19 19 echo -n "creating directories... " 20 20 { 21 cd $2 21 cd $2 22 22 find . -xdev -type d 23 23 echo "./dev ./jffs ./mnt ./proc ./tmp" 24 24 # xdev skips mounted directories 25 cd $1 25 cd $1 26 26 } | xargs mkdir -p 27 27 echo "done"


