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
|
|
|
|
|
|
|
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);
|
|
|
|
cat $(LINUX_DIR)/arch/$(ARCH)/boot/dts/$(1).dtb >> $(KDIR)/zImage$(2)-$(1);
|
|
|
|
$(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
|
|
|
|
$(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs 128
|
2014-06-27 13:00:25 +00:00
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/UbinizeImage,$(dtb),,squashfs,$(UBI_OPTS));)
|
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-06-27 13:00:25 +00:00
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call BuildSysupgrade,$(1),$(dtb));)
|
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))
|