>From 03e36b778861f97d14d1343782667de5083dfd83 Mon Sep 17 00:00:00 2001 From: Matthew Fatheree <matthew.fathe...@belkin.com> Date: Sun, 4 May 2014 20:05:14 +0700 Subject: [PATCH 08/30] mamba mvebu: add jffs2 image target for Mamba
The firmware image of Mamba board is generated by concatenating the kernel image uImage with the jffs2 root file system (block size 128KB). If the kernel file is less than 3MB, the uImage is padded to 3MB before the concatenation applied, this makes the image complied with the partition layout of Mamba board Signed-off-by: Matthew Fatheree <matthew.fathe...@belkin.com> --- target/linux/mvebu/image/Makefile | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/target/linux/mvebu/image/Makefile b/target/linux/mvebu/image/Makefile index f8c9465..736fb9d 100644 --- a/target/linux/mvebu/image/Makefile +++ b/target/linux/mvebu/image/Makefile @@ -12,6 +12,11 @@ TARGET_DTBS := armada-xp-db armada-370-db armada-xp-openblocks-ax3-4 armada-370- ifeq ("$(PROFILE)","Mamba") TARGET_DTBS := armada-xp-mamba +JFFS2OPTS += --no-cleanmarkers +# override add_jffs2_mark +define add_jffs2_mark + echo "do nothing" +endef endif # PROFILE == Mamba LOADADDR:=0x00008000 @@ -47,6 +52,27 @@ define Image/Build/Initramfs $(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs)) endef +ifeq ("$(PROFILE)","Mamba") +define jffs2-128k-internal + if [ `stat -L -c %s $(KDIR)/uImage-$(2)` -lt 3145728 ]; \ + then \ + ( \ + dd if=$(KDIR)/uImage-$(2) bs=3072k conv=sync; \ + dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \ + ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img ; \ + else \ + ( \ + dd if=$(KDIR)/uImage-$(2) bs=128k conv=sync; \ + dd if=$(KDIR)/root.$(1) bs=128k conv=sync; \ + ) > $(BIN_DIR)/$(IMG_PREFIX)-$(1).img ; \ + fi +endef + +define Image/Build/jffs2-128k + $(foreach dtb,$(TARGET_DTBS),$(call jffs2-128k-internal,jffs2-128k,$(dtb))) +endef +endif # PROFILE == Mamba + define Image/Build $(call Image/Build/$(1)) dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync -- 1.7.9.5 __________________________________________________________________ Confidential This e-mail and any files transmitted with it are the property of Belkin International, Inc. and/or its affiliates, are confidential, and are intended solely for the use of the individual or entity to whom this e-mail is addressed. If you are not one of the named recipients or otherwise have reason to believe that you have received this e-mail in error, please notify the sender and delete this message immediately from your computer. Any other use, retention, dissemination, forwarding, printing or copying of this e-mail is strictly prohibited. Pour la version française: http://www.belkin.com/email-notice/French.html Für die deutsche Übersetzung: http://www.belkin.com/email-notice/German.html __________________________________________________________________ _______________________________________________ openwrt-devel mailing list openwrt-devel@lists.openwrt.org https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel