2013-01-09 06:20:16 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2012 OpenWrt.org
|
|
|
|
#
|
|
|
|
# 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 \
|
|
|
|
armada-370-rd
|
2013-01-09 06:20:16 +08:00
|
|
|
|
|
|
|
LOADADDR:=0x00008000
|
|
|
|
|
|
|
|
JFFS2_BLOCKSIZE = 128k
|
|
|
|
|
|
|
|
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-28 03:58:31 +08: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-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
|
|
|
|
$(STAGING_DIR_HOST)/bin/padjffs2 $(KDIR)/root.squashfs 128
|
|
|
|
endef
|
|
|
|
|
2013-06-28 03:58:31 +08:00
|
|
|
define Image/Build/Initramfs
|
|
|
|
$(foreach dtb,$(TARGET_DTBS),$(call Image/Build/DTB,$(dtb),-initramfs))
|
|
|
|
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
|
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))
|