[OpenWrt-Devel] [PATCH v1 0/7] Add custom TRX header option

Florian Fainelli florian at openwrt.org
Mon Feb 9 15:52:43 EST 2015

On 09/02/15 08:29, Will Sheppard wrote:
> Patchset to essentially add custom TRX header to all firmware produced.
> This is most useful for the Belkin routers from my experience. I'm not
> how other trx based firmwares modify the header for their own purposes.
> This is applied across the board so that the kernel, trx tools and mtd 
> tools are all compiled with the specified header.
> I have modified the kernel specifically for the brcm47xx based boards to
> ensure the mtd parser looks for the correct magic. NOTE: This function will, 
> for other boards, fail.

I don't think this is desirable at all to have, for many reasons:

- how can an use figure out the proper TRX_MAGIC value he/she should use?

- this is extremely error prone and can result, as you mention in
failing to work with existing devices with well-defined TRX headers

- how can we get some level of reproducibility for both the kernel and
firmware tools builds?

I would really encourage you to extend the existing code to take an
arbitrary list of TRX magics, such that you can have maybe a single file
to modify and both "mtd" and the kernel can use that list of magic
values accordingly.

Out of curiosity, how many different TRX magic values should we have to
support with or without your patches?

> Will Sheppard (7):
>   config: Add option to specify custom TRX header
>   mtd: Add custom trx magic option to mtd tool
>   mtd: Fix: Use TRX_MAGIC define not hard-coded number
>   trx: Add custom TRX option to trx firmware tool
>   mtd: Add debug showing header magic in use
>   kernel: bcm47xx: Add custom TRX header option to kernel
>   mtd: Fix makefile to work with quilt as per wiki
>  config/Config-images.in                            | 15 ++++++++++
>  package/system/mtd/Makefile                        |  9 +++++-
>  package/system/mtd/src/trx.c                       | 10 +++++--
>  .../patches-3.14/162-Belkin_custom_trx_magic.patch | 35 ++++++++++++++++++++++
>  tools/firmware-utils/Makefile                      |  4 +++
>  tools/firmware-utils/src/trx.c                     | 10 ++++++-
>  6 files changed, 79 insertions(+), 4 deletions(-)
>  create mode 100644 target/linux/brcm47xx/patches-3.14/162-Belkin_custom_trx_magic.patch
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list