2013-01-08 22:20:16 +00:00
|
|
|
#
|
2014-06-17 15:13:33 +00:00
|
|
|
# Copyright (C) 2012-2014 OpenWrt.org
|
2013-01-08 22:20:16 +00:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
include $(INCLUDE_DIR)/image.mk
|
|
|
|
|
2013-01-15 19:55:40 +00:00
|
|
|
TARGET_DTBS := armada-xp-db armada-370-db armada-xp-openblocks-ax3-4 armada-370-mirabox \
|
2014-06-17 15:13:33 +00:00
|
|
|
armada-370-rd armada-xp-gp armada-xp-mamba
|
2013-01-08 22:20:16 +00:00
|
|
|
|
2014-12-26 13:45:18 +00:00
|
|
|
NANDBOARDS := armada-xp-mamba
|
|
|
|
|
2013-01-08 22:20:16 +00:00
|
|
|
LOADADDR:=0x00008000
|
|
|
|
|
|
|
|
JFFS2_BLOCKSIZE = 128k
|
|
|
|
|
2014-06-27 13:00:25 +00:00
|
|
|
UBIFS_OPTS = -F -m 2048 -e 124KiB -c 4096 -U
|
|
|
|
UBI_OPTS = -m 2048 -p 128KiB -s 512 -O 2048
|
|
|
|
|
|
|
|
KDIR_TMP:=$(KDIR)/tmp
|
|
|
|
|
|
|
|
|
2013-01-08 22:20:16 +00:00
|
|
|
UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
|
|
|
|
|
|
|
|
define Image/Build/MkuImage
|
|
|
|
mkimage -A arm -O linux -T kernel -a $(LOADADDR) -C none -e $(LOADADDR) \
|
|
|
|
-n 'ARM OpenWrt Linux-$(LINUX_VERSION)' -d $(1) $(2);
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/DTB
|
2013-06-27 19:58:31 +00:00
|
|
|
cp $(KDIR)/zImage$(2) $(KDIR)/zImage$(2)-$(1);
|
2014-07-21 18:42:06 +00:00
|
|
|
cat $(DTS_DIR)/$(1).dtb >> $(KDIR)/zImage$(2)-$(1);
|
2013-06-27 19:58:31 +00:00
|
|
|
$(call Image/Build/MkuImage,$(KDIR)/zImage$(2)-$(1),$(KDIR)/uImage$(2)-$(1))
|
|
|
|
cp $(KDIR)/uImage$(2)-$(1) $(UIMAGE)$(2)-$(1);
|
2013-01-08 22:20:16 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel
|
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb)))
|
2014-01-15 18:38:51 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
2013-01-08 22:20:16 +00:00
|
|
|
$(call Image/Build/Initramfs)
|
2014-01-15 18:38:51 +00:00
|
|
|
endif
|
2013-01-08 22:20:16 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/squashfs
|
2015-01-14 11:37:29 +00:00
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
2014-12-26 13:45:18 +00:00
|
|
|
$(foreach nandboard,$(NANDBOARDS),$(call Image/Build/UbinizeImage,$(nandboard),,squashfs,$(UBI_OPTS));)
|
2014-06-29 13:10:35 +00:00
|
|
|
( \
|
|
|
|
dd if=$(KDIR)/uImage-armada-xp-mamba bs=3072k conv=sync; \
|
2014-12-26 13:33:22 +00:00
|
|
|
dd if=$(KDIR)/$(IMG_PREFIX)-armada-xp-mamba-squashfs-ubinized.bin \
|
2014-06-29 13:10:35 +00:00
|
|
|
bs=2048 conv=sync; \
|
2014-07-14 15:02:38 +00:00
|
|
|
) > $(BIN_DIR)/$(IMG_PREFIX)-armada-xp-mamba-squashfs-factory.img
|
2013-01-08 22:20:16 +00:00
|
|
|
endef
|
|
|
|
|
2013-06-27 19:58:31 +00:00
|
|
|
define Image/Build/Initramfs
|
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs))
|
|
|
|
endef
|
|
|
|
|
2014-06-27 13:00:25 +00:00
|
|
|
define BuildSysupgrade
|
|
|
|
$(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
|
|
|
|
endef
|
|
|
|
|
2013-01-08 22:20:16 +00:00
|
|
|
define Image/Build
|
|
|
|
$(call Image/Build/$(1))
|
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
|
2014-12-26 13:45:18 +00:00
|
|
|
$(foreach nandboard,$(NANDBOARDS),$(call BuildSysupgrade,$(1),$(nandboard));)
|
2013-06-27 19:58:31 +00:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
$(call Image/Build/Initramfs)
|
|
|
|
endif
|
2013-01-08 22:20:16 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|