openwrtv4/target/linux/ipq806x/image/Makefile
Jonas Gorski c7d8377931 ipq806x: switch to new image build system
Switch ipq806x to the new image build system. Image files might change
slightly their names, but the generated files should not change.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 46602
2015-08-14 15:10:54 +00:00

71 lines
1.5 KiB
Makefile

# Copyright (c) 2014 The Linux Foundation. All rights reserved.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk
UBIFS_OPTS = -m 2048 -e 124KiB -c 4096 -U -F
UBINIZE_OPTS = -m 2048 -p 128KiB
KERNEL_LOADADDR := 0x42208000
define Image/Prepare
$(CP) $(LINUX_DIR)/vmlinux $(KDIR)/$(IMG_PREFIX)-vmlinux.elf
endef
define Image/BuildKernel
$(CP) $(KDIR)/$(IMG_PREFIX)-vmlinux.elf $(BIN_DIR)
endef
define Image/Build/squashfs
$(call prepare_generic_squashfs,$(KDIR)/root.squashfs)
endef
define Image/Build
$(call Image/Build/$(1),$(1))
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-root.img bs=2k conv=sync
endef
define Build/append-dtb
cat $(DTS_DIR)/$(DEVICE_DTS).dtb >> $@
endef
define Device/Default
PROFILES := Default
KERNEL_INITRAMFS_PREFIX := $$(IMG_PREFIX)-$(1)-initramfs
DEVICE_DTS :=
KERNEL_PREFIX := $$(IMAGE_PREFIX)
endef
DEVICE_VARS += DEVICE_DTS
define Device/LegacyImage
KERNEL_SUFFIX := -zImage
KERNEL = kernel-bin | append-dtb
KERNEL_NAME := zImage
KERNEL_INSTALL := 1
endef
define Device/FitImage
KERNEL_SUFFIX := -fit-uImage.itb
KERNEL = kernel-bin | gzip | fit gzip $$(DTS_DIR)/$$(DEVICE_DTS).dtb
KERNEL_NAME := Image
KERNEL_INSTALL := 1
endef
define Device/AP148
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-ap148
endef
define Device/AP148-legacy
$(call Device/LegacyImage)
DEVICE_DTS := qcom-ipq8064-ap148
endef
define Device/DB149
$(call Device/FitImage)
DEVICE_DTS := qcom-ipq8064-db149
endef
TARGET_DEVICES += AP148 AP148-legacy DB149
$(eval $(call BuildImage))