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
12 echo
-ne
'\xde\xad\xc0\xde' > $(KDIR
)/fs_mark
13 $(call prepare_generic_squashfs
,$(KDIR
)/fs_mark
)
15 # For UBI we want only one extra block
16 rm -f
$(KDIR
)/ubi_mark
17 echo
-ne
'\xde\xad\xc0\xde' > $(KDIR
)/ubi_mark
19 $(CP
) .
/ubinize.cfg
$(KDIR
)
23 $(STAGING_DIR_HOST
)/bin
/lzma e
$@
-d16
$(1) $@.new
27 define Build
/mkfs
/squashfs
28 ( cd
$(KDIR
); $(STAGING_DIR_HOST
)/bin
/ubinize
-p
128KiB
-m
2048 -o
$(KDIR
)/root-block-0x20000-min-0x800.ubi ubinize.cfg
)
31 define Build
/trx-serial
32 $(STAGING_DIR_HOST
)/bin
/trx \
35 -f
$(word 1,$^
) -a
1024 \
36 -f
$(KDIR
)/root.squashfs
-a
0x10000 -A
$(KDIR
)/fs_mark
40 # kernel: always use 4 MiB (-28 B or TRX header) to allow upgrades even
41 # if it grows up between releases
42 # root: UBI with one extra block containing UBI mark to trigger erasing
44 $(STAGING_DIR_HOST
)/bin
/trx \
47 -f
$(word 1,$^
) -a
0x20000 -b
0x400000 \
48 -f
$(KDIR
)/root-block-0x20000-min-0x800.ubi \
49 -A
$(KDIR
)/ubi_mark
-a
0x20000
53 $(STAGING_DIR_HOST
)/bin
/asustrx \
54 -p
$(PRODUCTID
) -i
$@
-o
$@.new
58 define Build
/seama-nand
60 $(STAGING_DIR_HOST
)/bin
/oseama \
62 -m
"dev=/dev/mtdblock/7" \
66 -f
$(KDIR
)/root-block-0x20000-min-0x800.ubi \
69 $(STAGING_DIR_HOST
)/bin
/seama \
71 -m
"signature=$(SIGNATURE)" \
75 DEVICE_VARS
+= DEVICE_DTS PRODUCTID SIGNATURE NETGEAR_BOARD_ID NETGEAR_REGION
78 # .dtb files are prefixed by SoC type, e.g. bcm4708- which is not included in device/image names
79 # extract the full dtb name based on the device info
80 DEVICE_DTS
:= $(patsubst %.dtb
,%,$(notdir $(wildcard $(if
$(IB
),$(KDIR
),$(DTS_DIR
))/*-$(1).dtb
)))
81 KERNEL
:= kernel-bin | append-dtb | lzma-d16
82 KERNEL_DEPENDS
= $$(wildcard $(DTS_DIR
)/$$(DEVICE_DTS
).dts
)
83 FILESYSTEMS
:= squashfs
85 IMAGE_NAME
= $$(IMAGE_PREFIX
)-$$(1).
$$(2)
92 IMAGE
/trx
:= trx-nand | asus-trx
96 define Device
/asus-
$(1)
100 TARGET_DEVICES
+= asus-
$(1)
103 define Device
/linksys
105 IMAGE
/trx
:= trx-nand
109 define Device
/linksys-
$(1)
112 TARGET_DEVICES
+= linksys-
$(1)
117 IMAGE
/bin
:= seama-nand
121 define Device
/dlink-
$(1)
125 TARGET_DEVICES
+= dlink-
$(1)
128 define Device
/netgear
130 IMAGE
/chk
:= trx-nand | netgear-chk
135 define Device
/netgear-
$(1)
137 NETGEAR_BOARD_ID
:= $(2)
139 TARGET_DEVICES
+= netgear-
$(1)
142 define Device
/netgear-r6250
144 NETGEAR_BOARD_ID
:= U12H245T00_NETGEAR
147 define Device
/netgear-r6300-v2
149 NETGEAR_BOARD_ID
:= U12H240T00_NETGEAR
152 define Device
/netgear-r8000
154 NETGEAR_BOARD_ID
:= U12H315T00_NETGEAR
157 define Device
/smartrg-sr400ac
159 IMAGE
/trx
:= trx-serial
163 buffalo-wzr-1750dhp buffalo-wzr-600dhp2 buffalo-wzr-900dhp \
164 buffalo-wxr-1900dhp \
165 netgear-r6250 netgear-r6300-v2 netgear-r8000 \
168 $(eval
$(call AsusDevice
,rt-ac56u
,RT-AC56U
))
169 $(eval
$(call AsusDevice
,rt-ac68u
,RT-AC68U
))
170 $(eval
$(call AsusDevice
,rt-ac87u
,RT-AC87U
))
171 $(eval
$(call AsusDevice
,rt-n18u
,RT-N18U
))
172 $(eval
$(call DLinkDevice
,dir-885l
,wrgac42_dlink
.2015_dir885l
))
173 $(eval
$(call LinksysDevice
,ea6300-v1
))
174 $(eval
$(call NetgearDevice
,r7000
,U12H270T00_NETGEAR
))
175 $(eval
$(call NetgearDevice
,r7900
,U12H315T30_NETGEAR
))
176 # $(eval $(call NetgearDevice,r8500,U12H334T00_NETGEAR))
178 $(eval
$(call BuildImage
))