better support for handling various jffs2 eraseblock sizes
authorFelix Fietkau <nbd@openwrt.org>
Mon, 16 Jul 2007 22:06:45 +0000 (22:06 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 16 Jul 2007 22:06:45 +0000 (22:06 +0000)
SVN-Revision: 8011

include/image.mk
target/linux/amcc-2.6/image/Makefile

index 84549c5543836977fb66bf75812ecd23ad3a3b21..5fc87efa1d951e8d0127feb7fff688ca45bf918c 100644 (file)
@@ -18,6 +18,8 @@ JFFS2OPTS     :=  --pad --big-endian --squash
 SQUASHFS_OPTS :=  -be
 endif
 
+JFFS2_BLOCKSIZE ?= 64k 128k
+
 define add_jffs2_mark
        echo -ne '\xde\xad\xc0\xde' >> $(1)
 endef
@@ -36,19 +38,11 @@ ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
     define Image/mkfs/jffs2
                rm -rf $(BUILD_DIR)/root/jffs
                
-               $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x10000 -o $(KDIR)/root.jffs2-64k -d $(BUILD_DIR)/root
-               $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x20000 -o $(KDIR)/root.jffs2-128k -d $(BUILD_DIR)/root
-               $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e 0x40000 -o $(KDIR)/root.jffs2-256k -d $(BUILD_DIR)/root
-
-               
-               # add End-of-Filesystem markers
-               $(call add_jffs2_mark,$(KDIR)/root.jffs2-64k)
-               $(call add_jffs2_mark,$(KDIR)/root.jffs2-128k)
-               $(call add_jffs2_mark,$(KDIR)/root.jffs2-256k)
-       
-               $(call Image/Build,jffs2-64k)
-               $(call Image/Build,jffs2-128k)
-               $(call Image/Build,jffs2-256k)
+               $(foreach SZ,$(JFFS2_BLOCKSIZE),\
+                       $(STAGING_DIR)/bin/mkfs.jffs2 $(JFFS2OPTS) -e $(patsubst %k,%KiB,$(SZ)) -o $(KDIR)/root.jffs2-$(SZ) -d $(BUILD_DIR)/root; \
+                       $(call add_jffs2_mark,$(KDIR)/root.jffs2-$(SZ)); \
+                       $(call Image/Build,jffs2-$(SZ)) \
+               )
     endef
   endif
     
index bd391f02f2c0258733f77798e98a6d5dba9cd3c5..09ff061dba188f0750f3e1a003a31525b7a722e3 100644 (file)
@@ -7,6 +7,8 @@
 include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
+JFFS2_BLOCKSIZE=256k
+
 define Image/Prepare
        cp $(LINUX_DIR)/arch/ppc/boot/images/uImage $(KDIR)/uImage
 endef