Here is the patch to change from /jffs to /overlay. This will make sure when an overlay is used, whether usb root or squashfs/jffs it will have the same location.
It also means that opkg.conf now will not need to be different for block-extroot compared to normal squashfs. Regards, Daniel -- And that's my crabbing done for the day. Got it out of the way early, now I have the rest of the afternoon to sniff fragrant tea-roses or strangle cute bunnies or something. -- Michael Devore GnuPG Key Fingerprint 86 F5 81 A5 D4 2E 1F 1C http://gnupg.org The C Shore (Daniel Dickinson's Website) http://cshore.is-a-geek.com
Index: include/image.mk =================================================================== --- include/image.mk (revision 19935) +++ include/image.mk (working copy) @@ -62,14 +62,13 @@ $(call Image/Build,jffs2-$(1)) endef define Image/mkfs/jffs2 - rm -rf $(TARGET_DIR)/jffs $(foreach SZ,$(JFFS2_BLOCKSIZE),$(call Image/mkfs/jffs2/sub,$(SZ))) endef endif ifeq ($(CONFIG_TARGET_ROOTFS_SQUASHFS),y) define Image/mkfs/squashfs - @mkdir -p $(TARGET_DIR)/jffs + @mkdir -p $(TARGET_DIR)/overlay $(MKSQUASHFS_CMD) $(TARGET_DIR) $(KDIR)/root.squashfs -nopad -noappend -root-owned $(SQUASHFS_OPTS) $(call Image/Build,squashfs) endef Index: package/base-files/files/lib/upgrade/common.sh =================================================================== --- package/base-files/files/lib/upgrade/common.sh (revision 19935) +++ package/base-files/files/lib/upgrade/common.sh (working copy) @@ -35,7 +35,7 @@ pivot() { # <new_root> <old_root> mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1 - mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/jffs && \ + mkdir -p $1$2 $1/proc $1/dev $1/tmp $1/overlay && \ mount -o move /proc $1/proc && \ pivot_root $1 $1$2 || { umount $1 $1 @@ -43,7 +43,7 @@ } mount -o move $2/dev /dev mount -o move $2/tmp /tmp - mount -o move $2/jffs /jffs 2>&- + mount -o move $2/overlay /overlay 2>&- return 0 } @@ -63,9 +63,9 @@ mount -o remount,ro /mnt umount -l /mnt - grep /jffs /proc/mounts > /dev/null && { - mount -o remount,ro /jffs - umount -l /jffs + grep /overlay /proc/mounts > /dev/null && { + mount -o remount,ro /overlay + umount -l /overlay } # spawn a new shell from ramdisk to reduce the probability of cache issues Index: package/base-files/files/lib/functions/boot.sh =================================================================== --- package/base-files/files/lib/functions/boot.sh (revision 19935) +++ package/base-files/files/lib/functions/boot.sh (working copy) @@ -38,7 +38,7 @@ { cd $2 find . -xdev -type d - echo "./dev ./jffs ./mnt ./proc ./tmp" + echo "./dev ./overlay ./mnt ./proc ./tmp" # xdev skips mounted directories cd $1 } | xargs mkdir -p @@ -65,7 +65,6 @@ mount -o move $2/dev /dev mount -o move $2/tmp /tmp mount -o move $2/sys /sys 2>&- - mount -o move $2/jffs /jffs 2>&- mount -o move $2/overlay /overlay 2>&- return 0 } Index: package/base-files/files/lib/preinit/40_mount_jffs2 =================================================================== --- package/base-files/files/lib/preinit/40_mount_jffs2 (revision 19935) +++ package/base-files/files/lib/preinit/40_mount_jffs2 (working copy) @@ -3,7 +3,8 @@ # Copyright (C) 2010 Vertical Communications find_mount_jffs2() { - mount "$(find_mtd_part rootfs_data)" /jffs -t jffs2 + mkdir -p /tmp/overlay + mount "$(find_mtd_part rootfs_data)" /tmp/overlay -t jffs2 } jffs2_not_mounted() { Index: package/base-files/files/lib/preinit/70_pivot_jffs2_root =================================================================== --- package/base-files/files/lib/preinit/70_pivot_jffs2_root (revision 19935) +++ package/base-files/files/lib/preinit/70_pivot_jffs2_root (working copy) @@ -5,7 +5,8 @@ rootfs_pivot() { check_skip || jffs2_not_mounted || { echo "switching to jffs2" - fopivot /jffs /rom && pi_mount_skip_next=true + mount -o move /tmp/overlay /overlay 2>&- + fopivot /overlay /rom && pi_mount_skip_next=true } } Index: package/base-files/files/lib/firstboot/30_no_fo_pivot =================================================================== --- package/base-files/files/lib/firstboot/30_no_fo_pivot (revision 19935) +++ package/base-files/files/lib/firstboot/30_no_fo_pivot (working copy) @@ -5,7 +5,7 @@ no_fo_pivot() { # switch to the new (empty) jffs2 - fopivot /jffs /rom 1 + fopivot /overlay /rom 1 } boot_hook_add no_fo no_fo_pivot Index: package/base-files/files/lib/firstboot/99_10_no_fo_cleanup =================================================================== --- package/base-files/files/lib/firstboot/99_10_no_fo_cleanup (revision 19935) +++ package/base-files/files/lib/firstboot/99_10_no_fo_cleanup (working copy) @@ -5,7 +5,7 @@ no_fo_cleanup() { echo "done" - umount -l /jffs + umount -l /overlay umount -l /tmp/root exit 0 } Index: package/base-files/files/lib/firstboot/20_no_fo_mount_jffs =================================================================== --- package/base-files/files/lib/firstboot/20_no_fo_mount_jffs (revision 19935) +++ package/base-files/files/lib/firstboot/20_no_fo_mount_jffs (working copy) @@ -5,11 +5,11 @@ no_fo_mount_jffs() { # initialize jffs2 - mount "$mtdpart" /jffs -t jffs2 || exit + mount "$mtdpart" /overlay -t jffs2 || exit # workaround to ensure that union can attach properly sync - ls /jffs >/dev/null + ls /overlay >/dev/null } boot_hook_add no_fo no_fo_mount_jffs Index: package/base-files/files/lib/firstboot/30_is_rootfs_mounted =================================================================== --- package/base-files/files/lib/firstboot/30_is_rootfs_mounted (revision 19935) +++ package/base-files/files/lib/firstboot/30_is_rootfs_mounted (working copy) @@ -4,7 +4,7 @@ # Copyright (C) 2010 Vertical Communications skip_if_rootfs_mounted() { - mount "$mtdpart" /rom/jffs -t jffs2 || exit + mount "$mtdpart" /rom/overlay -t jffs2 || exit } boot_hook_add switch2jffs skip_if_rootfs_mounted Index: package/base-files/files/lib/firstboot/50_pivot =================================================================== --- package/base-files/files/lib/firstboot/50_pivot (revision 19935) +++ package/base-files/files/lib/firstboot/50_pivot (working copy) @@ -9,9 +9,9 @@ pivot /rom /mnt mount -o move /mnt /tmp/root - # /jffs is the overlay + # /overlay is the overlay # /rom is the readonly - fopivot /jffs /rom + fopivot /overlay /rom } boot_hook_add switch2jffs with_fo_pivot Index: package/base-files/files/lib/firstboot/40_copy_ramoverlay =================================================================== --- package/base-files/files/lib/firstboot/40_copy_ramoverlay (revision 19935) +++ package/base-files/files/lib/firstboot/40_copy_ramoverlay (working copy) @@ -8,7 +8,7 @@ mount -o remount,ro none / 2>&- # copy ramoverlay to jffs2 echo -n "copying files ... " - cp -a /tmp/root/* /rom/jffs 2>&- + cp -a /tmp/root/* /rom/overlay 2>&- echo "done" } Index: package/base-files/files/sbin/firstboot =================================================================== --- package/base-files/files/sbin/firstboot (revision 19935) +++ package/base-files/files/sbin/firstboot (working copy) @@ -23,8 +23,8 @@ boot_run_hook jffs2reset else mtd erase "$partname" - mount "$mtdpart" /jffs -t jffs2 - fopivot /jffs /rom 1 + mount "$mtdpart" /overlay -t jffs2 + fopivot /overlay /rom 1 fi else set_mtd_part Index: package/base-files/Makefile =================================================================== --- package/base-files/Makefile (revision 19935) +++ package/base-files/Makefile (working copy) @@ -364,7 +364,7 @@ mkdir -p $(1)/dev mkdir -p $(1)/etc/crontabs mkdir -p $(1)/etc/rc.d - mkdir -p $(1)/jffs + mkdir -p $(1)/overlay mkdir -p $(1)/lib/firmware $(if $(LIB_SUFFIX),-ln -s lib $(1)/lib$(LIB_SUFFIX)) mkdir -p $(1)/mnt Index: package/opkg/files/opkg.conf =================================================================== --- package/opkg/files/opkg.conf (revision 19935) +++ package/opkg/files/opkg.conf (working copy) @@ -2,4 +2,4 @@ dest root / dest ram /tmp lists_dir ext /var/opkg-lists -option overlay_root /jffs +option overlay_root /overlay Index: package/block-extroot/files/60_pivot_usb_root =================================================================== --- package/block-extroot/files/60_pivot_usb_root (revision 19935) +++ package/block-extroot/files/60_pivot_usb_root (working copy) @@ -10,7 +10,7 @@ check_skip || [ "$pi_extroot_mount_success" != "true" ] || { echo "switching to external rootfs" if [ "$ER_IS_SQUASHFS" = "true" ]; then - umount /jffs + umount /tmp/overlay fi mount -o remount,ro / && fopivot /overlay /rom && pi_mount_skip_next=true } Index: package/block-extroot/files/50_determine_usb_root =================================================================== --- package/block-extroot/files/50_determine_usb_root (revision 19935) +++ package/block-extroot/files/50_determine_usb_root (working copy) @@ -16,8 +16,8 @@ # extroot requires extroot and fstab config files, therefore # we assume configuration is incomplete and not to be used if either of them # is missing (for jffs versions of these files on squashfs image) - if [ "$jffs" = "/jffs" ] && [ -r "/jffs/etc/config/fstab" ]; then - UCI_CONFIG_DIR="/jffs/etc/config" + if [ "$jffs" = "/tmp/overlay" ] && [ -r "/tmp/overlay/etc/config/fstab" ]; then + UCI_CONFIG_DIR="/tmp/overlay/etc/config" ER_IS_SQUASHFS=true fi
signature.asc
Description: This is a digitally signed message part
_______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/mailman/listinfo/openwrt-devel