1 # Build commands that can be called from Device/* templates
3 IMAGE_KERNEL
= $(word 1,$^
)
4 IMAGE_ROOTFS
= $(word 2,$^
)
6 define ModelNameLimit16
7 $(shell expr substr
"$(word 2, $(subst _, ,$(1)))" 1 16)
11 $(patsubst %-256k
,0x40000,$(patsubst %-128k
,0x20000,$(patsubst %-64k
,0x10000,$(patsubst squashfs
%,0x4,$(patsubst root.
%,%,$(1))))))
15 define Build
/append-dtb
16 cat
$(KDIR
)/image-
$(firstword $(DEVICE_DTS
)).dtb
>> $@
19 define Build
/append-dtb-elf
20 $(TARGET_CROSS
)objcopy \
21 --set-section-flags
=.appended_dtb
=alloc
,contents \
23 .appended_dtb
=$(KDIR
)/image-
$(firstword $(DEVICE_DTS
)).dtb
$@
26 define Build
/append-kernel
27 dd if
=$(IMAGE_KERNEL
) >> $@
30 define Build
/package-kernel-ubifs
32 cp
$@
$@.kernelubifs
/kernel
33 $(STAGING_DIR_HOST
)/bin
/mkfs.ubifs \
34 $(KERNEL_UBIFS_OPTS
) \
39 define Build
/append-image
40 cp
"$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
41 fwtool
-s
/dev
/null
-t
"$@.stripmeta" ||
:
42 fwtool
-i
/dev
/null
-t
"$@.stripmeta" ||
:
43 dd if
="$@.stripmeta" >> "$@"
48 define Build
/append-image-stage
49 dd if
=$(STAGING_DIR_IMAGE
)/$(BOARD
)$(if
$(SUBTARGET
),-$(SUBTARGET
))-$(DEVICE_NAME
)-$(1) >> $@
52 define Build
/append-image-stage
53 cp
"$(BIN_DIR)/$(DEVICE_IMG_PREFIX)-$(1)" "$@.stripmeta"
54 fwtool
-s
/dev
/null
-t
"$@.stripmeta" ||
:
55 fwtool
-i
/dev
/null
-t
"$@.stripmeta" ||
:
56 dd if
="$@.stripmeta" of
="$(STAGING_DIR_IMAGE)/$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))-$(DEVICE_NAME)-$(1)"
57 dd if
="$@.stripmeta" >> "$@"
63 compat_version
=$(if
$(DEVICE_COMPAT_VERSION
),$(DEVICE_COMPAT_VERSION
),1.0)
64 json_quote
=$(subst ','\'',$(subst ",\",$(1)))
67 legacy_supported_message
=$(SUPPORTED_DEVICES
) - Image version mismatch
: image
$(compat_version
), \
68 device
1.0. Please wipe config during upgrade
(force required
) or reinstall. \
69 $(if
$(DEVICE_COMPAT_MESSAGE
),Reason
: $(DEVICE_COMPAT_MESSAGE
),Please
check documentation ...
)
71 metadata_devices
=$(if
$(1),$(subst "$(space)","$(comma)",$(strip $(foreach v
,$(1),"$(call json_quote,$(v))"))))
73 '{ $(if $(IMAGE_METADATA),$(IMAGE_METADATA)$(comma)) \
74 "metadata_version": "1.1", \
75 "compat_version": "$(call json_quote,$(compat_version))", \
76 $(if $(DEVICE_COMPAT_MESSAGE),"compat_message": "$(call json_quote,$(DEVICE_COMPAT_MESSAGE))"$(comma)) \
77 $(if $(filter-out 1.0,$(compat_version)),"new_supported_devices": \
78 [$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma) \
79 "supported_devices": ["$(call json_quote,$(legacy_supported_message))"]$(comma)) \
80 $(if $(filter 1.0,$(compat_version)),"supported_devices":[$(call metadata_devices,$(SUPPORTED_DEVICES))]$(comma)) \
82 "dist": "$(call json_quote,$(VERSION_DIST))", \
83 "version": "$(call json_quote,$(VERSION_NUMBER))", \
84 "revision": "$(call json_quote,$(REVISION))", \
85 "target": "$(call json_quote,$(TARGETID))", \
86 "board": "$(call json_quote,$(if $(BOARD_NAME),$(BOARD_NAME),$(DEVICE_NAME)))" \
90 define Build
/append-metadata
91 $(if
$(SUPPORTED_DEVICES
),-echo
$(call metadata_json
) | fwtool
-I
- $@
)
92 sha256sum
"$@" | cut
-d
" " -f1
> "$@.sha256sum"
93 [ ! -s
"$(BUILD_KEY)" -o
! -s
"$(BUILD_KEY).ucert" -o
! -s
"$@" ] ||
{ \
94 cp
"$(BUILD_KEY).ucert" "$@.ucert" ;\
95 usign
-S
-m
"$@" -s
"$(BUILD_KEY)" -x
"$@.sig" ;\
96 ucert
-A
-c
"$@.ucert" -x
"$@.sig" ;\
97 fwtool
-S
"$@.ucert" "$@" ;\
101 define Build
/append-rootfs
102 dd if
=$(IMAGE_ROOTFS
) >> $@
105 define Build
/append-squashfs-fakeroot-be
106 rm -rf
$@.fakefs
$@.fakesquashfs
108 $(STAGING_DIR_HOST
)/bin
/mksquashfs-lzma \
109 $@.fakefs
$@.fakesquashfs \
110 -noappend
-root-owned
-be
-nopad
-b
65536 \
111 $(if
$(SOURCE_DATE_EPOCH
),-fixed-time
$(SOURCE_DATE_EPOCH
))
112 cat
$@.fakesquashfs
>> $@
115 define Build
/append-squashfs4-fakeroot
116 rm -rf
$@.fakefs
$@.fakesquashfs
118 $(STAGING_DIR_HOST
)/bin
/mksquashfs4 \
119 $@.fakefs
$@.fakesquashfs \
120 -nopad
-noappend
-root-owned
121 cat
$@.fakesquashfs
>> $@
124 define Build
/append-string
128 define Build
/append-ubi
129 sh
$(TOPDIR
)/scripts
/ubinize-image.sh \
130 $(if
$(UBOOTENV_IN_UBI
),--uboot-env
) \
131 $(if
$(KERNEL_IN_UBI
),--kernel
$(IMAGE_KERNEL
)) \
132 $(foreach part
,$(UBINIZE_PARTS
),--part
$(part
)) \
133 --rootfs
$(IMAGE_ROOTFS
) \
135 -p
$(BLOCKSIZE
:%k
=%KiB
) -m
$(PAGESIZE
) \
136 $(if
$(SUBPAGESIZE
),-s
$(SUBPAGESIZE
)) \
137 $(if
$(VID_HDR_OFFSET
),-O
$(VID_HDR_OFFSET
)) \
143 define Build
/ubinize-kernel
145 sh
$(TOPDIR
)/scripts
/ubinize-image.sh \
148 -p
$(BLOCKSIZE
:%k
=%KiB
) -m
$(PAGESIZE
) \
149 $(if
$(SUBPAGESIZE
),-s
$(SUBPAGESIZE
)) \
150 $(if
$(VID_HDR_OFFSET
),-O
$(VID_HDR_OFFSET
)) \
155 define Build
/append-uboot
156 dd if
=$(UBOOT_PATH
) >> $@
159 # append a fake/empty uImage header, to fool bootloaders rootfs integrity check
161 define Build
/append-uImage-fakehdr
162 $(eval type
=$(word 1,$(1)))
163 $(eval magic
=$(word 2,$(1)))
165 $(STAGING_DIR_HOST
)/bin
/mkimage \
166 -A
$(LINUX_KARCH
) -O linux
-T
$(type
) -C none \
167 -n
'$(VERSION_DIST) fake $(type)' \
168 $(if
$(magic
),-M
$(magic
)) \
175 define Build
/buffalo-dhp-image
176 $(STAGING_DIR_HOST
)/bin
/mkdhpimg
$@
$@.new
180 define Build
/buffalo-enc
181 $(eval product
=$(word 1,$(1)))
182 $(eval version
=$(word 2,$(1)))
183 $(eval args
=$(wordlist
3,$(words $(1)),$(1)))
184 $(STAGING_DIR_HOST
)/bin
/buffalo-enc \
185 -p
$(product
) -v
$(version
) $(args
) \
190 define Build
/buffalo-enc-tag
191 $(call Build
/buffalo-enc
,'' '' -S
152 $(1))
194 define Build
/buffalo-tag-dhp
195 $(eval product
=$(word 1,$(1)))
196 $(eval region
=$(word 2,$(1)))
197 $(eval language
=$(word 3,$(1)))
198 $(STAGING_DIR_HOST
)/bin
/buffalo-tag \
200 -a
$(BUFFALO_TAG_PLATFORM
) \
201 -v
$(BUFFALO_TAG_VERSION
) -m
$(BUFFALO_TAG_MINOR
) \
202 -b
$(product
) -p
$(product
) \
203 -r
$(region
) -r
$(region
) -l
$(language
) \
208 define Build
/check-size
209 @imagesize
="$$(stat -c%s $@)"; \
210 limitsize
="$$(($(subst k,* 1024,$(subst m, * 1024k,$(if $(1),$(1),$(IMAGE_SIZE))))))"; \
211 [ $$limitsize -ge
$$imagesize ] ||
{ \
212 $(call ERROR_MESSAGE
, WARNING
: Image file
$@ is too big
: $$imagesize > $$limitsize); \
217 define Build
/copy-file
221 define Build
/elecom-product-header
222 $(eval product
=$(word 1,$(1)))
223 $(eval fw
=$(if
$(word 2,$(1)),$(word 2,$(1)),$@
))
226 echo
-n
-e
"ELECOM\x00\x00$(product)" | dd bs
=40 count
=1 conv
=sync
; \
227 echo
-n
"0.00" | dd bs
=16 count
=1 conv
=sync
; \
233 define Build
/elecom-wrc-gs-factory
234 $(eval product
=$(word 1,$(1)))
235 $(eval version
=$(word 2,$(1)))
236 $(eval hash_opt
=$(word 3,$(1)))
237 $(MKHASH
) md5
$(hash_opt
) $@
>> $@
239 echo
-n
"ELECOM $(product) v$(version)" | \
240 dd bs
=32 count
=1 conv
=sync
; \
246 define Build
/elx-header
247 $(eval hw_id
=$(word 1,$(1)))
248 $(eval xor_pattern
=$(word 2,$(1)))
250 echo
-ne
"\x00\x00\x00\x00\x00\x00\x00\x03" | \
251 dd bs
=42 count
=1 conv
=sync
; \
253 echo
-ne
"\x$${hw_id:0:2}\x$${hw_id:2:2}\x$${hw_id:4:2}\x$${hw_id:6:2}" | \
254 dd bs
=20 count
=1 conv
=sync
; \
255 echo
-ne
"$$(printf '%08x' $$(stat -c%s $@) | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
256 dd bs
=8 count
=1 conv
=sync
; \
257 echo
-ne
"$$($(MKHASH) md5 $@ | fold -s2 | xargs -I {} echo \\x{} | tr -d '\n')" | \
258 dd bs
=58 count
=1 conv
=sync
; \
259 ) > $(KDIR
)/tmp
/$(DEVICE_NAME
).header
260 $(call Build
/xor-image
,-p
$(xor_pattern
) -x
)
261 cat
$(KDIR
)/tmp
/$(DEVICE_NAME
).header
$@
> $@.new
263 rm -rf
$(KDIR
)/tmp
/$(DEVICE_NAME
).header
266 define Build
/eva-image
267 $(STAGING_DIR_HOST
)/bin
/lzma2eva
$(KERNEL_LOADADDR
) $(KERNEL_LOADADDR
) $@
$@.new
271 define Build
/initrd_compression
272 $(if
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_BZIP2
),.bzip2
) \
273 $(if
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_GZIP
),.gzip
) \
274 $(if
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_LZMA
),.lzma
) \
275 $(if
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_XZ
),.xz
) \
276 $(if
$(CONFIG_TARGET_INITRAMFS_COMPRESSION_ZSTD
),.zstd
)
280 $(TOPDIR
)/scripts
/mkits.sh \
281 -D
$(DEVICE_NAME
) -o
$@.its
-k
$@ \
283 $(if
$(word 2,$(1)),\
284 $(if
$(findstring 11,$(if
$(DEVICE_DTS_OVERLAY
),1)$(if
$(findstring $(KERNEL_BUILD_DIR
)/image-
,$(word 2,$(1))),,1)), \
285 -d
$(KERNEL_BUILD_DIR
)/image-
$$(basename $(word 2,$(1))), \
286 -d
$(word 2,$(1)))) \
287 $(if
$(findstring with-rootfs
,$(word 3,$(1))),-r
$(IMAGE_ROOTFS
)) \
288 $(if
$(findstring with-initrd
,$(word 3,$(1))), \
289 $(if
$(CONFIG_TARGET_ROOTFS_INITRAMFS_SEPARATE
), \
290 -i
$(KERNEL_BUILD_DIR
)/initrd.cpio
$(strip $(call Build
/initrd_compression
)))) \
291 -a
$(KERNEL_LOADADDR
) -e
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
292 $(if
$(DEVICE_FDT_NUM
),-n
$(DEVICE_FDT_NUM
)) \
293 $(if
$(DEVICE_DTS_DELIMITER
),-l
$(DEVICE_DTS_DELIMITER
)) \
294 $(if
$(DEVICE_DTS_OVERLAY
),$(foreach dtso
,$(DEVICE_DTS_OVERLAY
), -O
$(dtso
):$(KERNEL_BUILD_DIR
)/image-
$(dtso
).dtb
)) \
295 -c
$(if
$(DEVICE_DTS_CONFIG
),$(DEVICE_DTS_CONFIG
),"config-1") \
296 -A
$(LINUX_KARCH
) -v
$(LINUX_VERSION
)
297 PATH
=$(LINUX_DIR
)/scripts
/dtc
:$(PATH
) mkimage
$(if
$(findstring external
,$(word 3,$(1))),\
298 -E
-B
0x1000 $(if
$(findstring static
,$(word 3,$(1))),-p
0x1000)) -f
$@.its
$@.new
303 gzip
-f
-9n
-c
$@
$(1) > $@.new
307 define Build
/install-dtb
309 $(foreach dts
,$(DEVICE_DTS
), \
311 $(DTS_DIR
)/$(dts
).dtb \
312 $(BIN_DIR
)/$(IMG_PREFIX
)-$(dts
).dtb
; \
314 install-dtb-
$(IMG_PREFIX
) \
318 define Build
/iptime-crc32
319 $(STAGING_DIR_HOST
)/bin
/iptime-crc32
$(1) $@
$@.new
323 define Build
/iptime-naspkg
324 $(STAGING_DIR_HOST
)/bin
/iptime-naspkg
$(1) $@
$@.new
329 rm -rf
$(KDIR_TMP
)/$(DEVICE_NAME
)/jffs2
&& \
330 mkdir
-p
$(KDIR_TMP
)/$(DEVICE_NAME
)/jffs2
/$$(dirname
$(1)) && \
331 cp
$@
$(KDIR_TMP
)/$(DEVICE_NAME
)/jffs2
/$(1) && \
332 $(STAGING_DIR_HOST
)/bin
/mkfs.jffs2
--pad \
333 $(if
$(CONFIG_BIG_ENDIAN
),--big-endian
,--little-endian
) \
334 --squash-uids
-v
-e
$(patsubst %k
,%KiB
,$(BLOCKSIZE
)) \
336 -d
$(KDIR_TMP
)/$(DEVICE_NAME
)/jffs2 \
337 2>&1 1>/dev
/null | awk
'/^.+$$$$/' && \
338 $(STAGING_DIR_HOST
)/bin
/padjffs2
$@.new
-J
$(patsubst %k
,,$(BLOCKSIZE
))
339 -rm -rf
$(KDIR_TMP
)/$(DEVICE_NAME
)/jffs2
/
343 define Build
/kernel2minor
344 $(eval temp_file
:= $(shell mktemp
))
346 kernel2minor
-k
$(temp_file
) -r
$(temp_file
).new
$(1)
347 mv
$(temp_file
).new
$@
351 define Build
/kernel-bin
356 define Build
/linksys-image
357 $(TOPDIR
)/scripts
/linksys-image.sh \
358 "$(call param_get_default,type,$(1),$(DEVICE_NAME))" \
364 $(call Build
/lzma-no-dict
,-lc1
-lp2
-pb2
$(1))
367 define Build
/lzma-no-dict
368 $(STAGING_DIR_HOST
)/bin
/lzma e
$@
$(1) $@.new
372 define Build
/netgear-chk
373 $(STAGING_DIR_HOST
)/bin
/mkchkimg \
376 -b
$(NETGEAR_BOARD_ID
) \
377 $(if
$(NETGEAR_REGION
),-r
$(NETGEAR_REGION
),)
381 define Build
/netgear-dni
382 $(STAGING_DIR_HOST
)/bin
/mkdniimg \
383 -B
$(NETGEAR_BOARD_ID
) -v
$(VERSION_DIST
).
$(firstword $(subst -, ,$(REVISION
))) \
384 $(if
$(NETGEAR_HW_ID
),-H
$(NETGEAR_HW_ID
)) \
390 define Build
/netgear-encrypted-factory
391 $(TOPDIR
)/scripts
/netgear-encrypted-factory.py \
394 --model
$(NETGEAR_ENC_MODEL
) \
395 --region
$(NETGEAR_ENC_REGION
) \
396 --version V1.0
.0.0.
$(VERSION_DIST
).
$(firstword $(subst -, ,$(REVISION
))) \
397 --encryption-block-size
0x20000 \
398 --openssl-bin
"$(STAGING_DIR_HOST)/bin/openssl" \
399 --key
6865392d342b4d212964363d6d7e7765312c7132613364316e26322a5a5e2538 \
400 --iv
4a253169516c38243d6c6d2d3b384145
403 define Build
/openmesh-image
404 $(TOPDIR
)/scripts
/om-fwupgradecfg-gen.sh \
405 "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" \
407 "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" \
408 "$(call param_get_default,rootfs,$(1),$@)"
409 $(TOPDIR
)/scripts
/combined-ext-image.sh \
410 "$(call param_get_default,ce_type,$(1),$(DEVICE_NAME))" "$@" \
411 "$@-fwupgrade.cfg" "fwupgrade.cfg" \
412 "$(call param_get_default,kernel,$(1),$(IMAGE_KERNEL))" "kernel" \
413 "$(call param_get_default,rootfs,$(1),$@)" "rootfs"
416 define Build
/pad-extra
417 dd if
=/dev
/zero bs
=$(1) count
=1 >> $@
420 define Build
/pad-offset
422 size
="$$(stat -c%s $@)" \
423 pad
="$(subst k,* 1024,$(word 1, $(1)))" \
424 offset
="$(subst k,* 1024,$(word 2, $(1)))" \
425 pad
="(pad - ((size + offset) % pad)) % pad" \
426 newsize
='size + pad'; \
427 dd if
=$@ of
=$@.new bs
=$$newsize count
=1 conv
=sync
431 define Build
/pad-rootfs
432 $(STAGING_DIR_HOST
)/bin
/padjffs2
$@
$(1) \
433 $(if
$(BLOCKSIZE
),$(BLOCKSIZE
:%k
=%),4 8 16 64 128 256)
437 $(call Image
/pad-to
,$@
,$(1))
440 define Build
/patch-cmdline
441 $(STAGING_DIR_HOST
)/bin
/patch-cmdline
$@
'$(CMDLINE)'
444 # Convert a raw image into a $1 type image.
445 # E.g. | qemu-image vdi <optional extra arguments to qemu-img binary>
446 define Build
/qemu-image
447 if command
-v qemu-img
; then \
448 qemu-img convert
-f raw
-O
$1 $@
$@.new
; \
451 echo
"WARNING: Install qemu-img to create VDI/VMDK images" >&2; exit
1; \
455 define Build
/qsdk-ipq-factory-nand
456 $(TOPDIR
)/scripts
/mkits-qsdk-ipq-image.sh \
458 PATH
=$(LINUX_DIR
)/scripts
/dtc
:$(PATH
) mkimage
-f
$@.its
$@.new
462 define Build
/qsdk-ipq-factory-nor
463 $(TOPDIR
)/scripts
/mkits-qsdk-ipq-image.sh \
464 $@.its hlos
$(IMAGE_KERNEL
) rootfs
$(IMAGE_ROOTFS
)
465 PATH
=$(LINUX_DIR
)/scripts
/dtc
:$(PATH
) mkimage
-f
$@.its
$@.new
470 $(STAGING_DIR_HOST
)/bin
/seama
-i
$@ \
471 -m
"dev=/dev/mtdblock/$(SEAMA_MTDBLOCK)" -m
"type=firmware"
475 define Build
/seama-seal
476 $(STAGING_DIR_HOST
)/bin
/seama
-i
$@
-s
$@.seama \
477 -m
"signature=$(SEAMA_SIGNATURE)"
481 define Build
/senao-header
482 $(STAGING_DIR_HOST
)/bin
/mksenaofw
$(1) -e
$@
-o
$@.new
486 define Build
/sysupgrade-tar
487 sh
$(TOPDIR
)/scripts
/sysupgrade-tar.sh \
488 --board
$(if
$(BOARD_NAME
),$(BOARD_NAME
),$(DEVICE_NAME
)) \
489 --kernel
$(call param_get_default
,kernel
,$(1),$(IMAGE_KERNEL
)) \
490 --rootfs
$(call param_get_default
,rootfs
,$(1),$(IMAGE_ROOTFS
)) \
494 define Build
/tplink-safeloader
495 -$(STAGING_DIR_HOST
)/bin
/tplink-safeloader \
496 -B
$(TPLINK_BOARD_ID
) \
502 $(wordlist
2,$(words $(1)),$(1)) \
503 $(if
$(findstring sysupgrade
,$(word 1,$(1))),-S
) && mv
$@.new
$@ ||
rm -f
$@
506 define Build
/tplink-v1-header
507 $(STAGING_DIR_HOST
)/bin
/mktplinkfw \
508 -c
-H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -L
$(KERNEL_LOADADDR
) \
509 -E
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
510 -m
$(TPLINK_HEADER_VERSION
) -N
"$(VERSION_DIST)" -V
$(REVISION
) \
515 # combine kernel and rootfs into one image
516 # mktplinkfw <type> <optional extra arguments to mktplinkfw binary>
517 # <type> is "sysupgrade" or "factory"
519 # -a align the rootfs start on an <align> bytes boundary
520 # -j add jffs2 end-of-filesystem markers
521 # -s strip padding from end of the image
522 # -X reserve <size> bytes in the firmware image (hexval prefixed with 0x)
523 define Build
/tplink-v1-image
524 -$(STAGING_DIR_HOST
)/bin
/mktplinkfw \
525 -H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -F
$(TPLINK_FLASHLAYOUT
) \
526 -N
"$(VERSION_DIST)" -V
$(REVISION
) -m
$(TPLINK_HEADER_VERSION
) \
527 -k
$(IMAGE_KERNEL
) -r
$(IMAGE_ROOTFS
) -o
$@.new
-j
-X
0x40000 \
528 -a
$(call rootfs_align
,$(FILESYSTEM
)) \
529 $(wordlist
2,$(words $(1)),$(1)) \
530 $(if
$(findstring sysupgrade
,$(word 1,$(1))),-s
) && mv
$@.new
$@ ||
rm -f
$@
533 define Build
/tplink-v2-header
534 $(STAGING_DIR_HOST
)/bin
/mktplinkfw2 \
535 -c
-H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) -L
$(KERNEL_LOADADDR
) \
536 -E
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
537 -w
$(TPLINK_HWREVADD
) -F
"$(TPLINK_FLASHLAYOUT)" \
538 -T
$(TPLINK_HVERSION
) -V
"ver. 2.0" \
543 define Build
/tplink-v2-image
544 $(STAGING_DIR_HOST
)/bin
/mktplinkfw2 \
545 -H
$(TPLINK_HWID
) -W
$(TPLINK_HWREV
) \
546 -w
$(TPLINK_HWREVADD
) -F
"$(TPLINK_FLASHLAYOUT)" \
547 -T
$(TPLINK_HVERSION
) -V
"ver. 2.0" -a
0x4 -j \
548 -k
$(IMAGE_KERNEL
) -r
$(IMAGE_ROOTFS
) -o
$@.new
$(1)
559 -a
$(KERNEL_LOADADDR
) \
560 -e
$(if
$(KERNEL_ENTRY
),$(KERNEL_ENTRY
),$(KERNEL_LOADADDR
)) \
561 -n
'$(if $(UIMAGE_NAME),$(UIMAGE_NAME),$(call toupper,$(LINUX_KARCH)) $(VERSION_DIST) Linux-$(LINUX_VERSION))' \
562 $(if
$(UIMAGE_MAGIC
),-M
$(UIMAGE_MAGIC
)) \
563 $(wordlist
2,$(words $(1)),$(1)) \
568 define Build
/xor-image
569 $(STAGING_DIR_HOST
)/bin
/xorimage
-i
$@
-o
$@.xor
$(1)
576 mv
$@
$@.tmp
/$(word 1,$(1))
577 TZ
=UTC
$(STAGING_DIR_HOST
)/bin
/zip
-j
-X \
578 $(wordlist
2,$(words $(1)),$(1)) \
579 $@
$@.tmp
/$(if
$(word 1,$(1)),$(word 1,$(1)),$$(basename $@
))
583 define Build
/zyxel-ras-image
585 newsize
="$(subst k,* 1024,$(RAS_ROOTFS_SIZE))"; \
586 $(STAGING_DIR_HOST
)/bin
/mkrasimage \
592 $(if
$(findstring separate-kernel
,$(word 1,$(1))),-k
$(IMAGE_KERNEL
)) \