浏览代码

ubifs: enable building modular images

Now it is possible to build ubi/ubifs images for only selected boards inside
single target.

Signed-off-by: Luka Perkov <[email protected]>

SVN-Revision: 38375
Luka Perkov 12 年之前
父节点
当前提交
c808a4a7ef
共有 3 个文件被更改,包括 32 次插入10 次删除
  1. 16 6
      include/image.mk
  2. 14 2
      target/linux/kirkwood/image/Makefile
  3. 2 2
      target/linux/xburst/image/Makefile

+ 16 - 6
include/image.mk

@@ -35,7 +35,7 @@ ifeq ($(CONFIG_JFFS2_LZMA),y)
   JFFS2OPTS += -X lzma --compression-mode=size
 endif
 ifneq ($(CONFIG_JFFS2_RTIME),y)
-  JFFS2OPTS +=  -x rtime
+  JFFS2OPTS += -x rtime
 endif
 ifneq ($(CONFIG_JFFS2_ZLIB),y)
   JFFS2OPTS += -x zlib
@@ -115,7 +115,8 @@ endif
 
 ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
     define Image/mkfs/ubifs
-		$(CP) ./ubinize.cfg $(KDIR)
+
+        ifdef UBIFS_OPTS
 		$(STAGING_DIR_HOST)/bin/mkfs.ubifs \
 			$(UBIFS_OPTS) \
 			$(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \
@@ -125,10 +126,19 @@ ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
 			--jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE) \
 			-o $(KDIR)/root.ubifs \
 			-d $(TARGET_DIR)
-		$(call Image/Build,ubifs)
-		(cd $(KDIR); \
-		$(STAGING_DIR_HOST)/bin/ubinize $(UBINIZE_OPTS) -o $(KDIR)/root.ubi ubinize.cfg)
-		$(call Image/Build,ubi)
+        endif
+	$(call Image/Build,ubifs)
+
+        ifdef UBI_OPTS
+		$(CP) ./ubinize.cfg $(KDIR)
+		( cd $(KDIR); \
+		$(STAGING_DIR_HOST)/bin/ubinize \
+			$(UBI_OPTS) \
+			-o $(KDIR)/root.ubi \
+			ubinize.cfg \
+		)
+        endif
+	$(call Image/Build,ubi)
     endef
 endif
 

+ 14 - 2
target/linux/kirkwood/image/Makefile

@@ -8,8 +8,6 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/image.mk
 
 NAND_BLOCKSIZE := 2048:128k
-UBIFS_OPTS := -m 2048 -e 126KiB -c 4096 -U
-UBINIZE_OPTS := -m 2048 -p 128KiB -s 512
 
 define Image/BuildKernel
 	$(CP) $(KDIR)/uImage $(BIN_DIR)/$(IMG_PREFIX)-uImage
@@ -60,4 +58,18 @@ define Image/Build/squashfs
 	) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
 endef
 
+define Image/Build/ubifs
+
+ ifdef UBIFS_OPTS
+	$(CP) $(KDIR)/root.$(1) $(BIN_DIR)/$(IMG_PREFIX)-$(1).img
+ endif
+endef
+
+define Image/Build/ubi
+
+ ifdef UBI_OPTS
+	$(call Image/Build/ubifs,$(1))
+ endif
+endef
+
 $(eval $(call BuildImage))

+ 2 - 2
target/linux/xburst/image/Makefile

@@ -10,11 +10,11 @@ include $(INCLUDE_DIR)/image.mk
 JFFS2_BLOCKSIZE=256k 512k
 
 ifneq ($(CONFIG_TARGET_xburst_qi_lb60),)
+UBI_OPTS = -m 4096 -p 512KiB
 UBIFS_OPTS = -m 4096 -e 516096 -c 4095
-UBINIZE_OPTS = -m 4096 -p 512KiB
 else
+UBI_OPTS = -m 2048 -p 128KiB -s 512
 UBIFS_OPTS = -m 2048 -e 126KiB -c 4096
-UBINIZE_OPTS = -m 2048 -p 128KiB -s 512
 endif
 
 UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage.bin