6 $(STAGING_DIR_HOST
)/bin
/seama
-i
$@
$(1)
10 define Build
/seama-seal
11 $(call Build
/seama
,-s
$@.seama
$(1))
14 define Build
/ubnt-erx-factory-compat
15 echo
'21001:6' > $@.compat
16 $(TAR
) -cf
$@
--transform
='s/^.*/compat/' $@.compat
20 define Build
/ubnt-erx-factory-kernel
21 if
[ -e
$(KDIR
)/tmp
/$(KERNEL_INITRAMFS_IMAGE
) ]; then \
22 $(TAR
) -rf
$@
--transform
='s/^.*/vmlinux.tmp/' $(KDIR
)/tmp
/$(KERNEL_INITRAMFS_IMAGE
); \
24 md5sum
--binary
$(KDIR
)/tmp
/$(KERNEL_INITRAMFS_IMAGE
) | awk
'{print $$1}'> $@.md5
; \
25 $(TAR
) -rf
$@
--transform
='s/^.*/vmlinux.tmp.md5/' $@.md5
; \
30 define Build
/ubnt-erx-factory-rootfs
31 echo
"dummy" > $@.rootfs
32 $(TAR
) -rf
$@
--transform
='s/^.*/squashfs.tmp/' $@.rootfs
34 md5sum
--binary
$@.rootfs | awk
'{print $$1}'> $@.md5
35 $(TAR
) -rf
$@
--transform
='s/^.*/squashfs.tmp.md5/' $@.md5
40 define Build
/ubnt-erx-factory-version
41 echo
'$(BOARD) $(VERSION_CODE) $(VERSION_NUMBER)' > $@.version
42 $(TAR
) -rf
$@
--transform
='s/^.*/version.tmp/' $@.version
46 # We need kernel+initrams fit into kernel partition
47 define Build
/ubnt-erx-factory-check-size
48 @
[ $$(($(subst k
,* 1024,$(subst m
, * 1024k
,$(1))))) -ge
"$$($(TAR) -xf $@ vmlinux.tmp -O | wc -c)" ] ||
{ \
49 echo
"WARNING: Initramfs kernel for image $@ is too big (kernel size: $$($(TAR) -xf $@ vmlinux.tmp -O | wc -c), max size $(1))" >&2; \
53 @
[ "$$($(TAR) -xf $@ vmlinux.tmp -O | wc -c)" -gt
0 ] ||
{ \
54 echo
"WARNING: Kernel for image $@ not found" >&2; \
59 ifeq ($(SUBTARGET
),mt7621
)
60 TARGET_DEVICES
+= mt7621 wsr-600 wsr-1166 dir-860l-b1 firewrt pbr-m1 re6500 sap-g3200u3 ubnt-erx witi wf-2881 zbt-wg2626
65 IMAGE_SIZE
:= $(ralink_default_fw_size_4M
)
70 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
77 define Device
/wsr-1166
79 IMAGE
/sysupgrade.bin
:= trx | pad-rootfs
80 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
83 define Device
/dir-860l-b1
86 KERNEL
:= kernel-bin | patch-dtb | relocate-kernel | lzma | uImage lzma
87 IMAGE
/sysupgrade.bin
:= \
88 append-kernel | pad-offset
65536 64 | append-rootfs | \
89 seama
-m
"dev=/dev/mtdblock/2" -m
"type=firmware" | \
90 pad-rootfs | check-size
$$$$(IMAGE_SIZE
)
91 IMAGE
/factory.bin
:= \
92 append-kernel | pad-offset
65536 64 | append-rootfs | pad-rootfs
-x
64 | \
93 seama
-m
"dev=/dev/mtdblock/2" -m
"type=firmware" | \
94 seama-seal
-m
"signature=wrgac13_dlink.2013gui_dir860lb" | \
95 check-size
$$$$(IMAGE_SIZE
)
100 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
105 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
108 define Device
/sap-g3200u3
114 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
117 define Device
/zbt-wg2626
119 IMAGE_SIZE
:= $(ralink_default_fw_size_16M
)
122 define Device
/wf-2881
126 FILESYSTEMS
:= squashfs
127 IMAGE_SIZE
:= 132382720
128 KERNEL
:= $(KERNEL_DTB
) | pad-offset
131072 64 | uImage lzma
129 IMAGE
/sysupgrade.bin
:= append-kernel | append-ubi | check-size
$$$$(IMAGE_SIZE
)
132 define Device
/ubnt-erx
134 FILESYSTEMS
:= squashfs
135 KERNEL_SIZE
:= 3145728
136 KERNEL
:= $(KERNEL_DTB
) | uImage lzma
137 IMAGES
:= sysupgrade.
tar $(if
$(CONFIG_TARGET_ROOTFS_INITRAMFS
),factory-initramfs.
tar)
138 IMAGE
/factory-initramfs.
tar := ubnt-erx-factory-compat | \
139 ubnt-erx-factory-kernel | \
140 ubnt-erx-factory-rootfs | \
141 ubnt-erx-factory-version | \
142 ubnt-erx-factory-check-size
$$(KERNEL_SIZE
)
143 IMAGE
/sysupgrade.
tar := sysupgrade-nand
146 # FIXME: is this still needed?
148 #define Build/Compile
149 rm -rf
$(KDIR
)/relocate
150 $(CP
) ..
/..
/generic
/image
/relocate
$(KDIR
)
151 $(MAKE
) -C
$(KDIR
)/relocate KERNEL_ADDR
=$(KERNEL_LOADADDR
) CROSS_COMPILE
=$(TARGET_CROSS
)
152 $(CP
) $(KDIR
)/relocate
/loader.bin
$(KDIR
)/loader.bin