2013-01-09 06:20:16 +08:00
|
|
|
#
|
2014-06-17 23:13:33 +08:00
|
|
|
# Copyright (C) 2012-2014 OpenWrt.org
|
2013-01-09 06:20:16 +08: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-16 03:55:40 +08:00
|
|
|
TARGET_DTBS := armada-xp-db armada-370-db armada-xp-openblocks-ax3-4 armada-370-mirabox \
|
2014-06-17 23:13:33 +08:00
|
|
|
armada-370-rd armada-xp-gp armada-xp-mamba
|
2013-01-09 06:20:16 +08:00
|
|
|
|
2014-12-26 21:45:18 +08:00
|
|
|
NANDBOARDS := armada-xp-mamba
|
|
|
|
|
2013-01-09 06:20:16 +08:00
|
|
|
LOADADDR:=0x00008000
|
|
|
|
|
|
|
|
JFFS2_BLOCKSIZE = 128k
|
|
|
|
|
2014-06-27 21:00:25 +08: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-09 06:20:16 +08:00
|
|
|
UIMAGE:=$(BIN_DIR)/$(IMG_PREFIX)-uImage
|
|
|
|
|
|
|
|
define Image/Build/DTB
|
2013-06-28 03:58:31 +08:00
|
|
|
cp $(KDIR)/zImage$(2) $(KDIR)/zImage$(2)-$(1);
|
2014-07-22 02:42:06 +08:00
|
|
|
cat $(DTS_DIR)/$(1).dtb >> $(KDIR)/zImage$(2)-$(1);
|
2015-01-14 19:39:20 +08:00
|
|
|
$(call Image/BuildKernel/MkuImage, \
|
|
|
|
none, $(LOADADDR), $(LOADADDR), \
|
|
|
|
$(KDIR)/zImage$(2)-$(1), $(KDIR)/uImage$(2)-$(1))
|
2013-06-28 03:58:31 +08:00
|
|
|
cp $(KDIR)/uImage$(2)-$(1) $(UIMAGE)$(2)-$(1);
|
2013-01-09 06:20:16 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel
|
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb)))
|
2014-01-16 02:38:51 +08:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
2013-01-09 06:20:16 +08:00
|
|
|
$(call Image/Build/Initramfs)
|
2014-01-16 02:38:51 +08:00
|
|
|
endif
|
2013-01-09 06:20:16 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/Build/squashfs
|
2015-01-14 19:37:29 +08:00
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
|
2014-12-26 21:45:18 +08:00
|
|
|
$(foreach nandboard,$(NANDBOARDS),$(call Image/Build/UbinizeImage,$(nandboard),,squashfs,$(UBI_OPTS));)
|
2014-06-29 21:10:35 +08:00
|
|
|
( \
|
|
|
|
dd if=$(KDIR)/uImage-armada-xp-mamba bs=3072k conv=sync; \
|
2014-12-26 21:33:22 +08:00
|
|
|
dd if=$(KDIR)/$(IMG_PREFIX)-armada-xp-mamba-squashfs-ubinized.bin \
|
2014-06-29 21:10:35 +08:00
|
|
|
bs=2048 conv=sync; \
|
2014-07-14 23:02:38 +08:00
|
|
|
) > $(BIN_DIR)/$(IMG_PREFIX)-armada-xp-mamba-squashfs-factory.img
|
2013-01-09 06:20:16 +08:00
|
|
|
endef
|
|
|
|
|
2013-06-28 03:58:31 +08:00
|
|
|
define Image/Build/Initramfs
|
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs))
|
|
|
|
endef
|
|
|
|
|
2014-06-27 21:00:25 +08:00
|
|
|
define BuildSysupgrade
|
|
|
|
$(call Image/Build/SysupgradeNAND,$(2),$(1),$(KDIR)/uImage-$(2))
|
|
|
|
endef
|
|
|
|
|
2013-01-09 06:20:16 +08: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 21:45:18 +08:00
|
|
|
$(foreach nandboard,$(NANDBOARDS),$(call BuildSysupgrade,$(1),$(nandboard));)
|
2013-06-28 03:58:31 +08:00
|
|
|
ifneq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),)
|
|
|
|
$(call Image/Build/Initramfs)
|
|
|
|
endif
|
2013-01-09 06:20:16 +08:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|