2009-08-30 19:15:51 +00:00
|
|
|
#
|
2011-10-31 09:23:44 +00:00
|
|
|
# Copyright (C) 2008-2011 OpenWrt.org
|
2009-08-30 19:15:51 +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
|
|
|
|
|
|
|
|
define imgname
|
2010-07-31 11:42:17 +00:00
|
|
|
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(1)
|
2009-08-30 19:15:51 +00:00
|
|
|
endef
|
|
|
|
|
2012-02-23 19:58:03 +00:00
|
|
|
define sysupname
|
|
|
|
$(call imgname,$(1),$(2))-sysupgrade.bin
|
|
|
|
endef
|
|
|
|
|
2010-04-12 23:15:56 +00:00
|
|
|
VMLINUX:=$(IMG_PREFIX)-vmlinux
|
|
|
|
UIMAGE:=$(IMG_PREFIX)-uImage
|
2013-04-03 09:59:51 +00:00
|
|
|
|
|
|
|
define Image/Build/Initramfs
|
|
|
|
$(call Image/Build/Profile/$(PROFILE),initramfs)
|
|
|
|
endef
|
2009-08-30 19:15:51 +00:00
|
|
|
|
2016-02-01 17:41:29 +00:00
|
|
|
DEVICE_VARS += DTS IMAGE_SIZE
|
2015-01-10 15:26:53 +00:00
|
|
|
|
2015-01-10 15:26:38 +00:00
|
|
|
loadaddr-y := 0x80000000
|
|
|
|
loadaddr-$(CONFIG_TARGET_ramips_rt288x) := 0x88000000
|
|
|
|
loadaddr-$(CONFIG_TARGET_ramips_mt7621) := 0x80001000
|
2009-08-30 19:15:51 +00:00
|
|
|
|
2015-01-10 15:26:53 +00:00
|
|
|
KERNEL_LOADADDR := $(loadaddr-y)
|
|
|
|
|
|
|
|
KERNEL_DTB = kernel-bin | patch-dtb | lzma
|
|
|
|
define Device/Default
|
2016-04-09 10:24:40 +00:00
|
|
|
PROFILES = Default $$(DTS)
|
2016-01-06 18:39:06 +00:00
|
|
|
KERNEL_DEPENDS = $$(wildcard ../dts/$$(DTS).dts)
|
2015-01-10 15:26:53 +00:00
|
|
|
KERNEL := $(KERNEL_DTB) | uImage lzma
|
|
|
|
IMAGES := sysupgrade.bin
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_8M)
|
2015-05-27 14:56:22 +00:00
|
|
|
IMAGE/sysupgrade.bin := append-kernel | append-rootfs | pad-rootfs | check-size $$$$(IMAGE_SIZE)
|
2015-01-10 15:26:53 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/patch-dtb
|
2015-12-10 12:39:32 +00:00
|
|
|
$(call Image/BuildDTB,../dts/$(DTS).dts,$@.dtb)
|
2015-01-10 15:26:53 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Build/trx
|
|
|
|
$(STAGING_DIR_HOST)/bin/trx \
|
|
|
|
-o $@ \
|
|
|
|
-m $(IMAGE_SIZE) \
|
|
|
|
-f $(word 1,$^) \
|
|
|
|
-a 4 -f $(word 2,$^)
|
|
|
|
endef
|
|
|
|
|
2015-01-17 21:20:05 +00:00
|
|
|
define Build/relocate-kernel
|
|
|
|
( \
|
2015-05-29 11:28:10 +00:00
|
|
|
dd if=$(KDIR)/loader.bin bs=32 conv=sync && \
|
2015-01-17 21:20:05 +00:00
|
|
|
perl -e '@s = stat("$@"); print pack("V", @s[7])' && \
|
|
|
|
cat $@ \
|
|
|
|
) > $@.new
|
|
|
|
mv $@.new $@
|
|
|
|
endef
|
|
|
|
|
2012-08-17 17:56:07 +00:00
|
|
|
define MkCombineduImage
|
|
|
|
$(call PatchKernelLzma,$(2),$(3))
|
|
|
|
if [ `stat -c%s "$(KDIR)/vmlinux-$(2).bin.lzma"` -gt `expr $(4) - 64` ]; then \
|
2013-02-21 11:45:33 +00:00
|
|
|
echo "Warning: $(KDIR)/vmlinux-$(2).bin.lzma is too big" >&2; \
|
2012-08-17 17:56:07 +00:00
|
|
|
else if [ `stat -c%s "$(KDIR)/root.$(1)"` -gt $(5) ]; then \
|
2013-02-21 11:45:33 +00:00
|
|
|
echo "Warning: $(KDIR)/root.$(1) is too big" >&2; \
|
2012-08-17 17:56:07 +00:00
|
|
|
else \
|
|
|
|
( dd if=$(KDIR)/vmlinux-$(2).bin.lzma bs=`expr $(4) - 64` conv=sync ; dd if=$(KDIR)/root.$(1) ) > $(KDIR)/vmlinux-$(2).bin.lzma.combined ; \
|
|
|
|
fi ; fi
|
|
|
|
$(call MkImage,lzma,$(KDIR)/vmlinux-$(2).bin.lzma.combined,$(call sysupname,$(1),$(2)),$(6))
|
|
|
|
endef
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
#
|
|
|
|
# The real magic happens inside these templates
|
|
|
|
#
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(1), compression method
|
|
|
|
# $(2), filename of image data
|
|
|
|
# $(3), output filename
|
2013-04-03 09:59:51 +00:00
|
|
|
define MkImage
|
|
|
|
$(eval imagename=$(if $(4),$(4),MIPS OpenWrt Linux-$(LINUX_VERSION)))
|
2015-01-10 15:26:38 +00:00
|
|
|
-mkimage -A mips -O linux -T kernel -C $(1) -a $(loadaddr-y) -e $(loadaddr-y) \
|
2013-04-03 09:59:51 +00:00
|
|
|
-n "$(imagename)" \
|
|
|
|
-d $(2) $(3)
|
2012-12-10 14:13:01 +00:00
|
|
|
endef
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
define CompressLzma
|
|
|
|
$(STAGING_DIR_HOST)/bin/lzma e $(1) -lc1 -lp2 -pb2 $(2)
|
2012-12-10 14:13:01 +00:00
|
|
|
endef
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
define MkImageSysupgrade/squashfs
|
|
|
|
$(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-$(if $(4),$(4),sysupgrade).bin)
|
|
|
|
cat $(KDIR)/vmlinux-$(2).uImage $(KDIR)/root.$(1) > $(KDIR)/$(output_name)
|
|
|
|
$(call prepare_generic_squashfs,$(KDIR)/$(output_name))
|
|
|
|
if [ `stat -c%s "$(KDIR)/$(output_name)"` -gt $(3) ]; then \
|
|
|
|
echo "Warning: $(KDIR)/$(output_name) is too big" >&2; \
|
|
|
|
else \
|
|
|
|
$(CP) $(KDIR)/$(output_name) $(BIN_DIR)/$(output_name); \
|
2012-02-23 19:58:03 +00:00
|
|
|
fi
|
2011-07-06 08:04:52 +00:00
|
|
|
endef
|
|
|
|
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(1), lowercase board name like "mt7620a_v22sg"
|
|
|
|
# $(2), DTS filename without .dts extension
|
|
|
|
# $(3), optional filename suffix, e.g. "-initramfs"
|
2013-04-03 09:59:51 +00:00
|
|
|
define PatchKernelLzmaDtb
|
2013-06-29 08:41:03 +00:00
|
|
|
cp $(KDIR)/vmlinux$(3) $(KDIR)/vmlinux-$(1)$(3)
|
2013-04-03 09:59:51 +00:00
|
|
|
$(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $(KDIR)/$(2).dtb ../dts/$(2).dts
|
2013-06-29 08:41:03 +00:00
|
|
|
$(STAGING_DIR_HOST)/bin/patch-dtb $(KDIR)/vmlinux-$(1)$(3) $(KDIR)/$(2).dtb
|
|
|
|
$(call CompressLzma,$(KDIR)/vmlinux-$(1)$(3),$(KDIR)/vmlinux-$(1)$(3).bin.lzma)
|
2012-08-17 17:56:05 +00:00
|
|
|
endef
|
|
|
|
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(1), lowercase board name
|
|
|
|
# $(2), DTS filename without .dts extension
|
|
|
|
# $(3), ih_name field of uImage header
|
|
|
|
# $(4), optional filename suffix, e.g. "-initramfs"
|
2013-04-03 09:59:51 +00:00
|
|
|
define MkImageLzmaDtb
|
2013-06-29 08:41:03 +00:00
|
|
|
$(call PatchKernelLzmaDtb,$(1),$(2),$(4))
|
|
|
|
$(call MkImage,lzma,$(KDIR)/vmlinux-$(1)$(4).bin.lzma,$(KDIR)/vmlinux-$(1)$(4).uImage,$(3))
|
2012-07-24 20:38:43 +00:00
|
|
|
endef
|
|
|
|
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(1), Rootfs type, e.g. squashfs
|
|
|
|
# $(2), lowercase board name
|
|
|
|
# $(3), DTS filename without .dts extension
|
|
|
|
# $(4), maximum size of sysupgrade image
|
|
|
|
# $(5), uImage header's ih_name field
|
2013-04-03 09:59:51 +00:00
|
|
|
define BuildFirmware/OF
|
|
|
|
$(call MkImageLzmaDtb,$(2),$(3),$(5))
|
|
|
|
$(call MkImageSysupgrade/$(1),$(1),$(2),$(4),$(6))
|
2012-07-24 20:38:43 +00:00
|
|
|
endef
|
|
|
|
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(1), squashfs/initramfs
|
|
|
|
# $(2), lowercase board name
|
|
|
|
# $(3), DTS filename without .dts extension
|
|
|
|
# $(4), ih_name field of uImage header
|
2013-04-03 09:59:51 +00:00
|
|
|
define BuildFirmware/OF/initramfs
|
2013-06-29 08:41:03 +00:00
|
|
|
$(call MkImageLzmaDtb,$(2),$(3),$(4),-initramfs)
|
|
|
|
$(CP) $(KDIR)/vmlinux-$(2)-initramfs.uImage $(call imgname,$(1),$(2))-uImage.bin
|
2012-08-12 12:48:24 +00:00
|
|
|
endef
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
# Build images for default ralink layout for 4MB flash
|
|
|
|
# kernel + roots = 0x3b0000
|
|
|
|
# $(1) = squashfs/initramfs
|
|
|
|
# $(2) = lowercase board name
|
|
|
|
# $(3) = dts file
|
|
|
|
ralink_default_fw_size_4M=3866624
|
2014-01-12 12:07:40 +00:00
|
|
|
BuildFirmware/Default4M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_4M),$(4))
|
|
|
|
BuildFirmware/Default4M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
|
2013-04-03 09:59:51 +00:00
|
|
|
|
|
|
|
# Build images for default ralink layout for 8MB flash
|
|
|
|
# kernel + roots = 0x7b0000
|
|
|
|
# $(1) = squashfs/initramfs
|
|
|
|
# $(2) = lowercase board name
|
|
|
|
# $(3) = dts file
|
2014-10-20 06:29:51 +00:00
|
|
|
# $(4) = uImage header name field
|
2013-04-03 09:59:51 +00:00
|
|
|
ralink_default_fw_size_8M=8060928
|
2013-06-10 08:24:56 +00:00
|
|
|
BuildFirmware/Default8M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_8M),$(4))
|
|
|
|
BuildFirmware/Default8M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
|
2013-04-03 09:59:51 +00:00
|
|
|
|
2013-07-25 16:01:58 +00:00
|
|
|
ralink_default_fw_size_16M=16121856
|
2013-07-22 15:36:39 +00:00
|
|
|
BuildFirmware/Default16M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_16M),$(4))
|
|
|
|
BuildFirmware/Default16M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
|
|
|
|
|
2015-10-19 10:07:38 +00:00
|
|
|
ralink_default_fw_size_32M=33226752
|
|
|
|
BuildFirmware/Default32M/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(ralink_default_fw_size_32M),$(4))
|
|
|
|
BuildFirmware/Default32M/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3),$(4))
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
# Build images for a custom sized flash layout
|
|
|
|
# $(1) = squashfs/initramfs
|
|
|
|
# $(2) = lowercase board name
|
|
|
|
# $(3) = dts file
|
|
|
|
# $(4) = kernel + rootfs size
|
|
|
|
BuildFirmware/CustomFlash/squashfs=$(call BuildFirmware/OF,$(1),$(2),$(3),$(4),$(5),$(6))
|
|
|
|
BuildFirmware/CustomFlash/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
|
|
|
|
|
2016-04-01 07:11:48 +00:00
|
|
|
# Some boards need a special header inside the uImage to make them bootable
|
|
|
|
define BuildFirmware/CustomFlashFactory/squashfs
|
|
|
|
$(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4))
|
|
|
|
$(call BuildFirmware/CustomFlash/$(1),$(1),$(2),$(3),$(4),$(5),$(6))
|
|
|
|
endef
|
|
|
|
BuildFirmware/CustomFlashFactory/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
# wrappers for boards that have 4MB and 8MB versions
|
|
|
|
define BuildFirmware/DefaultDualSize/squashfs
|
|
|
|
$(call BuildFirmware/Default4M/$(1),$(1),$(2)-4M,$(3)-4M)
|
|
|
|
$(call BuildFirmware/Default8M/$(1),$(1),$(2)-8M,$(3)-8M)
|
|
|
|
endef
|
|
|
|
define BuildFirmware/DefaultDualSize/initramfs
|
|
|
|
$(call BuildFirmware/OF/initramfs,$(1),$(2)-4M,$(3)-4M)
|
|
|
|
$(call BuildFirmware/OF/initramfs,$(1),$(2)-8M,$(3)-8M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# build Seama header images
|
|
|
|
define BuildFirmware/Seama/squashfs
|
2014-06-02 12:43:49 +00:00
|
|
|
$(call MkImageLzmaDtb,$(2),$(3),$(5))
|
|
|
|
$(eval output_name=$(IMG_PREFIX)-$(2)-$(1)-sysupgrade.bin)
|
2013-04-03 09:59:51 +00:00
|
|
|
cat $(KDIR)/vmlinux-$(2).bin.lzma $(KDIR)/root.$(1) > $(KDIR)/img_$(2).$(1).tmp
|
2013-08-23 17:07:26 +00:00
|
|
|
if [ `stat -c%s "$(KDIR)/img_$(2).$(1).tmp"` -gt $$$$(($(5) - 64)) ]; then \
|
2013-04-03 09:59:51 +00:00
|
|
|
echo "Warning: $(KDIR)/img_$(2).$(1).tmp is too big" >&2; \
|
2012-10-18 07:23:04 +00:00
|
|
|
else \
|
2013-04-03 09:59:51 +00:00
|
|
|
dd if=$(KDIR)/vmlinux-$(2).bin.lzma of=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=64k conv=sync; \
|
2012-10-18 07:23:04 +00:00
|
|
|
( \
|
2013-04-03 09:59:51 +00:00
|
|
|
dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64`; \
|
2012-10-18 07:23:04 +00:00
|
|
|
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
|
|
|
|
) > $(KDIR)/vmlinux-$(2).tmp; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/seama \
|
|
|
|
-i $(KDIR)/vmlinux-$(2).tmp \
|
|
|
|
-m "dev=/dev/mtdblock/2" -m "type=firmware"; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/seama \
|
|
|
|
-s $(call imgname,$(1),$(2))-factory.bin \
|
2013-04-03 09:59:51 +00:00
|
|
|
-m "signature=$(4)" \
|
2012-10-18 07:23:04 +00:00
|
|
|
-i $(KDIR)/vmlinux-$(2).tmp.seama; \
|
2014-06-02 12:43:49 +00:00
|
|
|
dd if=$(KDIR)/vmlinux-$(2).bin.lzma.padded bs=1 count=`expr \`stat -c%s $(KDIR)/vmlinux-$(2).bin.lzma.padded\` - 64` of=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp; \
|
|
|
|
$(STAGING_DIR_HOST)/bin/seama \
|
|
|
|
-i $(KDIR)/vmlinux-$(2)-sysupgrade.tmp \
|
|
|
|
-m "dev=/dev/mtdblock/2" -m "type=firmware"; \
|
|
|
|
( \
|
|
|
|
dd if=$(KDIR)/vmlinux-$(2)-sysupgrade.tmp.seama; \
|
|
|
|
dd if=$(KDIR)/root.$(1) bs=64k conv=sync; \
|
|
|
|
) > $(BIN_DIR)/$(output_name); \
|
2013-04-03 09:59:51 +00:00
|
|
|
fi
|
2012-10-18 07:23:04 +00:00
|
|
|
endef
|
2013-04-03 09:59:51 +00:00
|
|
|
BuildFirmware/Seama/initramfs=$(call BuildFirmware/OF/initramfs,$(1),$(2),$(3))
|
2012-10-18 07:23:04 +00:00
|
|
|
|
2013-08-01 14:30:46 +00:00
|
|
|
define BuildFirmware/PorayDualSize/squashfs
|
|
|
|
$(call BuildFirmware/DefaultDualSize/$(1),$(1),$(2),$(3))
|
|
|
|
if [ -e "$(call sysupname,$(1),$(2)-4M)" ]; then \
|
|
|
|
mkporayfw -B $(3) -F 4M \
|
|
|
|
-f $(call sysupname,$(1),$(2)-4M) \
|
2014-10-26 17:18:45 +00:00
|
|
|
-o $(call imgname,$(1),$(2)-4M)-factory.bin; \
|
2013-08-01 14:30:46 +00:00
|
|
|
fi
|
|
|
|
if [ -e "$(call sysupname,$(1),$(2)-8M)" ]; then \
|
|
|
|
mkporayfw -B $(3) -F 8M \
|
|
|
|
-f $(call sysupname,$(1),$(2)-8M) \
|
2014-10-26 17:18:45 +00:00
|
|
|
-o $(call imgname,$(1),$(2)-8M)-factory.bin; \
|
2013-08-01 14:30:46 +00:00
|
|
|
fi
|
|
|
|
endef
|
|
|
|
BuildFirmware/PorayDualSize/initramfs=$(call BuildFirmware/DefaultDualSize/initramfs,$(1),$(2),$(3))
|
|
|
|
|
2015-02-16 21:19:18 +00:00
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
ifeq ($(SUBTARGET),rt288x)
|
2016-04-01 07:11:48 +00:00
|
|
|
include rt288x.mk
|
2012-02-23 19:58:15 +00:00
|
|
|
endif
|
2011-07-28 10:56:32 +00:00
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
ifeq ($(SUBTARGET),rt305x)
|
2016-04-01 07:11:48 +00:00
|
|
|
include rt305x.mk
|
2010-04-11 17:47:28 +00:00
|
|
|
endif
|
|
|
|
|
2013-04-03 09:59:51 +00:00
|
|
|
ifeq ($(SUBTARGET),rt3883)
|
2016-04-01 07:11:48 +00:00
|
|
|
include rt3883.mk
|
2012-04-21 12:30:44 +00:00
|
|
|
endif
|
|
|
|
|
2014-11-19 09:19:38 +00:00
|
|
|
ifeq ($(SUBTARGET),mt7620)
|
2016-04-01 07:11:48 +00:00
|
|
|
include mt7620.mk
|
2013-11-16 20:28:52 +00:00
|
|
|
endif
|
|
|
|
|
2013-12-13 10:53:34 +00:00
|
|
|
ifeq ($(SUBTARGET),mt7621)
|
2016-04-01 07:11:48 +00:00
|
|
|
include mt7621.mk
|
2013-12-13 10:53:34 +00:00
|
|
|
endif
|
|
|
|
|
2016-04-09 10:24:55 +00:00
|
|
|
<<<<<<< HEAD
|
|
|
|
=======
|
|
|
|
define Device/mt7621
|
|
|
|
DTS := MT7621
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_4M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/wsr-600
|
|
|
|
DTS := WSR-600
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/re6500
|
|
|
|
DTS := RE6500
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/wsr-1166
|
|
|
|
DTS := WSR-1166
|
|
|
|
IMAGE/sysupgrade.bin := trx | pad-rootfs
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/dir-860l-b1
|
|
|
|
DTS := DIR-860L-B1
|
|
|
|
IMAGES += factory.bin
|
|
|
|
KERNEL := kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
IMAGE/sysupgrade.bin := \
|
|
|
|
append-kernel | pad-offset 65536 64 | append-rootfs | \
|
|
|
|
seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
|
|
|
|
pad-rootfs | check-size $$$$(IMAGE_SIZE)
|
|
|
|
IMAGE/factory.bin := \
|
|
|
|
append-kernel | pad-offset 65536 64 | append-rootfs | pad-rootfs -x 64 | \
|
|
|
|
seama -m "dev=/dev/mtdblock/2" -m "type=firmware" | \
|
|
|
|
seama-seal -m "signature=wrgac13_dlink.2013gui_dir860lb" | \
|
|
|
|
check-size $$$$(IMAGE_SIZE)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/firewrt
|
|
|
|
DTS := FIREWRT
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/pbr-m1
|
|
|
|
DTS := PBR-M1
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/sap-g3200u3
|
|
|
|
DTS := SAP-G3200U3
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/witi
|
|
|
|
DTS := WITI
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/zbt-wg2626
|
|
|
|
DTS := ZBT-WG2626
|
|
|
|
IMAGE_SIZE := $(ralink_default_fw_size_16M)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/wf-2881
|
|
|
|
DTS := WF-2881
|
|
|
|
BLOCKSIZE := 128KiB
|
|
|
|
PAGESIZE := 2048
|
|
|
|
FILESYSTEMS := squashfs
|
|
|
|
IMAGE_SIZE := 132382720
|
|
|
|
KERNEL := $(KERNEL_DTB) | pad-offset 131072 64 | uImage lzma
|
|
|
|
IMAGE/sysupgrade.bin := append-kernel | append-ubi | check-size $$$$(IMAGE_SIZE)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Device/ubnt-erx
|
|
|
|
DTS := UBNT-ERX
|
|
|
|
FILESYSTEMS := squashfs
|
|
|
|
KERNEL_SIZE := 3145728
|
|
|
|
KERNEL := $(KERNEL_DTB) | uImage lzma
|
|
|
|
IMAGES := sysupgrade.tar $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),factory-initramfs.tar)
|
|
|
|
IMAGE/factory-initramfs.tar := ubnt-erx-factory-compat | \
|
|
|
|
ubnt-erx-factory-kernel | \
|
|
|
|
ubnt-erx-factory-rootfs | \
|
|
|
|
ubnt-erx-factory-version | \
|
|
|
|
ubnt-erx-factory-check-size $$(KERNEL_SIZE)
|
|
|
|
IMAGE/sysupgrade.tar := sysupgrade-nand
|
|
|
|
endef
|
|
|
|
|
|
|
|
#
|
|
|
|
# MT7628 Profiles
|
|
|
|
#
|
|
|
|
|
|
|
|
Image/Build/Profile/MIWIFI-NANO=$(call BuildFirmware/Default16M/$(1),$(1),miwifi-nano,MIWIFI-NANO)
|
|
|
|
Image/Build/Profile/MT7628=$(call BuildFirmware/Default4M/$(1),$(1),mt7628,MT7628)
|
|
|
|
Image/Build/Profile/WRTNODE2P=$(call BuildFirmware/Default16M/$(1),$(1),wrtnode2p,WRTNODE2P)
|
|
|
|
|
|
|
|
>>>>>>> Adjust image size limit for the D-Link DIR-860L B1
|
2014-11-06 09:31:31 +00:00
|
|
|
ifeq ($(SUBTARGET),mt7628)
|
2016-04-01 07:11:48 +00:00
|
|
|
include mt7628.mk
|
2014-11-06 09:31:31 +00:00
|
|
|
endif
|
|
|
|
|
2015-07-24 09:11:56 +00:00
|
|
|
ifeq ($(SUBTARGET),mt7688)
|
2016-04-01 07:11:48 +00:00
|
|
|
include mt7688.mk
|
2015-07-24 09:11:56 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2015-01-10 15:26:53 +00:00
|
|
|
ifndef TARGET_DEVICES
|
2013-04-03 09:59:51 +00:00
|
|
|
#
|
2015-01-10 15:26:53 +00:00
|
|
|
# Generic Targets - only needed for legacy image building code
|
2013-04-03 09:59:51 +00:00
|
|
|
#
|
|
|
|
define Image/BuildKernel
|
|
|
|
cp $(KDIR)/vmlinux.elf $(BIN_DIR)/$(VMLINUX).elf
|
|
|
|
cp $(KDIR)/vmlinux $(BIN_DIR)/$(VMLINUX).bin
|
|
|
|
$(call CompressLzma,$(KDIR)/vmlinux,$(KDIR)/vmlinux.bin.lzma)
|
|
|
|
$(call MkImage,lzma,$(KDIR)/vmlinux.bin.lzma,$(KDIR)/uImage.lzma)
|
|
|
|
cp $(KDIR)/uImage.lzma $(BIN_DIR)/$(UIMAGE).bin
|
2014-11-08 15:40:17 +00:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Image/BuildKernel/Initramfs
|
2013-06-27 19:58:31 +00:00
|
|
|
cp $(KDIR)/vmlinux-initramfs.elf $(BIN_DIR)/$(VMLINUX)-initramfs.elf
|
|
|
|
cp $(KDIR)/vmlinux-initramfs $(BIN_DIR)/$(VMLINUX)-initramfs.bin
|
|
|
|
$(call CompressLzma,$(KDIR)/vmlinux-initramfs,$(KDIR)/vmlinux-initramfs.bin.lzma)
|
|
|
|
$(call MkImage,lzma,$(KDIR)/vmlinux-initramfs.bin.lzma,$(KDIR)/uImage-initramfs.lzma)
|
|
|
|
cp $(KDIR)/uImage-initramfs.lzma $(BIN_DIR)/$(UIMAGE)-initramfs.bin
|
2013-04-03 09:59:51 +00:00
|
|
|
$(call Image/Build/Initramfs)
|
|
|
|
endef
|
|
|
|
|
2009-08-30 19:15:51 +00:00
|
|
|
define Image/Build
|
|
|
|
$(call Image/Build/$(1))
|
2010-04-12 23:15:56 +00:00
|
|
|
dd if=$(KDIR)/root.$(1) of=$(BIN_DIR)/$(IMG_PREFIX)-root.$(1) bs=128k conv=sync
|
2010-04-11 17:47:28 +00:00
|
|
|
$(call Image/Build/Profile/$(PROFILE),$(1))
|
2009-08-30 19:15:51 +00:00
|
|
|
endef
|
2015-01-10 15:26:53 +00:00
|
|
|
endif
|
2009-08-30 19:15:51 +00:00
|
|
|
|
|
|
|
$(eval $(call BuildImage))
|