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 # For UBI we want only one extra block
18 rm -f
$(KDIR
)/ubi_mark
19 echo
-ne
'\xde\xad\xc0\xde' > $(KDIR
)/ubi_mark
21 $(CP
) .
/ubinize.cfg
$(KDIR
)
24 define Build
/append-dtb
25 cat
$(KDIR
)/$(DT
).dtb
>> $@
29 $(STAGING_DIR_HOST
)/bin
/lzma e
$@
-d16
$(1) $@.new
33 define Build
/mkfs
/squashfs
34 ( cd
$(KDIR
); $(STAGING_DIR_HOST
)/bin
/ubinize
-p
128KiB
-m
2048 -o
$(KDIR
)/root-block-0x20000-min-0x800.ubi ubinize.cfg
)
37 define Build
/trx-serial
38 $(STAGING_DIR_HOST
)/bin
/trx \
40 -f
$(word 1,$^
) -a
1024 \
41 -f
$(KDIR
)/root.squashfs
-a
0x10000 -A
$(KDIR
)/fs_mark
45 # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
46 # if it grows up between releases
47 # root: UBI with one extra block containing UBI mark to trigger erasing
49 $(STAGING_DIR_HOST
)/bin
/trx \
52 -f
$(word 1,$^
) -a
0x20000 -b
0x400000 \
53 -f
$(KDIR
)/root-block-0x20000-min-0x800.ubi \
54 -A
$(KDIR
)/ubi_mark
-a
0x20000
58 $(STAGING_DIR_HOST
)/bin
/asustrx \
59 -p
$(PRODUCTID
) -i
$@
-o
$@.new
63 define Build
/netgear-chk
64 $(STAGING_DIR_HOST
)/bin
/mkchkimg \
65 -o
$@.new
-k
$@
-b
$(NETGEAR_BOARD_ID
) -r
$(NETGEAR_REGION
)
69 DEVICE_VARS
+= DT PRODUCTID NETGEAR_BOARD_ID NETGEAR_REGION
72 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
73 # extract the full dtb name based on the device info
74 DT
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
75 KERNEL
:= kernel-bin | append-dtb | lzma-d16
76 FILESYSTEMS
:= squashfs
78 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
85 IMAGE
/trx
:= trx-nand | asus-trx
89 define Device
/asus-
$(1)
93 TARGET_DEVICES
+= asus-
$(1)
98 IMAGE
/chk
:= trx-nand | netgear-chk
103 define Device
/netgear-
$(1)
105 NETGEAR_BOARD_ID
:= $(2)
107 TARGET_DEVICES
+= netgear-
$(1)
110 define Device
/netgear-r6250
112 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
115 define Device
/netgear-r6300-v2
117 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
120 define Device
/netgear-r8000
122 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
125 define Device
/smartrg-sr400ac
127 IMAGE
/trx
:= trx-serial
131 buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp \
132 buffalo-wxr-1900dhp \
133 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
136 $(eval
$(call AsusDevice
,rt-ac56u
,RT-AC56U
))
137 $(eval
$(call AsusDevice
,rt-ac68u
,RT-AC68U
))
138 $(eval
$(call AsusDevice
,rt-ac87u
,RT-AC87U
))
139 $(eval
$(call AsusDevice
,rt-n18u
,RT-N18U
))
140 $(eval
$(call NetgearDevice
,r7000
,U12H270T00_NETGEAR
))
142 $(eval
$(call BuildImage
))