Rhnn Hur [Tue, 8 Oct 2024 18:18:50 +0000 (03:18 +0900)]
iptime-crc32: add support for ipTIME AX3000M
Add support to create flashable factory image on ipTIME webpage
for target model.
Signed-off-by: Rhnn Hur <hurrhnn@icmp.kr>
Rafał Miłecki [Tue, 15 Oct 2024 22:17:53 +0000 (00:17 +0200)]
bcmclm: support printing channels
CLM seems to store ranges of channels it contains data for. Print
them.
Example output:
2.4 GHz band channels: 1 - 14
5 GHz band channels: 34 - 46
5 GHz band channels: 36 - 64
5 GHz band channels: 100 - 144
5 GHz band channels: 149 - 165
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
timnoack [Sun, 13 Oct 2024 08:49:14 +0000 (10:49 +0200)]
tplink-safeloader: add support for cpe710-v2
TP-Link CPE710-v2 is an outdoor wireless CPE for 5 GHz with one Ethernet
port based on the AP152 reference board. In contrast to the CPE710-v1,
the factory firmware updater expects the software version to be > 0.0.X
and the compatibility level to be >= 1.
Specifications:
- SoC: QCA9563-AL3A MIPS 74kc @ 775MHz, AHB @ 258MHz
- RAM: 128MiB DDR2 @ 650MHz
- Flash: 16MiB SPI NOR Based on the GD25Q128
- Wi-Fi 5Ghz: ath10k chip (802.11ac for up to 867Mbps on 5GHz wireless
data rate), based on the QCA9896
- Ethernet: one 1GbE port
- 23dBi high-gain directional 2×2 MIMO parabolic antenna
- Power, LAN, WLAN5G Blue LEDs
Flashing instructions:
Flash factory image through stock firmware WEB UI or through TFTP
To get to TFTP recovery just hold reset button while powering on for
around 30-40 seconds and release.
Rename factory image to recovery.bin
Stock TFTP server IP:192.168.0.100
Stock device TFTP address:192.168.0.254
Signed-off-by: Tim Noack <tim@noack.id>
Damien Zammit [Thu, 25 Jul 2024 04:21:17 +0000 (14:21 +1000)]
mktplinkfw2: Add 16Mmtk layout
This supports eg, TP-Link Archer MR200 v6
Signed-off-by: Damien Zammit <damien@zamaudio.com>
Link: https://github.com/openwrt/firmware-utils/pull/34
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Sander Vanheule [Sat, 21 Sep 2024 11:13:17 +0000 (13:13 +0200)]
tplink-safeloader: bump EAP610-V3 compat_level
Since vendor firmware version 1.4.x, the compatibility level for the
TP-Link EAP610 v3/EAP613 v1 has been bumped from 2. This means users
running 1.4.x or newer cannot install the OpenWrt factory image with
compatibility level 1. Align the numbers to fix this.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
INAGAKI Hiroshi [Wed, 8 May 2024 13:36:05 +0000 (22:36 +0900)]
nec-usbatermfw: add tool for NEC "USB ATERM" format
Add a tool for NEC Aterm devices using "USB ATERM" format.
This format is mainly used on the devices based on NetBSD, such as
WR8750N, WG600HP and WG1400HP.
A workaround in write_blockheader() is needed to resolve an unknown bug
when generating an image if built with gcc 9.4.0
(Ubuntu 9.4.0-1ubuntu1~20.04.2) and cmake.
example:
index 1 and 4 are fixed data and checksum of them shouldn't be changed
- with the workaround
nec-usbatermfw \
openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin.new \
-t H033 \
-f 0x0003 -d loader-nec_wr9500n.bin \
-d openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin
Flags Total Len. Load Addr Entry Point Checksum
1: 0x0000, 0x0000003e, 0x00000000, 0x00000000, 0x00001988
2: 0x0003, 0x00000a14, 0x80040000, 0x80040000, 0x00001526
3: 0x0002, 0x0054df20, 0x80040000, 0x80040000, 0x0000c41f
4: 0x0001, 0x00000018, 0x00000000, 0x00000000, 0x0000cfff
- without the workaround
nec-usbatermfw \
openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin.new \
-t H033 \
-f 0x0003 -d loader-nec_wr9500n.bin \
-d openwrt-ath79-tiny-nec_wr9500n-initramfs-factory.bin
Flags Total Len. Load Addr Entry Point Checksum
1: 0x0000, 0x0000003e, 0x00000000, 0x00000000, 0x00001988
2: 0x0003, 0x00000a14, 0x80040000, 0x80040000, 0x00009528
3: 0x0002, 0x0054df20, 0x80040000, 0x80040000, 0x00004422
4: 0x0001, 0x00000018, 0x00000000, 0x00000000, 0x00005002
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Christian Marangi [Sun, 30 Jun 2024 10:31:59 +0000 (12:31 +0200)]
asusuimage: fix compile error with old GCC release
Fix compile error with old GCC release that doesn't like declaration in
switch case.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Oleg S [Tue, 20 Feb 2024 07:40:29 +0000 (10:40 +0300)]
asusuimage: new tool for creating TRX-images compatible with AsusWRT
This tool allows you to create `trx`-images for many Asus routers.
Supported v2 and v3 format of `trx`-images.
This format and tool use the mkimage generated uImage or multi images
and add Asus specific tail to pass AsusWRT validation.
Tested on Asus RT-AX89X which uses the v2 format.
Signed-off-by: Oleg S <remittor@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
[Major code cleanup, use generic endian conversion instead of defines,
use switches, move info printing to a separate function, use zlib CRC32]
[Remove VSC compatibility, fix warnings, rename to asusimage,
move variables to top of functions]
Link: https://github.com/openwrt/firmware-utils/pull/31
Signed-off-by: Robert Marko <robimarko@gmail.com>
Ernesto Castellotti [Mon, 22 Apr 2024 12:45:44 +0000 (14:45 +0200)]
zytrx: add ZyXEL LTE7490-M904
Add header mapping for ZyXEL LTE7490-M904 to zytrx.
Signed-off-by: Ernesto Castellotti <ernesto@castellotti.net>Link: https://github.com/openwrt/firmware-utils/pull/25
Signed-off-by: Robert Marko <robimarko@gmail.com>
Sergey Filippov [Sat, 15 Jun 2024 17:14:35 +0000 (19:14 +0200)]
linksys: add magic header generation tool for e8350 v1
Add support for upgrade from vendor firmware for Linksys e8350.
As part of adding support for Linksys e8350 to OpenWrt it is required to have this tool.
Signed-off-by: Sergey Filippov <sergey.filippov@outlook.com>
[ fix formal code problem, calloc instead of malloc + memset ]
Link: https://github.com/openwrt/firmware-utils/pull/30
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Rafał Miłecki [Fri, 23 Feb 2024 06:18:39 +0000 (07:18 +0100)]
pc1crypt: make decrypt/encrypt functions take void * as argument
Make them more generic regarding accepted data buffers.
This fixes:
src/pc1crypt.c: In function ‘main’:
src/pc1crypt.c:322:26: warning: pointer targets in passing argument 2 of ‘pc1_decrypt_buf’ differ in signedness [-Wpointer-sign]
pc1_decrypt_buf(&pc1, buf, datalen);
^~~
src/pc1crypt.c:324:26: warning: pointer targets in passing argument 2 of ‘pc1_encrypt_buf’ differ in signedness [-Wpointer-sign]
pc1_encrypt_buf(&pc1, buf, datalen);
^~~
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Fri, 23 Feb 2024 06:18:38 +0000 (07:18 +0100)]
uimage_sgehdr: drop unused "ltmp" variable
This fixes:
src/uimage_sgehdr.c: In function ‘main’:
src/uimage_sgehdr.c:76:6: warning: unused variable ‘ltmp’ [-Wunused-variable]
int ltmp;
^~~~
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Fri, 23 Feb 2024 06:18:37 +0000 (07:18 +0100)]
uimage_sgehdr: use "char" type for header struct strings
This fixes:
src/uimage_sgehdr.c: In function ‘main’:
src/uimage_sgehdr.c:152:10: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness [-Wpointer-sign]
strncpy(imgh->sgeih_p, model, sizeof(imgh->sgeih_p));
^~~~
src/uimage_sgehdr.c:153:10: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness [-Wpointer-sign]
strncpy(imgh->sgeih_sv, sversion, sizeof(imgh->sgeih_sv));
^~~~
src/uimage_sgehdr.c:154:10: warning: pointer targets in passing argument 1 of ‘strncpy’ differ in signedness [-Wpointer-sign]
strncpy(imgh->sgeih_hv, hversion, sizeof(imgh->sgeih_hv));
^~~~
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Fri, 23 Feb 2024 06:18:36 +0000 (07:18 +0100)]
srec2bin: drop unused "dum" variable
This fixes:
src/srec2bin.c: In function ‘checksum’:
src/srec2bin.c:297:7: warning: variable ‘dum’ set but not used [-Wunused-but-set-variable]
int dum;
^~~
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Thomas Richard [Fri, 23 Feb 2024 14:49:07 +0000 (15:49 +0100)]
ptgen: fix limitation for active partition in GPT
In GPT there is no reason to limit the active partition number to 4.
This limitation is only for MBR, as it corresponds to the maximum number
of primary partitions.
Signed-off-by: Thomas Richard <thomas.richard@bootlin.com>
Tomasz Maciej Nowak [Mon, 12 Feb 2024 16:18:33 +0000 (17:18 +0100)]
zycast: disable build on non-Linux OS
Fails with following errors on MacOS builder:
firmware-utils/src/zycast.c:205:35: error: use of undeclared identifier 'MSG_MORE'
if (send(sockfd, phdr, HDRSIZE, MSG_MORE | MSG_DONTROUTE) < 0)
^
firmware-utils/src/zycast.c:285:39: error: use of undeclared identifier 'SO_BINDTODEVICE'
if (setsockopt(sockfd, SOL_SOCKET, SO_BINDTODEVICE, optarg, strlen(optarg)) < 0)
^
These seem to be Linux only definitions and there are no equivalents, so
leave rewrite of zycast to someone interested in running it on other OS.
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Steffen Loley [Fri, 9 Feb 2024 17:48:15 +0000 (18:48 +0100)]
tplink-safeloader: add TP-Link RE205 v3 support
The resulting factory image has been tested on a TP-Link RE205 v3. It
has been successfully upgraded an OpenWrt image.
Information like "special_id"s that was needed to modify the tool has
been read out from an original firmware upgrade package.
Signed-off-by: Steffen Loley <slo-src@web.de>
Sander Vanheule [Wed, 31 Jan 2024 07:58:26 +0000 (08:58 +0100)]
tplink-safeloader: bump EAP225-V3 compat_level
Since firmware revision 5.1.0, the firmware compatibility level
increased to 2 for the following devices:
- EAP225 v3,
- EAP225 v4,
- EAP225-Outdoor v1, and
- EAP225-Outdoor v3.
This means that this and later revisions will refuse (OpenWrt) images
with compatibility level 1, so increase our level to get them accepted
again.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Tue, 16 Jan 2024 19:31:33 +0000 (20:31 +0100)]
tplink-safeloader: bump EAP225-Outdoor v1 compat
Since firmware revision 5.1.0, the firmware compatibility version
increased to 2. This means that this and later revisions will refuse
(OpenWrt) images with compatibility version 1, so increase our level to
get them accepted again.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Tue, 16 Jan 2024 19:44:19 +0000 (20:44 +0100)]
tplink-safeloader: show compat_level with FW info
To help diagnosing issues with stock firmware refusing OpenWrt factory
images, it can be useful to compare firmware compatibility levels. Print
it out with the rest of the version info, if it is contained in the
soft-version partition.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Bjørn Mork [Sat, 5 Aug 2023 15:09:35 +0000 (17:09 +0200)]
zycast: new tool for ZyXEL bootloader flashing
The bootloader of many ZyXEL routers support a proprietary
feature allowing the devices to be flashed over the network
using a multicast stream.
This tool is an attempt to document and implement the client
side of this protocol
The set of possibly supported ZyXEL devices include NR7101,
NR5101, WAP6805, P8702N, P2812HNU, VMG8825, EX5401 and many
more. Implementation details are known to vary among devices.
Quirks are to be expected on any untested device.
This code is ONLY tested on the NR7101.
Supported devices will listen for magic packets a few seconds
on every boot. This is indicated by a console message like
Multiboot Listening...
or
wait multiboot...
or
Multiboot clinent(sic) version: 1.2
Typically followed by a countdown indicating when the listen
window closes.
Synchronizing the client with the listening window is not
required. The protocol is designed to allow the client to
continuously repeat its image stream. Just start the
client before rebooting the router and let it run till the
download is finished.
This means that it is possible to do blind upgrades too. But
any error will be hard to catch without console.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tomasz Maciej Nowak [Thu, 21 Dec 2023 21:15:01 +0000 (22:15 +0100)]
tplink-safeloader: add RE365 v1
Partition layout same as RE305 v1. Values extracted from vendor
firmware. This will only be used for creating factory image.
Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Stijn Segers [Wed, 22 Nov 2023 17:39:55 +0000 (18:39 +0100)]
tplink-safeloader: bump EAP615-Wall compat_level
Newer EAP615-Walls come with more recent firmware that requires a
higher soft_ver_compat_level. Bump ours from 1 to 2 to keep in step.
Tested on a newer EA615-Wall by grauheier - see forum topic:
https://forum.openwrt.org/t/173424/13.
Tested-by: Danny Scherer <graureiher@kaputtmachen.jetzt>
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Alexey Kuznetsov [Mon, 20 Nov 2023 07:56:59 +0000 (10:56 +0300)]
tplink-safeloader: add Archer A6 v2 (RU)
The SupportList entry can be obtained from the firmare at:
https://www.tp-link.com/ru/support/download/archer-a6/#Firmware
$ strings firmware.bin | grep "special_id"
{product_name:Archer A6,product_ver:2.0.0,special_id:
52550000}
Link: https://forum.openwrt.org/t/60075/50
Signed-off-by: Alexey Kuznetsov <axet@me.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Rafał Miłecki [Mon, 29 Jun 2020 07:34:59 +0000 (09:34 +0200)]
lxlfw: support certificate & signature blobs
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Mon, 29 Jun 2020 10:38:18 +0000 (12:38 +0200)]
lxlfw: support extracting image
This may be useful for flashing image or creating signature for it.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Wed, 24 Jun 2020 13:59:03 +0000 (15:59 +0200)]
lxlfw: support embedding blobs
This change adds support for V3 Luxul header format. It introduces
blobs support (using blobs_offset and blobs_len) that will allow:
1. Storing random data chunks after header static fields
2. Adding more static fields thanks to not hardcoding chunks offset.
Blobs allow storing variable amount of any custom data of variable size.
Each blob should have type set to some predefined value.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Thu, 25 Jun 2020 12:12:10 +0000 (14:12 +0200)]
lxlfw: fix struct lxl_hdr attribute
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Sat, 27 Jun 2020 18:38:17 +0000 (20:38 +0200)]
lxlfw: move code copying data to helper function
It will be reused for inserting blobs.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Thu, 25 Jun 2020 12:02:32 +0000 (14:02 +0200)]
lxlfw: move code opening LXL to helper function
It will be reused for extracting data.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Sebastian Schaper [Thu, 2 Nov 2023 19:16:06 +0000 (20:16 +0100)]
add dlink-sge-image for D-Link devices by SGE
This tool will encrypt/decrypt factory images requiring the "SHRS" header
e.g. COVR-C1200, COVR-P2500, COVR-X1860, DIR-878, DIR-882, ...
Encryption is loosely based on a series of blogposts by ricksanchez [1]
and the provided code [2], as well as patches to qca-uboot found in the
GPL tarball released for D-Link COVR-P2500 Rev. A1 [3].
Further scripts (e.g. /lib/upgrade/) and keys were found in the GPL tarball
and/or rootfs of COVR-C1200 (the devices are based on OpenWrt Chaos Calmer
and failsafe can be entered by pressing 'f' on the serial console during
boot, allowing to access the file system of the running device).
For newer devices like COVR-X1860 and DIR-X3260, an updated method of
vendor key derivation is implemented based on enk.txt from the GPL release.
[1] https://0x00sec.org/t/breaking-the-d-link-dir3060-firmware-encryption-recon-part-1/21943
[2] https://github.com/0xricksanchez/dlink-decrypt
[3] https://tsd.dlink.com.tw/GPL.asp
Signed-off-by: Sebastian Schaper <openwrt@sebastianschaper.net>
Tested-By: Alan Luck <luckyhome2008@gmail.com>
Tested-By: Paul Spooren <mail@aparcar.org>
Zoltan HERPAI [Thu, 2 Jun 2022 10:29:57 +0000 (12:29 +0200)]
firmware-utils: ptgen: add SiFive GPT partition support
The SiFive RISC-V SoCs use two special partition types in the boot process.
As a first step, the ZSBL (zero-stage bootloader) in the CPU looks for a
partition with a GUID of
5B193300-FC78-40CD-8002-
E86C45580B47 to load the
first-stage bootloader - which in OpenWrt's case is an SPL image. The FSBL
(SPL) then looks for a partition with a GUID of
2E54B353-1271-4842-806F-
E436D6AF6985 to load the SSBL which is usually an
u-boot.
With ptgen already supporting GPT partition creation, add the required GUID
types and name them accordingly to be invoked with the '-T <GPT partition
type>' parameter.
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
Milan Krstic [Fri, 29 Sep 2023 19:18:03 +0000 (19:18 +0000)]
zytrx: add LTE5398-M904
Add header mapping for ZyXEL LTE5398-M904 to zytrx.
Signed-off-by: Milan Krstic <milan.krstic@gmail.com>
Joe Mullally [Mon, 18 Sep 2023 21:51:04 +0000 (22:51 +0100)]
tplink-safeloader: WPA8631: add v4 AU, US
Like the WPA8631P v4 EU, these firmwares have the same partition layout
as the existing v3 image.
Link: https://forum.openwrt.org/t/support-for-tp-link-tl-wpa8631p-v4/162122
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Alexander Couzens [Tue, 9 Apr 2019 17:03:34 +0000 (19:03 +0200)]
mktplinkfw2: show exact exceed bytes when the image is to big
When an image is too big it's useful to show how many bytes the image
is to big.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Alexander Couzens [Wed, 25 Apr 2018 09:42:43 +0000 (11:42 +0200)]
mktplinkfw2: add support to pack bootloader
The 841v13 and 841v14 can not flash any image without bootloader over
the WebUI due a bug in the oem firmware upgrade software.
Allow mktplinkfw2 to integrate bootloaders.
An image with the bootloader looks:
|------------|
|image header|
|------------|
|bootloader |
|------------|
|optional pad|
|------------|
|image header|
|------------|
|kernel image|
|------------|
|rootfs image|
|------------|
The padding depends on the bootloader size. The 2nd image header must
start on a 64k boundary.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Alexander Couzens [Tue, 7 May 2019 14:33:58 +0000 (16:33 +0200)]
mktplinkfw2: add support to extract bootloader images
tplinkfw2 images from TP-Link contains a bootloader image in most cases.
-x will create a -bootloader.bin file.
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Simon Wood [Tue, 20 Jun 2023 00:15:23 +0000 (18:15 -0600)]
tplink-safeloader: CPE510: add Canadian support
Thanks to @mungewell.
Fixes: https://github.com/openwrt/openwrt/issues/12939
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Stefan Weil [Sun, 19 Mar 2023 10:19:48 +0000 (11:19 +0100)]
firmware-utils: fix use of NULL string progname
The compiler complains about several lines which use `progname`,
but that char pointer was NULL.
Fixes: 16cff6c7ca36 ("firmware-utils: fix unused variable warnings")
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Sander Vanheule [Sun, 25 Jun 2023 18:55:00 +0000 (20:55 +0200)]
tplink-safeloader: add EAP610 v3 and EAP613 v1
The TP-Link EAP610 v3 is a MT7621 version of the EAP610 v1/v2, which use
a QCA chipset. The TP-Link EAP613 v1 appears to be rebrand of the
former.
The original 'os-image' and 'file-system' partition are merged into a
single 'firmware' partition.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Tan Li Boon [Tue, 21 Mar 2023 07:55:33 +0000 (16:55 +0900)]
tplink-safeloader: Add support for TP-Link Deco M5
The special_id values are the same for EU and Asian models,
and they apply to all models: v1, v2, and v3.
They are not sorted as they are currently in the same order
as extracted from the official firmware image.
Note that the partition names need to be overridden with '@1' suffix,
as observed in the original firmware.
Signed-off-by: Tan Li Boon <undisputed.seraphim@gmail.com>
Ivan Mironov [Wed, 3 May 2023 15:41:40 +0000 (17:41 +0200)]
tplink-safeloader: add RU support-list entry for Archer C6U v1
Tested on actual hardware.
Signed-off-by: Ivan Mironov <mironov.ivan@gmail.com>
Rafał Miłecki [Wed, 21 Jun 2023 07:29:00 +0000 (09:29 +0200)]
bcmclm: new tool for reading Broadcom's CLM data
Broadcom developed CLM format for devices vendors to provide regulatory
configuration independently of executable firmware. They contain info
about countries, channels and rates.
CLM data can be packaged with chipset info as CLM BLOB and uploaded to
FullMAC firmware for complete channel support and maximum transmission
power.
CLM binary format is a bit tricky. It consists of a lot of binary
structs with all kind of numbers and flags. In-file addresses of those
structs and then stored in parent structs.
This tool provides initial support for reading CLM data content. It
parses the root struct and follows info lower level structs.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Míguel Ángel Mulero Martínez [Thu, 1 Jun 2023 13:30:29 +0000 (15:30 +0200)]
firmware-utils: fix typo in error message when no OpenSSL library found
Simply fix a typo in the error message: librry -> library
Signed-off-by: Míguel Ángel Mulero Martínez <migmul@gmail.com>
Rafał Miłecki [Mon, 12 Jun 2023 21:11:46 +0000 (23:11 +0200)]
bcmblob: new tool for reading Broadcom's BLOBs
Broadcom designed its BLOB binary format for storing multiple binary
entries in a single file. It's mostly know from CLM BLOB files that are
used for storing regulatory data and chip model.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Joe Mullally [Mon, 5 Jun 2023 18:47:42 +0000 (19:47 +0100)]
tplink-safeloader: add TL-WPA8631P v4
The only available v4 firmware
wpa8631pv4_eu-up-ver4-0-0-P1-
20220510-rel56203-APPLC.bin matches the v3
partition scheme.
User testing confirms the existing WPA8631P v3 image works on this
device.
Link: https://forum.openwrt.org/t/162122
Tested-by: Harald Mayer <harald_mayer@yahoo.com>
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Joe Mullally [Sat, 27 May 2023 19:54:23 +0000 (20:54 +0100)]
tplink-safeloader: add TL-WPA8635P v3
Inspecting the only available firmware
wpa8635pv3_fr-up-ver3-0-0-P1-
20210625-rel39993-APPLC.bin shows the
WPA8631Pv3 EU is also supported by that firmware and the partition
layout is identical to the currently supported WPA8631P v3 layout.
Expand size of support-list partition into unused space in soft-version
(which is also supplied by tplink-safeloader) to fit the new entry.
Link: https://forum.openwrt.org/t/137404/5
Tested-by: William Lallemand <wlallemand@irq6.net>
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
Andrea Maria Farina [Mon, 29 May 2023 14:51:52 +0000 (16:51 +0200)]
tplink-safeloader: Add TP-Link Archer A6 V3.20
TP-Link firmwares for Archer A6 V3 also lists EU and RU variants for
V3.20. Add these to the support list.
Signed-off-by: Andrea Maria Farina <farina.andreamaria@mailbox.org>
[update title and commit message]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sergey G. Shishkin [Thu, 18 May 2023 08:00:09 +0000 (10:00 +0200)]
tplink-safeloader: add Archer AX23 v1.2 (RU)
Link: https://forum.openwrt.org/t/add-support-for-tp-link-ax23-v1/130746/83
Signed-off-by: Sergey G. Shishkin <sergey.shishkin@gmail.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
Aleksandar Tanev [Thu, 18 May 2023 07:58:10 +0000 (09:58 +0200)]
tplink-safeloader: add AX23 support-list entry
Signed-off-by: Aleksandar Tanev <33719472+atanev@users.noreply.github.com>
Signed-off-by: David Bauer <mail@david-bauer.net>
David Bauer [Thu, 18 May 2023 07:53:51 +0000 (09:53 +0200)]
tplink-safeloader: order AX23 support-list
Signed-off-by: David Bauer <mail@david-bauer.net>
Eric Mockler [Mon, 20 Feb 2023 03:04:45 +0000 (19:04 -0800)]
tplink-safeloader: add Archer C59 / C60 CA ragion code
Add region codes specific to the CA regional model. his allows
installation of OpenWrt on these models.
Link: https://forum.openwrt.org/t/support-for-tp-link-archer-c59-v1-ca/140839
Link: https://forum.openwrt.org/t/adding-support-for-canadian-tp-link-archer-c60-v2-0/75273
Signed-off-by: Eric Mockler <mock7ee@gmail.com>
[rework commit message]
Signed-off-by: David Bauer <mail@david-bauer.net>
David Bauer [Mon, 17 Apr 2023 04:16:38 +0000 (06:16 +0200)]
tplink-safeloader: increase support-list size for AX23 v1
Increase the size of the support-list partition in order to
accommodate the added support-list entries for CA/US/TW versions.
Fixes: f98095ffd7cf ("tplink-safeloader: increase support-list size for AX23 v1")
Signed-off-by: David Bauer <mail@david-bauer.net>
David Bauer [Sat, 8 Apr 2023 23:02:01 +0000 (01:02 +0200)]
tplink-safeloader: add US-CA-TW support-list entries for Archer AX23v1
David Bauer [Tue, 14 Mar 2023 03:04:18 +0000 (04:04 +0100)]
tplink-safeloader: add Archer AX23
Original partition alignment
----------------------------
partition fs-uboot base 0x00000 size 0x40000
partition os-image base 0x40000 size 0x400000
partition file-system base 0x440000 size 0xb60000
partition default-mac base 0xfa0000 size 0x00200
partition pin base 0xfa0200 size 0x00100
partition device-id base 0xfa0300 size 0x00100
partition product-info base 0xfa0400 size 0x0fc00
partition default-config base 0xfb0000 size 0x08000
partition ap-def-config base 0xfb8000 size 0x08000
partition user-config base 0xfc0000 size 0x0a000
partition ag-config base 0xfca000 size 0x04000
partition certificate base 0xfce000 size 0x02000
partition ap-config base 0xfd0000 size 0x06000
partition router-config base 0xfd6000 size 0x06000
partition favicon base 0xfdc000 size 0x02000
partition logo base 0xfde000 size 0x02000
partition partition-table base 0xfe0000 size 0x00800
partition soft-version base 0xfe0800 size 0x00100
partition support-list base 0xfe0900 size 0x00200
partition profile base 0xfe0b00 size 0x03000
partition extra-para base 0xfe3b00 size 0x00100
partition radio base 0xff0000 size 0x10000
Vendor image partition-table
----------------------------
partition fs-uboot base 0x00000 size 0x40000
partition os-image base 0x40000 size 0x400000
partition file-system base 0x440000 size 0xb60000
partition default-mac base 0xfa0000 size 0x00200
partition pin base 0xfa0200 size 0x00100
partition device-id base 0xfa0300 size 0x00100
partition product-info base 0xfa0400 size 0x0fc00
partition default-config base 0xfb0000 size 0x08000
partition ap-def-config base 0xfb8000 size 0x08000
partition user-config base 0xfc0000 size 0x0a000
partition ag-config base 0xfca000 size 0x04000
partition certificate base 0xfce000 size 0x02000
partition ap-config base 0xfd0000 size 0x06000
partition router-config base 0xfd6000 size 0x06000
partition favicon base 0xfdc000 size 0x02000
partition logo base 0xfde000 size 0x02000
partition partition-table base 0xfe0000 size 0x00800
partition soft-version base 0xfe0800 size 0x00100
partition support-list base 0xfe0900 size 0x00200
partition profile base 0xfe0b00 size 0x03000
partition extra-para base 0xfe3b00 size 0x00100
partition radio base 0xff0000 size 0x10000
Signed-off-by: David Bauer <mail@david-bauer.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:24 +0000 (23:03 +0100)]
tplink-safeloader: add Cloud image detection
The vendor info in the safeloader header for some images (e.g. Archer
C60 v3) starts with "fw-type:Cloud" instead of a big endian data length.
Only detection is implemented at this moment, as the full header format
is not yet understood.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:23 +0000 (23:03 +0100)]
tplink-safeloader: add QNEW image detection
An incompatible image type is now used, e.g. for the TL-WPA8631P v4,
which has a header containing 0x3C extra bytes. This image type can be
identified by the first four bytes of the image header being "?NEW".
Only detection is implemented at this moment, as the full header format
is not yet understood, and the preamble checksum can no longer be
verified using the current md5sum salt. Devices still appear to accept
images in the "old" format, so image generation is not required at this
moment.
Cc: Andreas Böhler <dev@aboehler.at>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:22 +0000 (23:03 +0100)]
tplink-safeloader: add vendor info support
Some images may contain ASCII vendor info at the start of the image
header. Detect this image type, and display the info when requested.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:21 +0000 (23:03 +0100)]
tplink-safeloader: refactor image ingestion
The tool supports three modes that ingest an existing safeloader image:
-i (image info), -x (extract payloads), and -z (convert to sysupgrade).
These modes all re-implement image parsing, so refactor the code to make
sure there is only one place this is performed.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:20 +0000 (23:03 +0100)]
tplink-safeloader: ignore NULLs in version info
When the soft-version partition contents are checked for a text-format
version string, isascii() is used to check the contained bytes. This
also returns true on control characters, which includes terminating
NULL characters.
After checking if the data is a string, use the actual string length for
printing the contained data to avoid outputting NULLs to stdout.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:19 +0000 (23:03 +0100)]
tplink-safeloader: don't end-pad sysupgrade file
To ensure the stock rootfs ends up at the correct offset, the preceding
kernel partition is padded with 0xff, corresponding to erased flash.
Since on sysupgrade all the required flash space is anyway rased before
writing the new image, it is not necessary to also pad after the second
and last part of the generated image. This can reduce the generated
image size by several MiB.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:18 +0000 (23:03 +0100)]
tplink-safeloader: stop at nameless partition
Current code only skips all-zero partition table entries, but nameless
partitions with zero size don't make much sense either. Assume that any
entry without a partition name is invalid, and stop processing entry
lists at that point.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:17 +0000 (23:03 +0100)]
tplink-safeloader: replace hardcoded offsets
A number of data offsets are used as plain numbers throughout the code.
This is a bit fragile, and the magic numbers make the code harder to
read. Use a set of macros instead.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:16 +0000 (23:03 +0100)]
tplink-safeloader: use enum for table types
The partition table parser supports two table types, which only differ
in the starting ID of a table entry. Selection of which type to parse is
performed with a plain integer, but this makes code harder to read.
Replace the integer by an enum to make type selection more obvious.
While touching the code, also fix the switch-case indentation.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Fri, 3 Feb 2023 22:03:15 +0000 (23:03 +0100)]
tplink-safeloader: stricter free_image_partition()
Instead of only free()-ing the allocated data block, also clear the name
and size of a payload entry to indicate that it's become invalid.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Mark Ceeha [Sun, 29 Jan 2023 14:28:42 +0000 (15:28 +0100)]
tplink-safeloader: Add support for Deco M4R V4
Software version:
soft_ver:1.0.0 Build
20211202 Rel. 69482
Partition table:
00000000 00040000 fs-uboot
00040000 00400000 os-image
00440000 00b60000 file-system
00fa0000 00000300 default-mac
00fa0300 00000100 device-id
00fa0400 0000fc00 product-info
00fb0000 00004000 group-info
00fb4000 0000c000 user-config
00fc0000 00010000 device-config
00fd0000 00010000 default-config
00fe0000 00000800 partition-table
00fe0800 00000100 soft-version
00fe0900 00000200 support-list
00fe0b00 00003000 profile
00fe3b00 00000100 extra-para
00ff0000 00010000 radio
`os-image` and `file-system` have been merged into `firmware`.
Signed-off-by: Mark Ceeha <hi@shiz.me>
Andrew Cameron [Wed, 9 Nov 2022 13:23:01 +0000 (13:23 +0000)]
tplink-safeloader: add TP-Link CPE605 v1 Support
Enable creating images compatible with the TP-Link CPE605 v1 Router
Original partitions from stock firmware are:
partition fs-uboot base 0x00000 size 0x20000
partition partition-table base 0x20000 size 0x02000
partition default-mac base 0x30000 size 0x00020
partition serial-number base 0x30100 size 0x00020
partition product-info base 0x31100 size 0x00100
partition device-info base 0x31400 size 0x00400
partition signature base 0x32000 size 0x00400
partition device-id base 0x33000 size 0x00100
partition os-image base 0x40000 size 0x170000
partition soft-version base 0x1b0000 size 0x00100
partition support-list base 0x1b1000 size 0x01000
partition file-system base 0x1c0000 size 0x600000
partition user-config base 0x7c0000 size 0x10000
partition default-config base 0x7d0000 size 0x10000
partition log base 0x7e0000 size 0x10000
partition radio base 0x7f0000 size 0x10000
The 'soft-version' and 'support-list' partitions are relocated afther the
'file-system' partition. This creates ones contiguous firmware area,
allowing for dynamic partition splitting.
Tested by forum user ruildias
Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[add original partition overview and note on relocation commit message,
update support_list and part_trail properties to match vendor FW]
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Yoonji Park [Sat, 4 Jun 2022 09:08:07 +0000 (09:08 +0000)]
iptime-crc32: add support for A6004MX
Add support for A6004MX image creation.
Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
Nick French [Sat, 13 Aug 2022 18:51:52 +0000 (13:51 -0500)]
tplink-safeloader: add TP-Link Deco S4 v2 support
Support creating images for TP-Link Deco S4R v2.
Original partition layout from OEM image:
partition fs-uboot base 0x00000 size 0x80000
partition product-info base 0x80000 size 0x05000
partition default-mac base 0x85000 size 0x01000
partition device-id base 0x86000 size 0x01000
partition support-list base 0x87000 size 0x10000
partition user-config base 0xa7000 size 0x10000
partition device-config base 0xb7000 size 0x10000
partition group-info base 0xc7000 size 0x10000
partition partition-table base 0xd7000 size 0x02000
partition soft-version base 0xd9000 size 0x10000
partition profile base 0xe9000 size 0x10000
partition default-config base 0xf9000 size 0x10000
partition url-sig base 0x1e0000 size 0x10000
partition radio base 0x1f0000 size 0x10000
partition os-image base 0x200000 size 0x200000
partition file-system base 0x400000 size 0xc00000
The 'os-image' and 'file-system' partitions were merged into 'firmware'
to make use of the automatic mtd split.
Signed-off-by: Nick French <nickfrench@gmail.com>
Jan Hoffmann [Wed, 27 Jul 2022 19:31:44 +0000 (21:31 +0200)]
mkh3cvfs: add filesystem tool for H3C devices
The bootloader can only boot images from a custom filesystem which
normally spans most of the flash on the device. This tool creates a
filesystem image containing a single file (which should be a firmware
image created using mkh3cimg).
The size of the filesystem is hardcoded in the bootloader. However, an
image that is only slightly larger than its content is sufficient, as
long as no write operations are performed in the bootloader menu. This
allows to append further data (i.e. rootfs) after the end of the
filesystem image.
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Jan Hoffmann [Wed, 27 Jul 2022 19:31:43 +0000 (21:31 +0200)]
mkh3cimg: add image tool for H3C devices
Firmware images for these devices can contain multiple files, such as
application files or bootloader images. This tool only creates images
with a single application file. In the case of OpenWrt, this is going
to contain the kernel image.
Compressed files are supported by the image format, in this case the
supplied input file needs to be a 7z archive with LZMA compression.
Signed-off-by: Jan Hoffmann <jan@3e8.eu>
André Valentin [Fri, 17 Jun 2022 18:26:27 +0000 (20:26 +0200)]
firmware-utils: Add support for ZyXEL LTE3301-Plus
Add header mapping for ZyXEL LTE3301-Plus to zytrx.
Signed-off-by: André Valentin <avalentin@marcant.net>
Sander Vanheule [Mon, 27 Jun 2022 16:31:24 +0000 (18:31 +0200)]
tplink-safeloader: drop unqualified EAP225-V3 IDs
After adding the regionless identifiers in commit
9563fe8e78cb
("tplink-safeloader: add regionless EAP225-V3 IDs"), the generated
support-list partition exceeded the allocated space of 256 bytes. This
resulted in the tool failing to generate factory images with the
following warning:
support-list partition too big (more than 256 bytes): Success
Although this message reports "Success", the tool actually fails with a
return code of 1.
This essentialy reverts commit
9563fe8e78cb, since the region-qualified
IDs are also compatible with the non region-qualified devices. The
change makes the generated support-list partition fit within the
allocated space again.
Tested-by: Andre Klärner <kandre@ak-online.be>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Sun, 26 Jun 2022 14:43:07 +0000 (16:43 +0200)]
tplink-safeloader: fix EAP225-Outdoor model IDs
The model IDs for EAP225-Outdoor v1 and EAP225-Outdoor v3 contain
"AC1200". The corresponding identifiers grouped under EAP225-V3 contain
"AC1350" however, which is a copy-paste error from the EAP225 v3/v3.2/v4
IDs. Modify the strings in SupportList to actually match the ones on devices.
Fixes: 9563fe8e78cb ("tplink-safeloader: add regionless EAP225-V3 IDs")
Fixes: 365458e00ed7 ("tplink-safeloader: join EAP225-V3 compatible devices")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Sun, 26 Jun 2022 14:30:34 +0000 (16:30 +0200)]
tplink-safeloader: add regionless EAP225-V3 IDs
Devices whose model ID does not contain a region identifier will not
match the "CA" and "CA,JP" qualified model IDs in the current EAP225-V3
SupportList. This results in the stock firmware giving the following
error when trying to flash a factory image:
Upgrade failed because the firmware is incompatible
Add the IDs without region qualifiers to also support these devices.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Yoonji Park [Sat, 4 Jun 2022 10:50:57 +0000 (10:50 +0000)]
tplink-safeloader: Add support for Mercusys MR70X
Add support for Mercusys MR70X image creation.
Software version:
soft_ver:1.0.3 Build
20201222 Rel. 50381
Partition table:
00000000 00040000 fs-uboot
00040000 00400000 os-image
00440000 00b60000 file-system
00fa0000 00000200 default-mac
00fa0200 00000100 pin
00fa0300 00000100 device-id
00fa0400 0000fc00 product-info
00fb0000 00008000 default-config
00fb8000 00008000 ap-def-config
00fc0000 0000c000 user-config
00fcc000 00004000 certificate
00fd0000 00008000 ap-config
00fd8000 00008000 router-config
00fe0000 00000800 partition-table
00fe0800 00000100 soft-version
00fe0900 00000200 support-list
00fe0b00 00003000 profile
00fe3b00 00000100 extra-para
00ff0000 00010000 radio
os-image and file-system is merged for dynamic split.
Signed-off-by: Yoonji Park <koreapyj@dcmys.kr>
Sander Vanheule [Thu, 26 May 2022 07:11:29 +0000 (09:11 +0200)]
tplink-safeloader: join EAP225-V3 compatible devices
Since FW v5.0.0, TP-Link has provided unified firmware images for
EAP225-v3 and EAP225-Outdoor-v1 devices. Although there may be hardware
differences, the relevant details for image generation are identical.
More recently, the following devices have also been added to the support
list:
- EAP225-v3.20
- EAP225-Outdoor-v3
- EAP225-v4
The country codes appended the device descriptors were introduced with
FW v5.0.7: "Combined firmware versions for different countries/regions."
The release notes provide no further upgrade instructions, so these
firmware images should be backwards compatible.
Add the new compatible devices, with region codes, to the support list
of the EAP225-V3 board ID. The now redundant EAP225-OUTDOOR-V1 ID will
be dropped later.
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Thu, 26 May 2022 07:00:08 +0000 (09:00 +0200)]
tplink-safeloader: fix chunked support-list prints
When reading long support-list partitions, to print out as image info,
the string is read in chunks of 128 bytes. However, in cases where there
is more than one chunk, they are not properly terminated. This leads to
an out-of-bounds access by puts() printing the buffer chunks.
Ensure the read partial string is always NULL terminated, and print
chunk by chunk without extra line terminations. Terminate still with a
newline to maintain current behaviour.
Fixes: e1d76f4e8721 ("firmware-utils: tplink-safeloader: support displaying fw info")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Ole Kristian Lona [Mon, 16 May 2022 13:50:06 +0000 (15:50 +0200)]
tplink-safeloader: Patch to handle partitions with alternate names.
Some devices, specifically Deco M4R-v3 / M5 have partition names that
deviate from the scheme other devices use. They have an added "@0"
and "@1" for some partition names.
The devices have fallback partitions which will be used in case the
device determines that the primary partition set is unbootable.
This patch introduces an option to set these alternate partition names
in the device definition of tplink-safeloader.
Signed-off-by: Ole Kristian Lona <oklo@oklona.net>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
Stijn Segers [Sun, 8 May 2022 11:31:12 +0000 (13:31 +0200)]
firmware-utils: tplink-safeloader: add support for Archer A6 v2 (EU)
The Archer A6 v2 (EU) matches the C6 v2 (EU) and uses the same firmware ID.
See also https://forum.openwrt.org/t/tp-link-archer-a6-v2-0-cannot-install/119403/34.
Tested-by: Kamil Jońca <kjonca@poczta.onet.pl>
Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Sander Vanheule [Fri, 29 Apr 2022 18:19:36 +0000 (20:19 +0200)]
tplink-safeloader: fix alphabetical order
DECO-M4R-V1 was added after EAP615-WALL, but that's not how the alphabet
is sorted. Move it in between 'ARCHER' and 'EAP'.
Reported-by: Ole Kristian Lona <ole.kristian@lona.name>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Sander Vanheule [Sun, 20 Mar 2022 11:55:14 +0000 (12:55 +0100)]
tplink-safeloader: add TP-Link EAP265 HD support
The FCC ID request for this device indicates that the hardware is
identical to the EAP245v3. Since FW 5.0.0, TP-Link provides unified
images for both devices.
Partial output of 'tplink-safeloader -i':
[Software version]
Version: 5.0.4
Date: 2021-10-21
Revision: 57494
[Support list]
SupportList:
EAP245(TP-Link|UN|AC1750-D):3.0
EAP265 HD(TP-Link|UN|AC1750-D):1.0
Link: https://fccid.io/TE7EAP265HD/Letter/6-Request-for-FCC-Change-ID-4823578.pdf
Signed-off-by: Sander Vanheule <sander@svanheule.net>
Foica David [Sun, 24 Apr 2022 16:09:51 +0000 (19:09 +0300)]
tplink-safeloader: add TP-Link Deco M4R v1 and v2 support
Support creating images for TP-Link Deco M4R v1 and v2.
Original partition layout from OEM image:
partition fs-uboot base 0x00000 size 0x80000
partition os-image base 0x80000 size 0x200000
partition file-system base 0x280000 size 0xc00000
partition product-info base 0xe80000 size 0x05000
partition default-mac base 0xe85000 size 0x01000
partition device-id base 0xe86000 size 0x01000
partition support-list base 0xe87000 size 0x10000
partition user-config base 0xea7000 size 0x10000
partition device-config base 0xeb7000 size 0x10000
partition group-info base 0xec7000 size 0x10000
partition partition-table base 0xed7000 size 0x02000
partition soft-version base 0xed9000 size 0x10000
partition profile base 0xee9000 size 0x10000
partition default-config base 0xef9000 size 0x10000
partition url-sig base 0xfe0000 size 0x10000
partition radio base 0xff0000 size 0x10000
The 'os-image' and 'file-system' partitions were merged into 'firmware'
to make use of the automatic mtd split.
The first 2 versions of the device use the same firmware image,
v3 and v4 are different.
Signed-off-by: Foica David <superh552@gmail.com>
Marcin Gordziejewski [Thu, 7 Apr 2022 18:43:25 +0000 (20:43 +0200)]
tplink-safeloader: TP-Link RE650 v2 support
Support creating images for TP-Link RE650 v2.
Partition table pulled from OEM firmware on the device:
partition fs-uboot base 0x00000 size 0x20000
partition os-image base 0x20000 size 0x330000
partition file-system base 0x350000 size 0x470000
partition partition-table base 0x7c0000 size 0x02000
partition default-mac base 0x7c2000 size 0x00020
partition pin base 0x7c2100 size 0x00020
partition product-info base 0x7c3100 size 0x01000
partition soft-version base 0x7c4200 size 0x01000
partition support-list base 0x7c5200 size 0x01000
partition profile base 0x7c6200 size 0x08000
partition config-info base 0x7ce200 size 0x00400
partition user-config base 0x7d0000 size 0x10000
partition default-config base 0x7e0000 size 0x10000
partition radio base 0x7f0000 size 0x10000
One notable difference from v1 in terms of safeloader, is that it requires
soft_ver to be defined for device to accept the firmware, otherwise it
otherwise it denies the firmware file. Version v1 has also 16MB of Flash
instead of 8MB that v2 has, so the paritions had to be shrinked
accordingly.
In OpenWRT "firmware" partition is merged into one, it's made out of
os-image and file-system partitions.
Signed-off-by: Marcin Gordziejewski <openwrt@flicksfix.com>
Rosen Penev [Mon, 28 Feb 2022 07:34:26 +0000 (23:34 -0800)]
firmware-utils: fix compilation with macOS
__bswap_32 is a GNU extension.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Acked-by: Paul Spooren <mail@aparcar.org>
Piotr Dymacz [Sat, 26 Feb 2022 22:54:03 +0000 (23:54 +0100)]
tplink-safeloader: add TP-Link Archer A9 v6 support
Support creating images compatible with TP-Link Archer A9 v6.
Original partition layout:
partition factory-boot base 0x00000 size 0x20000
partition fs-uboot base 0x20000 size 0x20000
partition partition-table base 0x40000 size 0x10000
partition radio base 0x50000 size 0x10000
partition default-mac base 0x60000 size 0x00200
partition pin base 0x60200 size 0x00200
partition device-id base 0x60400 size 0x00100
partition product-info base 0x60500 size 0x0fb00
partition soft-version base 0x70000 size 0x01000
partition extra-para base 0x71000 size 0x01000
partition support-list base 0x72000 size 0x0a000
partition profile base 0x7c000 size 0x04000
partition user-config base 0x80000 size 0x10000
partition ap-config base 0x90000 size 0x10000
partition apdef-config base 0xa0000 size 0x10000
partition router-config base 0xb0000 size 0x10000
partition os-image base 0xc0000 size 0x120000
partition file-system base 0x1e0000 size 0xde0000
partition log base 0xfc0000 size 0x20000
partition certificate base 0xfe0000 size 0x10000
partition default-config base 0xff0000 size 0x10000
To make use of automatic mtd split, the 'os-image' and 'file-system'
partitions were merged into 'firmware' for OpenWrt.
There are only 3 official vendor's firmware releases for this device,
all were successfully tested for migration to OpenWrt:
1.1.1 Build
20210315 rel.40637
1.0.6 Build
20200114 rel.73164
1.0.3 Build
20190226 rel.62939
According to the 'SupportList' from vendor's latest firmware release,
this hardware might be also available under name 'Archer C90 v6',
probably dedicated for US market:
SupportList:
{product_name:Archer A9,product_ver:6.0,special_id:
55530000}
{product_name:Archer A9,product_ver:6.0,special_id:
45550000}
{product_name:Archer A9,product_ver:6.0,special_id:
52550000}
{product_name:Archer A9,product_ver:6.0,special_id:
4A500000}
{product_name:Archer C90,product_ver:6.0,special_id:
55530000}
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Joe Mullally [Tue, 22 Feb 2022 23:59:51 +0000 (23:59 +0000)]
tplink-safeloader: add TL-WPA8631P v3 support
Enable creating images compatible with TP-Link's TL-WPA8631P powerline router.
This matches all current firmwares for all revisions and regions.
Users with older EU "Build
20200314 Rel.3608" & EU "Build
20200508 Rel.41814"
should first upgrade to EU "Build
20200927 Rel.61199" or later before flashing.
The original partition layout is as follows:
partition fs-uboot base 0x00000 size 0x20000
partition os-image base 0x20000 size 0x330000
partition file-system base 0x350000 size 0x3e0000
partition partition-table base 0x730000 size 0x02000
partition default-mac base 0x732000 size 0x00020
partition pin base 0x732100 size 0x00020
partition device-id base 0x732200 size 0x00030
partition default-region base 0x732300 size 0x00010
partition product-info base 0x732400 size 0x00200
partition extra-para base 0x732600 size 0x00200
partition soft-version base 0x732800 size 0x00200
partition support-list base 0x732a00 size 0x00100
partition profile base 0x732b00 size 0x00100
partition default-config base 0x732c00 size 0x00800
partition plc-type base 0x733400 size 0x00020
partition default-pib base 0x733500 size 0x06000
partition user-config base 0x740000 size 0x10000
partition plc-pib base 0x750000 size 0x10000
partition plc-nvm base 0x760000 size 0x90000
partition radio base 0x7f0000 size 0x10000
For OpenWrt, the os-image and file-system partition are merged into one
firmware partition, to enable dynamic rootfs partition splits.
Review of partitions in all known firmwares. This patch supports
layout md5sum
0771948573fffa726b8927ca6259ea16.
filename
grep -ao "partition .*$" filename | md5sum
support_list
wpa8631pv3_eu-up-ver3-0-0-P1-
20200314-rel3608.bin
33df2a8474670e785fb487dc9392dadf
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
45550000}
wpa8631pv3_eu-up-ver3-0-0-P1-
20200508-rel41814-APPLC.bin
68f3408ac2310e81fead071be4238aa9
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
45550000}
wpa8631pv3_us-up-ver3-0-0-P1-
20200820-rel39000-APPLC.bin
0771948573fffa726b8927ca6259ea16
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
55530000}
wpa8631pv3_eu-up-ver3-0-0-P1-
20200927-rel61199-APPLC.bin
0771948573fffa726b8927ca6259ea16
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
45550000}
wpa8631pv3_eu-up-ver3-0-0-P1-
20210514-rel45003-APPLC.bin
0771948573fffa726b8927ca6259ea16
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
45550000}
wpa8631pv3_us-up-ver3-0-0-P1-
20210625-rel35759-APPLC.bin
0771948573fffa726b8927ca6259ea16
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
55530000}
wpa8631pv3_au-up-ver3-0-0-P1-
20210625-rel42417-APPLC.bin
0771948573fffa726b8927ca6259ea16
{product_name:TL-WPA8631P,product_ver:3.0.0,special_id:
41550000}
Signed-off-by: Joe Mullally <jwmullally@gmail.com>
[pepe2k@gmail.com: added 'TL-' prefix in model name, in commit desc]
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
Stijn Tintel [Thu, 27 Jan 2022 09:35:54 +0000 (11:35 +0200)]
tplink-safeloader: TP-Link EAP615-Wall v1 support
Support creating images for the TP-Link EAP615-Wall v1.
Original partition layout:
partition fs-uboot base 0x00000 size 0x80000
partition partition-table base 0x80000 size 0x02000
partition default-mac base 0x90000 size 0x01000
partition support-list base 0x91000 size 0x00100
partition product-info base 0x91100 size 0x00400
partition soft-version base 0x92000 size 0x00100
partition os-image base 0xa0000 size 0x380000
partition file-system base 0x420000 size 0x970000
partition user-config base 0xd90000 size 0x60000
partition mutil-log base 0xf30000 size 0x80000
partition oops base 0xfb0000 size 0x40000
partition radio base 0xff0000 size 0x10000
In OpenWrt, the os-image and file-system partitions are merged into a
single firmware partition.
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Reviewed-by: Sander Vanheule <sander@svanheule.net>
Kim Namu [Wed, 9 Feb 2022 14:43:28 +0000 (23:43 +0900)]
iptime-crc32: add support for AX8004M
This commit is preparations for adding support for device AX8004M
similar to AX2004M.
Signed-off-by: Kim Namu <namu@theseed.io>
Daniel Kestrel [Mon, 17 Jan 2022 08:36:29 +0000 (09:36 +0100)]
firmware-utils: support checksum for AVM fritzbox wasp SOCs
This patch adds creating the checksum to be able to create an
image and boot the secondary ath79 based wireless assist (WASP)
SoC with a second instance of OpenWrt for some AVM Fritzbox
devices (3390, 3490, 5490, 7490).
The utility is called avm-wasp-checksum and was originally
created by Andreas Boehler.
Signed-off-by: Daniel Kestrel <kestrel1974@t-online.de>
João Orui [Thu, 3 Feb 2022 15:30:28 +0000 (00:30 +0900)]
tplink-safeloader: support for Archer A6 v3 JP
Add the missing tp-link firmware ID for the TP-Link Archer A6 v3 (JP)
Signed-off-by: João Orui <joao@joao.jp>
Sungbo Eo [Tue, 4 Jan 2022 14:47:27 +0000 (23:47 +0900)]
iptime-crc32: add image header tool for new ipTIME models
Some ipTIME models (e.g. A8004T-XR) started to use a new 56-byte header
format which uses accumulated CRC-32 for its checksum algorithm. This tool
helps to pass through the factory image verification process on the
applicable models.
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Sungbo Eo [Sat, 1 Jan 2022 08:03:35 +0000 (17:03 +0900)]
iptime-naspkg: add image header tool for ipTIME NAS series
The purpose of this tool is to pass the factory image verification process,
and it does not provide a full image with kernel and rootfs. The tool prepends
a factory header to kernel image, and rootfs should be appended separately.
This tool has been developed and tested on NAS1 and NAS1dual, but it can
also be used on other similar models with additional tweaking.
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
Brian Norris [Sun, 16 Jan 2022 05:48:31 +0000 (21:48 -0800)]
cros-vbutil: add Chrome OS vboot kernel-signing utility
Chrom{ium,e} OS based devices use a Coreboot+Depthcharge-based firmware,
which verifies and loads a kernel packed in a verified-boot payload. The
verification tooling (both for creating and verifying payloads) is
implemented here:
https://chromium.googlesource.com/chromiumos/platform/vboot_reference
Devices running such bootloaders also tend to support a "developer
mode," where a device can be unlocked to run arbitrary kernel payloads,
using the same verified-boot format plus well-known developer keys. More
information can be found here:
https://chromium.googlesource.com/chromiumos/docs/+/master/developer_mode.md
Rather than build and package the vboot_reference utilities as part of
the base OpenWRT tools, I chose to reimplement just the portion that's
required for signing payloads. I also embed the developer key directly
in the source for convenience, though it's certainly possible to
provide other keys too, if one were to build their own firmware that
accepts it.
This tool is essentially the same as running something like this, using
the Chromium OS tooling:
vbutil_kernel --pack kernel_partition.bin \
--keyblock /usr/share/vboot/devkeys/kernel.keyblock \
--signprivate /usr/share/vboot/devkeys/kernel_data_key.vbprivk \
--version 1 \
--vmlinuz kernel.bin \
--bootloader zero.txt \
--config commnad_line.txt \
--arch ${ARCH}
I have also packaged the Chromium OS vboot_reference tooling for the
packages feed, as it can be useful beyond simply creating a bootable
image (e.g., manipulating Chromium OS specific GPT attributes, handling
other NVRAM attributes, vboot packing/unpacking/verifying):
https://github.com/openwrt/packages/pull/12829
The vboot_reference tools are released by Google under a BSD 3-clause
license. I've provided the original license text as well as a GPL-2
notice for my modifications (essentially just borrowing the data
structures and rewriting everything else).
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Brian Norris [Sun, 16 Jan 2022 05:48:30 +0000 (21:48 -0800)]
ptgen: add Chromium OS kernel partition support
Chrom{ium,e} OS (shortened as "CrOS") bootloaders use a custom GPT
partition type to locate their kernel(s), with custom attributes for
noting properties around which partition(s) should be active and how
many times they've been tried as part of their A/B in-place upgrade
system.
OpenWRT doesn't use A/B updates for upgrades (instead, just shutting
things down far enough to reprogram the necessary partitions), so all we
need to do is tell the bootloader which one is the kernel partition, and
how to use it (i.e., set the "successful" and "priority" attributes).
ptgen already supports some basic GPT partition creation, so just
add support for a '-T <GPT partition type>' argument. Currently, this
only supports '-T cros_kernel', but it could be extended if there are
other GPT partition types needed.
For GPT attribute and GUID definitions, see the CrOS verified boot
sources:
https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/refs/heads/master/firmware/lib/cgptlib/include/cgptlib_internal.h
https://chromium.googlesource.com/chromiumos/platform/vboot_reference/+/refs/heads/master/firmware/include/gpt.h
Wikipedia (!!) even notes the GUIDs:
https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
The GUID is also recognized in fdisk, and likely other utilities, but
creation/manipulation is typically done via the 'cgpt' utility, provided
as part of the Chromium vboot_reference project.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Henrique de Moraes Holschuh [Wed, 8 Dec 2021 13:14:57 +0000 (10:14 -0300)]
tplink-safeloader: support Archer C6v3.0 (BR)
Add the missing tp-link firmware ID for the TP-Link Archer C6v3.0 (BR),
which is currently sold in Brazil. It uses exactly the same vendor
firmware as the A6v3 and C6v3.20.
Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
Matthias Schiffer [Fri, 14 Jan 2022 22:08:49 +0000 (23:08 +0100)]
tplink-safeloader: fix Archer A7v5 factory flashing from vendor fw > v1.1.x
Apply the same fix that was previously done for the Archer C7v5 to the
A7v5 as well to make the web UI accept our images again.
Tested-by: Luflosi <luflosi@luflosi.de>
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Rafał Miłecki [Sat, 27 Nov 2021 15:31:04 +0000 (16:31 +0100)]
otrx: support TRX from stdin when extracting
It allows e.g.
dd if=firmware.chk skip=1 bs=58 | otrx extract - -1 kernel.bin
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Sat, 27 Nov 2021 15:31:03 +0000 (16:31 +0100)]
otrx: support unsorted partitions offsets
TRX format doesn't guarantee that it contains partitions offsets in a
sorted order. Store partitions info in context struct and make sure it's
sorted.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Rafał Miłecki [Sat, 27 Nov 2021 15:31:02 +0000 (16:31 +0100)]
otrx: extract shared code opening & parsing TRX format
This avoids some code duplication.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>