firmware-utils: mktplinkfw: rework combined image option

We use combined option in "mktplinkfw" tool for generating initramfs
kernel images and header for kernel inside "safeloader" image type (in
fact, only for TL-WR1043ND v4 at this moment).

There is also "mktplinkfw-kernel" tool, a stripped-down version, used
only for generating "simple" header, for safeloader image types.

This changes how "mktplinkfw" handles combined images (which then will
allow us to drop the stripped-down version of the tool):

- drop "ignore size" command line option (it was used only for combined
  images anyway)
- don't require "flash layout id" for combined images (we don't need and
  shouldn't limit size of the initramfs kernel and for kernels inside
  safeloader images, the "tplink-safeloader" tool does the size check)
- require kernel address and entry point in command line parameters for
  combined images (consequence of previous point)
- don't include md5 sum and firmware length values in header (they are
  needed only for update from vendor GUI and are ingored in case of
  initramfs and "tplink-safeloader" images)
- drop "fake" flash layout for TL-WR1043ND v4 as it's no longer needed

Also, adjust "mktplinkfw-combined" command in ar71xx/image/tp-link.mk to
match introduced changes in "mktplinkfw" tool.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
This commit is contained in:
Piotr Dymacz
2017-07-06 16:34:47 +02:00
parent 8223dac99a
commit b3cb0e7588
2 changed files with 46 additions and 64 deletions

View File

@@ -40,11 +40,11 @@ endef
# -c combined image
define Build/mktplinkfw-combined
$(STAGING_DIR_HOST)/bin/mktplinkfw \
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -F $(TPLINK_FLASHLAYOUT) -N OpenWrt -V $(REVISION) $(1) \
-m $(TPLINK_HEADER_VERSION) \
-H $(TPLINK_HWID) -W $(TPLINK_HWREV) -N OpenWrt -V $(REVISION) $(1) \
-L $(KERNEL_LOADADDR) -m $(TPLINK_HEADER_VERSION) \
-E $(if $(KERNEL_ENTRY),$(KERNEL_ENTRY),$(KERNEL_LOADADDR)) \
-k $@ \
-o $@.new \
-s -S \
-c
@mv $@.new $@
endef
@@ -707,7 +707,6 @@ define Device/tl-wr1043nd-v4
BOARDNAME := TL-WR1043ND-v4
DEVICE_PROFILE := TLWR1043
TPLINK_HWID := 0x10430004
TPLINK_FLASHLAYOUT := 16Msafeloader
MTDPARTS := spi0.0:128k(u-boot)ro,1536k(kernel),14016k(rootfs),128k(product-info)ro,320k(config)ro,64k(partition-table)ro,128k(logs)ro,64k(ART)ro,15552k@0x20000(firmware)
IMAGE_SIZE := 15552k
TPLINK_BOARD_ID := TLWR1043NDV4