Commit Graph

343 Commits

Author SHA1 Message Date
Mathias Kresin 6c03b293bb firmware-utils: fix dgn3500sum compiler warnings
The sum variable need to be initialised, otherwise it will points to
random stack memory and a bogus image checksum might be calculated.

While at it, fix the segfault in case the product region code isn't
specified and enable compiler warnings which had revealed all the code
issues.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2017-06-26 20:11:16 +02:00
Rafał Miłecki dfe2cea9cd firmware-utils: tplink-safeloader: add support for Archer C5 V2
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2017-05-22 11:38:03 +02:00
Matthias Schiffer 2ee3e8dd42
firmware-utils: tplink-safeloader: add support for TP-Link WBS210/510 1.2
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-01-05 16:01:17 +01:00
Henryk Heisig c8043137bb ramips: Add support to TP-Link Archer MR200
CPU: MT7620N 580MHz
Flash: 8MB
RAM: 64MB
build-in modem 3G/4G
four ethernet port 10/100Mbps

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
2016-12-22 15:03:30 +01:00
Radek Dostál 5515edae9f firmware-utils/tplink-safeloader: add support for TP-Link RE450
Signed-off-by: Radek Dostál <rd@radekdostal.com>
[Jo-Philipp Wich: use .support_trail member]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-12-22 14:50:05 +01:00
Tal Keren 0d9d980ecd firmware-utils: kernel image generator for TP-Link RE450
The firmware image that is used in TP-Link RE450 (and some more devices from
the RE series) is tplink-safeloader.
In the kernel partition, the kernel is compressed in a regular tp-link
firmware that is just used for booting. Since it is only used for compressing
and booting, only four fields are filled in the header:
Vendor, version, kernel load address and kernel entry point.
mktplinkfw-kernel is a simpler version of mktpolinkfw that generate such
images. It also specifies the hardware id (as it is in the product info
section), so when doing a sysupgrade - the existing code will check for
hardware compatibility.

Signed-off-by: Tal Keren <kooolk@gmail.com>
[rd@radekdostal.com: add build target to .../image/tp-link.mk]
Signed-off-by: Radek Dostál <rd@radekdostal.com>
2016-12-22 14:50:05 +01:00
Matthias Schiffer 51740990cd
firmware-utils: add support for TL-WR1043ND v4 to mktplinkfw and tplink-safeloader
The TL-WR1043ND v4 uses a kernel image with a mktplinkfw header inside the
os-image partition of a tplink-safeloader image.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-12-20 14:38:48 +01:00
Jo-Philipp Wich fff6443b5b
firmware-utils/tplink-safeloader: refactor code for further board support
In order to make it easier to add new boards in the future, refactor the code
to describe the image layouts of supported boards in a struct array and alter
the image generation routines to figure out the sysupgrade partitions
automatically.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-12-20 14:38:48 +01:00
Jo-Philipp Wich d58e8a9076
firmware-utils/tplink-safeloader: make vendor data optional
Restructure the code a bit to allow for omitting vendor data when generating
factory images.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-12-20 14:38:47 +01:00
Jo-Philipp Wich 38ebd1d133 firmware-utils: add E2100L support to addpattern.c
Based on OpenWrt PR#250

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-12-14 18:42:48 +01:00
Matthias Schiffer d1a2c3f9b1
firmware-utils: tplink-safeloader: update support lists for CPE210/510/...
Adds support for new EU and US variants; removes a few strings that were
never actually used and have been removed from the stock firmwares.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-12-12 13:46:58 +01:00
Rafał Miłecki cb7ab730c7 firmware-utils: replace md5 code with Alexander Peslyak's implementation
Our current implementation is pretty old and uses some pre-standard/old
ANSI C style that triggers warnings like:
warning: call to function 'MD5_Init' without a real prototype [-Wunprototyped-calls]

This is caused by declarations specified in a following way:
src/md5.h:60:6: note: 'MD5_Init' was declared here
 void MD5_Init ();

Having these warnings makes it harded to notice real problems. We could
try hiding them but it makes more sense to just use a cleaner code.
Another tiny gain from this switch is slightly reduced binary size, on
x86_64 tplink-safeloader's size 48104 became 48003.

The new code is public domain, uses "heavily cut-down BSD license".

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-28 07:52:31 +01:00
Florian Fainelli 97eff5cba5 firmware-utils: Fix build failure in mkmerakifw.c FS#298
Earlier compilers such as GCC 4 do not like anynomous unions, make it a named
union "u", and update the code where relevant.

Fixes FS#298
Fixes: a72e1692b8 ("firmware-utils: Add support for the Cisco Meraki MX60/MX60W")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-11-26 22:39:27 +01:00
Chris Blake a72e1692b8 firmware-utils: Add support for the Cisco Meraki MX60/MX60W
This patch adds header support for the Cisco Meraki MX60/MX60W, which
are a part of the apm821xx target. Some structure changes were needed
due to the fact this device uses U-Boot (unlike other devices in
mkmerakifw.c) which uses a different header structure to define the load
offsets for the image.

A thanks to Christian for helping implement this properly.

Cc: Christian Lamparter <chunkeey@gmail.com>

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
2016-11-21 11:09:03 +01:00
Rafał Miłecki 0d3be662ce firmware-utils: tplink-safeloader: keep per-device info on trailing char
Recent refactoring introduced a regression. It ignored second argument
of make_support_list function which was originally true for C2600. The
new generic build_image function always passes false.

This patch allows specifying trailing char in a device specific info. It
also switches Archer C9 to the \0 char to make it compliant with vendor
images.

I verified generated images to be binary identical to the ones that
were created before whole refactoring.

Reported-by: Jo-Philipp Wich <jo@mein.io>
Fixes: fd924d2068 ("firmware-utils: tplink-safeloader: use one function for generating images")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-20 17:17:48 +01:00
Rafał Miłecki 222783c65c firmware-utils: tplink-safeloader: add Archer C9 support
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-19 07:58:25 +01:00
Rafał Miłecki fd924d2068 firmware-utils: tplink-safeloader: use one function for generating images
Thanks to the struct device_info we can now use one unified function.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-19 07:57:58 +01:00
Rafał Miłecki ea249f01b1 firmware-utils: tplink-safeloader: add struct device_info
This struct stores all device specific info which allows making do_eap
function more generic.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2016-11-19 07:57:56 +01:00
Vitaly Chekryzhev a4814c744c firmware-utils: add tool to create zyxel images
Signed-off-by: Vitaly Chekryzhev <13hakta@gmail.com>
[moved to firmware-utils package]
[dropped the compiled binary]
Signed-off-by: Mathias Kresin <dev@kresin.me>
2016-11-17 20:01:21 +01:00
FUKAUMI Naoki 0165203304 ar71xx: add support for Buffalo BHR-4GRV2
Signed-off-by: FUKAUMI Naoki <naobsd@gmail.com>
2016-11-16 10:54:33 +01:00
Alexandru Ardelean 00d1e6c75e firmware-utils: fix compilation on MacOS X
Looking into /usr/include/stdlib.h, there's a `devname()` function defined
under some #ifdef's which conflicts with the `static char *devname` definition
in `src/mkwrggimg.c`.

Defining `_ANSI_SOURCE` in the `src/mkwrggimg.c` file, omits that part of the
header.

Another more intrusive approach is to rename `devname` to something like
`g_devname` in `src/mkwrggimg.c`. But I think the `_ANSI_SOURCE` define should
be enough.

Compilation error is:

    src/mkwrggimg.c:64:14: error: redefinition of 'devname' as different kind of symbol
    static char *devname;
                 ^
    /usr/include/stdlib.h:286:7: note: previous definition is here
    char    *devname(dev_t, mode_t);
             ^
    src/mkwrggimg.c:147:12: error: non-object type 'char *(dev_t, mode_t)' (aka 'char *(int, unsigned short)') is not assignable
                            devname = optarg;
                            ~~~~~~~ ^
    src/mkwrggimg.c:192:6: warning: comparison of function 'devname' equal to a null pointer is always false [-Wtautological-pointer-compare]
            if (devname == NULL) {
                ^~~~~~~    ~~~~
    src/mkwrggimg.c:192:6: note: prefix with the address-of operator to silence this warning
            if (devname == NULL) {
                ^
                &
    src/mkwrggimg.c:251:27: warning: incompatible pointer types passing 'char *(dev_t, mode_t)' (aka 'char *(int, unsigned short)') to parameter of type 'const char *' [-Wincompatible-pointer-types]
            strncpy(header->devname, devname, sizeof(header->devname));
                                     ^~~~~~~
    /usr/include/secure/_string.h:119:34: note: expanded from macro 'strncpy'
      __builtin___strncpy_chk (dest, src, len, __darwin_obsz (dest))

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
[Jo-Philipp Wich: slightly reformat commit message]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-10-31 12:39:09 +01:00
Stijn Tintel 55eb6ed061 firmware-utils: mkwrggimg: new tool for D-Link DAP-2695
Based on mkwrgimg.c.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: John Crispin <john@phrozen.org>
2016-10-27 01:50:42 +03:00
Henryk Heisig f5aa459043 ar71xx: Add support to TP-Link EAP120
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
2016-10-18 09:18:55 +02:00
Jonas Gorski 997fed94e3 ptgen: work around gcc miscompilation
Some gcc versions seem to miscompile code using ternary operators,
work around this by just returning the result if exp is 0.

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
2016-09-26 12:23:41 +02:00
Felix Fietkau 64568cac91 tools/firmware-utils: fix portability issue in mkmerakifw-old
Fixes build failure on Mac OS X

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-09-22 13:37:23 +02:00
Christian Lamparter 7219c30da4 firmware-utils mkmerakifw-old: firmware generator for Z1
This patch adds firmware generation tool for Cisco's Z1

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
2016-09-19 19:32:28 +02:00
Mathias Kresin 0ac50a661b firmware-utils: mksenaofw: rework option validation
The options firmware_type, vendor_id and product_id are not required
for decoding an image file.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2016-08-17 20:08:52 +02:00
Matthias Schiffer a4fc62bc0e
firmware-utils: mktplinkfw: add support for TP-Link's new region codes
TP-Link has changed the way the region is stored in the firmware header,
and now provides US- and EU-specific images for the Archer C7. Adding the
new region codes is necessary to make LEDE/OpenWrt flashable on devices
with the new stock firmwares again.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2016-08-28 19:59:21 +02:00
Chris Blake a57d6e2d47 apm821xx: add support for the Cisco Meraki MR24
This patch adds support for the Cisco Meraki MR24 Access point
to the apm821xx target.

Board:		MR24 - Meraki MR24 Cloud Managed Access Point
CPU:		APM82181 SoC 800 MHz (PLB=200 OPB=100 EBC=100)
Flash size:	32MiB
RAM Size:	128MiB
Wireless:	Atheros AR9380 5.0GHz + Atheros AR9380 2.4GHz
Ethernet ports:	1x Gigabit Atheros AR8035

WARNING: The serial port needs a TTL/RS-232 v3.3 level converter!

For flashing instructions, visit:
<https://github.com/riptidewave93/Openwrt-MR24/blob/master/README.md#flashing>

Signed-off-by: Chris Blake <chrisrblake93@gmail.com>
2016-07-22 09:48:12 +02:00
Rafał Miłecki f966ea2f49 firmware-utils: oseama: support extracting entity
This updates oseama in firmware-utils to the version from packages
keeping them synced.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2016-06-15 10:54:16 +02:00
Alexander Couzens 5a5934f0c2 tools/mkfwimage2: remove 256 length limit for partition images
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-06-14 22:13:37 -07:00
Henryk Heisig 6e0eccc5aa tools/firmware-utils: Add Archer C50 to mktplinkfw2
Signed-off-by: Henryk Heisig <hyniu@o2.pl>
2016-06-13 22:51:43 +02:00
Felix Fietkau 7eeb254cc4 treewide: replace nbd@openwrt.org with nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-06-07 08:58:42 +02:00
Alexander Couzens 8241479605 tools/tplink-safeloader: split CPE210 from CPE510 profile
The CPE210 was still described for the OEM upgrade as compatible,
even the wireless configuration isn't compatible anymore between
both series (2ghz and 5ghz).
Update the CPE210 image profile to use the new profile.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
2016-05-27 15:55:13 +02:00
Ash Benz 955c341d3b fw-utils/tplink-safeloader.c: Add support for Archer C2600
Signed-off-by: Ash Benz <ash.benz@bk.ru>
2016-05-27 15:50:17 +02:00
Felix Fietkau ac780e3ac8 tools/firmware-utils: remove obsolete firmware utility for airlink 525w
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-05-12 17:40:29 +02:00
John Crispin d35801b9c5 tools: firmware-utils: add region code support to mktplinkfw
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 49215
2016-04-21 19:47:15 +00:00
John Crispin 51b6448746 tools: firmware-utils: clean up mktplinkfw
Remove the whole board list from mktplinkfw, as OpenWrt doesn't use it and
it was severely out of sync with the list of built images for ar71xx.

Also:
* fix -Wall warnings
* add const where appropriate

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 49214
2016-04-21 19:47:12 +00:00
John Crispin 5f1a82ec4f ar71xx: add TP-Link TL-WA901ND-v4 support
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>

SVN-Revision: 49158
2016-04-09 10:26:46 +00:00
John Crispin 3fd98db818 ar71xx: Add support for the OMYlink OMY-X1
This patch adds support for the OMYlink OMY-X1

https://wiki.openwrt.org/toh/omylink/omy-x1

http://www.omylink.com/

Signed-off-by: L. D. Pinney <ldpinney@gmail.com>

SVN-Revision: 49026
2016-03-16 09:26:58 +00:00
John Crispin 4d97c8bab0 ramips: Add a tool to create JCG factory images
replace spaces with tabs

Signed-off-by: Reinhard Max <reinhard@m4x.de>

SVN-Revision: 48901
2016-03-04 08:32:54 +00:00
John Crispin 678dcef7a5 ramips: Add a tool to create JCG factory images
This tool creates factory images for JCG routers.
Details can be found in the header comment of jcgimage.c.

Signed-off-by: Reinhard Max <reinhard@m4x.de>
Reviewed-by: Torsten Duwe <duwe@lst.de>

SVN-Revision: 48888
2016-03-03 20:24:30 +00:00
Felix Fietkau 076d58d344 firmware-utils: mkfwimage: fix firmware_max_length for XM layout
The new u-boot version bundled with the 5.6.x firmwares from Ubiquiti gets
confused by the smaller rootfs partition size; this can lead to various
issues:

1. We've gotten reports that flashing from the 5.6.x stock firmware to
   OpenWrt will brick devices; I wasn't able to reproduce this myself
2. Flashing from 5.5.x stock firmware to OpenWrt and back to stock (via
   TFTP recovery), following by an update to 5.6.x via web interface can
   yield a bricked device with the following properties:
   - It can't be booted without entering commands over a serial console, as
     u-boot supplies the wrong MTD layout
   - The web interface won't accept any image with the original flash
     layout, so stock firmware upgrades are impossible
   - As the TFTP recovery doesn't update u-boot, returning to the old
     u-boot from firmware 5.5.x is impossible

To recover from 2., creating an OpenWrt image which doesn't set u-boot as
read-only and flashing a backup of the old u-boot from there is the only
way known to me. (Fixing the mtdparts variable in u-boot-env from OpenWrt
might also work; settings this from u-boot over serial didn't have
any permanent effect.)

Fix all of this by setting the correct flash layout also used by the stock
firmware. Flashing has been tested from both firmware 5.5.x and 5.6.x. The
fixed layout also matches the mtdparts defined by OpenWrt.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 48829
2016-02-29 20:11:33 +00:00
Felix Fietkau 619a58d641 ar71xx, firmware-utils: split ubdev01 flash layout from XM
The ubdev01 profile defines its own MTDPARTS with smaller firmware
partition, so give it its own UBNT_BOARD in mkfwimage.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 48828
2016-02-29 20:11:30 +00:00
Felix Fietkau bd93998df6 firmware-utils: mkfwimage: add -Wall, fix obvious bugs causing compile warnings
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>

SVN-Revision: 48827
2016-02-29 20:11:26 +00:00
John Crispin d6cb792d21 ar71xx: Added support for TL-WA801NDv3
Signed-off-by: Tiziano Bacocco <tizbac2@gmail.com>

SVN-Revision: 48705
2016-02-12 08:30:28 +00:00
Rafał Miłecki 590c7825c1 firmware-utils: add oseama tool for creating Seama entities
It has an important feature (compared to seama) of using multiple input
files, aligning them and padding zeroes until reaching a specified
absolute offset. This is needed for a proper flash layout on NAND. We
want kernel partition to be big enough to handle future updates without
a need to resize it and wipe whole "ubi" partition. It's important as
we don't want to lose block counters.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>

SVN-Revision: 48601
2016-02-01 12:42:00 +00:00
Hauke Mehrtens 13b8b8c2e7 lantiq: add support for TP-Link VR200v
This adds basic support for TP-Link VR200v.
Currently the following parts are not working: FXO, Voice, DECT, WIFI (both)

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

SVN-Revision: 48328
2016-01-18 20:40:03 +00:00
John Crispin 16317ceb4f firmware-utils: allow mkfwimage2 to use - in partition names
Signed-off-by: Roman Yeryomin <roman@advem.lv>

SVN-Revision: 47975
2015-12-23 14:43:47 +00:00
John Crispin 244173a093 firmware-utils: fix various compiler warnings
mostly implicit defines due to missing includes plus one const that
shouldn't be one.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>

SVN-Revision: 47865
2015-12-11 15:09:30 +00:00