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 <luka@openwrt.org>

SVN-Revision: 38375
owl
Luka Perkov 2013-10-12 21:44:48 +00:00
parent 05625233ed
commit c808a4a7ef
3 changed files with 32 additions and 10 deletions

View File

@ -115,7 +115,8 @@ endif
ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),) ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
define Image/mkfs/ubifs define Image/mkfs/ubifs
$(CP) ./ubinize.cfg $(KDIR)
ifdef UBIFS_OPTS
$(STAGING_DIR_HOST)/bin/mkfs.ubifs \ $(STAGING_DIR_HOST)/bin/mkfs.ubifs \
$(UBIFS_OPTS) \ $(UBIFS_OPTS) \
$(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \ $(if $(CONFIG_TARGET_UBIFS_FREE_SPACE_FIXUP),--space-fixup) \
@ -125,9 +126,18 @@ ifneq ($(CONFIG_TARGET_ROOTFS_UBIFS),)
--jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE) \ --jrn-size=$(CONFIG_TARGET_UBIFS_JOURNAL_SIZE) \
-o $(KDIR)/root.ubifs \ -o $(KDIR)/root.ubifs \
-d $(TARGET_DIR) -d $(TARGET_DIR)
endif
$(call Image/Build,ubifs) $(call Image/Build,ubifs)
(cd $(KDIR); \
$(STAGING_DIR_HOST)/bin/ubinize $(UBINIZE_OPTS) -o $(KDIR)/root.ubi ubinize.cfg) 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) $(call Image/Build,ubi)
endef endef
endif endif

View File

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

View File

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