Change Details
| include/image.mk |
| 62 | 62 | $(call Image/Build,jffs2-$(1)) |
| 63 | 63 | endef |
| 64 | 64 | define Image/mkfs/jffs2 |
| 65 | | rm -rf $(TARGET_DIR)/jffs |
| 66 | 65 | $(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/sub,$(SZ))) |
| 67 | 66 | endef |
| 68 | 67 | endif |
| 69 | 68 | |
| 70 | 69 | ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),y) |
| 71 | 70 | define Image/mkfs/squashfs |
| 72 | | @mkdir -p $(TARGET_DIR)/jffs |
| 71 | @mkdir -p $(TARGET_DIR)/overlay |
| 73 | 72 | $(MKSQUASHFS_CMD) $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned $(SQUASHFS_OPTS) |
| 74 | 73 | $(call Image/Build,squashfs) |
| 75 | 74 | endef |
| package/base-files/Makefile |
| 364 | 364 | mkdir -p $(1)/dev |
| 365 | 365 | mkdir -p $(1)/etc/crontabs |
| 366 | 366 | mkdir -p $(1)/etc/rc.d |
| 367 | | mkdir -p $(1)/jffs |
| 367 | mkdir -p $(1)/overlay |
| 368 | 368 | mkdir -p $(1)/lib/firmware |
| 369 | 369 | $(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX)) |
| 370 | 370 | mkdir -p $(1)/mnt |
| package/base-files/files/lib/firstboot/20_no_fo_mount_jffs |
| 5 | 5 | |
| 6 | 6 | no_fo_mount_jffs() { |
| 7 | 7 | # initialize jffs2 |
| 8 | | mount "$mtdpart" /jffs -t jffs2 || exit |
| 8 | mount "$mtdpart" /overlay -t jffs2 || exit |
| 9 | 9 | |
| 10 | 10 | # workaround to ensure that union can attach properly |
| 11 | 11 | sync |
| 12 | | ls /jffs >/dev/null |
| 12 | ls /overlay >/dev/null |
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | boot_hook_add no_fo no_fo_mount_jffs |
| package/base-files/files/lib/firstboot/30_is_rootfs_mounted |
| 4 | 4 | # Copyright (C) 2010 Vertical Communications |
| 5 | 5 | |
| 6 | 6 | skip_if_rootfs_mounted() { |
| 7 | | mount "$mtdpart" /rom/jffs -t jffs2 || exit |
| 7 | mount "$mtdpart" /rom/overlay -t jffs2 || exit |
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | boot_hook_add switch2jffs skip_if_rootfs_mounted |
| package/base-files/files/lib/firstboot/30_no_fo_pivot |
| 5 | 5 | |
| 6 | 6 | no_fo_pivot() { |
| 7 | 7 | # switch to the new (empty) jffs2 |
| 8 | | fopivot /jffs /rom 1 |
| 8 | fopivot /overlay /rom 1 |
| 9 | 9 | } |
| 10 | 10 | |
| 11 | 11 | boot_hook_add no_fo no_fo_pivot |
| package/base-files/files/lib/firstboot/40_copy_ramoverlay |
| 8 | 8 | mount -o remount,ro none / 2>&- |
| 9 | 9 | # copy ramoverlay to jffs2 |
| 10 | 10 | echo -n "copying files ... " |
| 11 | | cp -a /tmp/root/* /rom/jffs 2>&- |
| 11 | cp -a /tmp/root/* /rom/overlay 2>&- |
| 12 | 12 | echo "done" |
| 13 | 13 | } |
| 14 | 14 | |
| package/base-files/files/lib/firstboot/50_pivot |
| 9 | 9 | pivot /rom /mnt |
| 10 | 10 | mount -o move /mnt /tmp/root |
| 11 | 11 | |
| 12 | | # /jffs is the overlay |
| 12 | # /overlay is the overlay |
| 13 | 13 | # /rom is the readonly |
| 14 | | fopivot /jffs /rom |
| 14 | fopivot /overlay /rom |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | boot_hook_add switch2jffs with_fo_pivot |
| package/base-files/files/lib/firstboot/99_10_no_fo_cleanup |
| 5 | 5 | |
| 6 | 6 | no_fo_cleanup() { |
| 7 | 7 | echo "done" |
| 8 | | umount -l /jffs |
| 8 | umount -l /overlay |
| 9 | 9 | umount -l /tmp/root |
| 10 | 10 | exit 0 |
| 11 | 11 | } |
| package/base-files/files/lib/functions/boot.sh |
| 42 | 42 | { |
| 43 | 43 | cd $2 |
| 44 | 44 | find . -xdev -type d |
| 45 | | echo "./dev ./jffs ./mnt ./proc ./tmp" |
| 45 | echo "./dev ./overlay ./mnt ./proc ./tmp" |
| 46 | 46 | # xdev skips mounted directories |
| 47 | 47 | cd $1 |
| 48 | 48 | } | xargs mkdir -p |
| ... | ... | |
| 69 | 69 | mount -o move $2/dev /dev |
| 70 | 70 | mount -o move $2/tmp /tmp |
| 71 | 71 | mount -o move $2/sys /sys 2>&- |
| 72 | | mount -o move $2/jffs /jffs 2>&- |
| 73 | 72 | mount -o move $2/overlay /overlay 2>&- |
| 74 | 73 | return 0 |
| 75 | 74 | } |
| package/base-files/files/lib/preinit/40_mount_jffs2 |
| 3 | 3 | # Copyright (C) 2010 Vertical Communications |
| 4 | 4 | |
| 5 | 5 | find_mount_jffs2() { |
| 6 | | mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2 |
| 6 | mkdir -p /tmp/overlay |
| 7 | mount "$(find_mtd_part rootfs_data)" /tmp/overlay -t jffs2 |
| 7 | 8 | } |
| 8 | 9 | |
| 9 | 10 | jffs2_not_mounted() { |
| package/base-files/files/lib/preinit/70_pivot_jffs2_root |
| 5 | 5 | rootfs_pivot() { |
| 6 | 6 | check_skip || jffs2_not_mounted || { |
| 7 | 7 | echo "switching to jffs2" |
| 8 | | fopivot /jffs /rom && pi_mount_skip_next=true |
| 8 | mount -o move /tmp/overlay /overlay 2>&- |
| 9 | fopivot /overlay /rom && pi_mount_skip_next=true |
| 9 | 10 | } |
| 10 | 11 | } |
| 11 | 12 | |
| package/base-files/files/lib/upgrade/common.sh |
| 35 | 35 | |
| 36 | 36 | pivot() { # <new_root> <old_root> |
| 37 | 37 | mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1 |
| 38 | | mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/jffs && \ |
| 38 | mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/overlay && \ |
| 39 | 39 | mount -o move /proc $1/proc && \ |
| 40 | 40 | pivot_root $1 $1$2 || { |
| 41 | 41 | umount $1 $1 |
| ... | ... | |
| 43 | 43 | } |
| 44 | 44 | mount -o move $2/dev /dev |
| 45 | 45 | mount -o move $2/tmp /tmp |
| 46 | | mount -o move $2/jffs /jffs 2>&- |
| 46 | mount -o move $2/overlay /overlay 2>&- |
| 47 | 47 | return 0 |
| 48 | 48 | } |
| 49 | 49 | |
| ... | ... | |
| 63 | 63 | mount -o remount,ro /mnt |
| 64 | 64 | umount -l /mnt |
| 65 | 65 | |
| 66 | | grep /jffs /proc/mounts > /dev/null && { |
| 67 | | mount -o remount,ro /jffs |
| 68 | | umount -l /jffs |
| 66 | grep /overlay /proc/mounts > /dev/null && { |
| 67 | mount -o remount,ro /overlay |
| 68 | umount -l /overlay |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | # spawn a new shell from ramdisk to reduce the probability of cache issues |
| package/base-files/files/sbin/firstboot |
| 27 | 27 | boot_run_hook jffs2reset |
| 28 | 28 | else |
| 29 | 29 | mtd erase "$partname" |
| 30 | | mount "$mtdpart" /jffs -t jffs2 |
| 31 | | fopivot /jffs /rom 1 |
| 30 | mount "$mtdpart" /overlay -t jffs2 |
| 31 | fopivot /overlay /rom 1 |
| 32 | 32 | fi |
| 33 | 33 | fi |
| 34 | 34 | |
| package/block-extroot/files/50_determine_usb_root |
| 16 | 16 | # extroot requires extroot and fstab config files, therefore |
| 17 | 17 | # we assume configuration is incomplete and not to be used if either of them |
| 18 | 18 | # is missing (for jffs versions of these files on squashfs image) |
| 19 | | if [ "$jffs" = "/jffs" ] && [ -r "/jffs/etc/config/fstab" ]; then |
| 20 | | UCI_CONFIG_DIR="/jffs/etc/config" |
| 19 | if [ "$jffs" = "/tmp/overlay" ] && [ -r "/tmp/overlay/etc/config/fstab" ]; then |
| 20 | UCI_CONFIG_DIR="/tmp/overlay/etc/config" |
| 21 | 21 | ER_IS_SQUASHFS=true |
| 22 | 22 | fi |
| 23 | 23 | |
| package/block-extroot/files/60_pivot_usb_root |
| 10 | 10 | check_skip || [ "$pi_extroot_mount_success" != "true" ] || { |
| 11 | 11 | echo "switching to external rootfs" |
| 12 | 12 | if [ "$ER_IS_SQUASHFS" = "true" ]; then |
| 13 | | umount /jffs |
| 13 | umount /tmp/overlay |
| 14 | 14 | fi |
| 15 | 15 | mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true |
| 16 | 16 | } |
| package/opkg/files/opkg.conf |
| 2 | 2 | dest root / |
| 3 | 3 | dest ram /tmp |
| 4 | 4 | lists_dir ext /var/opkg-lists |
| 5 | | option overlay_root /jffs |
| 5 | option overlay_root /overlay |
Download the corresponding diff file