2 # Copyright (C) 2013 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
7 include $(TOPDIR)/rules.mk
8 include $(INCLUDE_DIR)/image.mk
11 $(CP) $(DTS_DIR)/*.dtb $(KDIR)/
14 echo -ne '\xde\xad\xc0\xde' > $(KDIR)/fs_mark
15 $(call prepare_generic_squashfs,$(KDIR)/fs_mark)
17 $(CP) ./ubinize.cfg $(KDIR)
20 define Build/append-dtb
21 cat $(KDIR)/$(DT).dtb >> $@
25 $(STAGING_DIR_HOST)/bin/lzma e $@ -d16 $(1) $@.new
29 define Build/mkfs/squashfs
30 ( cd $(KDIR); $(STAGING_DIR_HOST)/bin/ubinize -p 128KiB -m 2048 -o $(KDIR)/root-block-0x20000-min-0x800.ubi ubinize.cfg )
34 $(STAGING_DIR_HOST)/bin/trx \
37 -a 0x20000 -f $(KDIR)/root-block-0x20000-min-0x800.ubi \
38 -a 0x20000 -A $(KDIR)/fs_mark
41 define Build/netgear-chk
42 $(STAGING_DIR_HOST)/bin/mkchkimg \
43 -o $@.new -k $@ -b $(BOARD_ID) -r $(REGION)
47 DEVICE_VARS += DT BOARD_ID REGION
50 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
51 # extract the full dtb name based on the device info
52 DT := $(patsubst %.dtb,%,$(notdir $(wildcard $(if $(IB),$(KDIR),$(DTS_DIR))/*-$(1).dtb)))
53 KERNEL := kernel-bin | append-dtb | lzma-d16
54 FILESYSTEMS := squashfs
55 IMAGE_NAME = $$(IMAGE_PREFIX)-$$(1).$$(2)
62 IMAGE/chk := trx-nand | netgear-chk
66 define Device/netgear-r6250
68 BOARD_ID := U12H245T00_NETGEAR
71 define Device/netgear-r6300-v2
73 BOARD_ID := U12H240T00_NETGEAR
76 define Device/netgear-r8000
78 BOARD_ID := U12H315T00_NETGEAR
82 asus-rt-ac68u asus-rt-n18u asus-rt-ac87u \
83 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
84 buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp
86 $(eval $(call BuildImage))