Commit Graph

1459 Commits (3c77e4ae4d97ec14daeabfab12ec8b451184d0d6)

Author SHA1 Message Date
NOGUCHI Hiroshi a1c6a316d2 ramips: add support for Fon FON2601
FON2601 is a wireless router.

Specification:
- SoC: Mediatek MT7620A (580MHz)
- RAM: 128 MiB
- ROM: 16 MiB SPI Flash
- Wireless:
   for 11b/g/n (upto 300 Mbps):  MT7620A built-in WMAC
   for 11a/n/ac (upto 867 Mbps): MT7662E
- Ethernet LAN: 1 port, upto 100 Mbps
- Ethernet WAN: 1 port, upto 1000 Mbps
- USB: 1 port (USB 2.0 host)
- LEDs: 4 (all can be controlled by SoC's GPIO)
- buttons: 1 (Displayed as "WPS" on enclosure)
- serial port: 57600n8
 pins: Vcc(3.3V), Rx, Tx, GND
(left to right, viewed from outside of board)

Installation (only available via UART):
  1. download sysupgrade binary image by wget command
  2. write sysupgrade binary image to Flash
     command is:
       mtd write sysupgrade.bin firmware
  3. reboot

Important Notice:
  Only one button is displayed as "WPS" on enclosure.
  However, it is configured as "reset" (factory resetting feature).

Signed-off-by: NOGUCHI Hiroshi <drvlabo@gmail.com>
[removed unrelated openwrt-keyring revert, missing -Wall for uimage_padhdr]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 316c8b5503 tools/scons: switch to Python 3
Build tested on ath79 with following packages from packages feed which
build depends on scons. None of them build anymore as it seems, that the
SConscripts are written for Python2.

 * packages/net/iotivity (KO, doesn't build even with latest 1.3.1 release)

   SyntaxError: invalid syntax
    File "/openwrt/build_dir/target-mips_24kc_musl/iotivity-1.2.1/build_common/SConscript", line 40
      print "\nError: Current system (%s) isn't supported\n" % host

   LookupError: unknown encoding: string_escape:
    File "/home/petr/testing/openwrt/build_dir/target-mips_24kc_musl/iotivity-1.3.1/SConstruct", line 28:
      SConscript('build_common/SConscript')

 * packages/net/smartsnmpd (KO, seems dead, no commit since 2015):

   SyntaxError: Missing parentheses in call to 'print'
    File "/openwrt/build_dir/target-mips_24kc_musl/smartsnmpd-2014-08-13/SConstruct", line 156
      print "Can't find liblua or liblua5.1!"

 * packages/utils/gpsd (KO, doesn't build even with latest 3.18.1 release):

   AttributeError: 'list' object has no attribute 'keys':
     File "/openwrt/build_dir/target-mips_24kc_musl/gpsd-3.18.1/SConstruct", line 1758:
       all_manpages = list(base_manpages.keys()) + list(python_manpages.keys())

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 5989a75cc4 tools/b43-tools/b43-fwsquash: convert to Python 3 with 2-to-3
Let's convert the script to Python 3.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Hans Dedecker 1282a63027 tools: libressl: fix compilation for non-glibc clib (FS#2400)
Fixes compilaton issue for non glibc clibs :

libtool: compile:  gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" "-DPACKAGE_STRING=\"libressl 2.9.2\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_SYSLOG=1 -DHAVE_ACCEPT4=1 -DHAVE_PIPE2=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_EXPLICIT_BZERO=1 -DHAVE_GETAUXVAL=1 -DHAVE_GETAUXVAL=1 -DHAVE_DL_ITERATE_PHDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAS_GNU_WARNING_LONG=1 -DSIZEOF_TIME_T=8 -I. -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I../crypto/asn1 -I../crypto/bn -I../crypto/ec -I../crypto/ecdsa -I../crypto/evp -I../crypto/modes -I../crypto -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -D_DEFAULT_SOURCE -D_BSD_SOURCE -D_POSIX_SOURCE -D_GNU_SOURCE -D__STRICT_ALIGNMENT -O2 -I/builds/pantacor/pv-platforms/openwrt-base/openwrt/staging_dir/host/include -fpic -Wall -std=gnu99 -fno-strict-aliasing -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong -DHAVE_GNU_STACK -Wno-pointer-sign -MT compat/getprogname_linux.lo -MD -MP -MF compat/.deps/getprogname_linux.Tpo -c compat/getprogname_linux.c -o compat/getprogname_linux.o
compat/getprogname_linux.c: In function 'getprogname':
compat/getprogname_linux.c:32:2: error: #error "Cannot emulate getprogname"
 #error "Cannot emulate getprogname"
  ^~~~~

Reported-by: Anibal Portero <anibal.portero@pantacor.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Kevin Darbyshire-Bryant 8d6d227bb6 tools: libressl: fix build on MacOS
Making all in tests
depbase=`echo handshake_table.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
	gcc -DPACKAGE_NAME=\"libressl\" -DPACKAGE_TARNAME=\"libressl\" -DPACKAGE_VERSION=\"2.9.2\" -DPACKAGE_STRING=\"libressl\ 2.9.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"libressl\" -DVERSION=\"2.9.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DHAVE_SYMLINK=1 -DHAVE_ERR_H=1 -DHAVE_READPASSPHRASE_H=1 -DHAVE_ASPRINTF=1 -DHAVE_MEMMEM=1 -DHAVE_READPASSPHRASE=1 -DHAVE_STRLCAT=1 -DHAVE_STRLCPY=1 -DHAVE_STRNDUP=1 -DHAVE_STRNLEN=1 -DHAVE_STRSEP=1 -DHAVE_TIMEGM=1 -DHAVE_GETPROGNAME=1 -DHAVE_SYSLOG=1 -DHAVE_POLL=1 -DHAVE_SOCKETPAIR=1 -DHAVE_ARC4RANDOM=1 -DHAVE_ARC4RANDOM_BUF=1 -DHAVE_ARC4RANDOM_UNIFORM=1 -DHAVE_TIMINGSAFE_BCMP=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DSIZEOF_TIME_T=8 -I.  -I../include -I../include/compat -DLIBRESSL_INTERNAL -D__BEGIN_HIDDEN_DECLS= -D__END_HIDDEN_DECLS= -I ../crypto/modes -I ../crypto/asn1 -I ../ssl -I ../tls -I ../apps/openssl -I ../apps/openssl/compat -D_PATH_SSL_CA_FILE=\"../apps/openssl/cert.pem\" -I/Users/kevin/wrt/staging_dir/host/include  -D__STRICT_ALIGNMENT  -O2 -I/Users/kevin/wrt/staging_dir/host/include  -fpic -Wall -std=gnu99 -fno-strict-aliasing  -fno-strict-overflow -D_FORTIFY_SOURCE=2 -fstack-protector-strong  -Qunused-arguments -Wno-pointer-sign -MT handshake_table.o -MD -MP -MF $depbase.Tpo -c -o handshake_table.o handshake_table.c &&\
	mv -f $depbase.Tpo $depbase.Po
make[4]: *** No rule to make target `/Users/kevin/wrt/build_dir/host/libressl-2.9.2/crypto/.libs/libcrypto_la-cpuid-macosx-x86_64.o', needed by `handshake_table'.  Stop.
make[3]: *** [all-recursive] Error 1

A similar error & clues from
e783d60473

"
LibreSSL 2.9.1 now has a test that requires libtls.a, however, when building a
shared library only build, the --disable-static flag is passed to libressl,
which prevents the building of libtls.a.

With libtls.a not being built, the following error occurs:
libressl-2.9.1/tls/.libs/libtls.a', needed by 'handshake_table'.  Stop.

There are three options to fix this:
1) Stick with autotools, and provide a patch that removes building anything in
   the tests folder.
2) Pass --enable-static to LIBRESSL_CONF_OPTS
3) Change the package type to cmake, as a cmake build does not have this issue."

It appears we cannot change to cmake because cmake has a dependency on
an ssl library.

Take option 1 and do not build the tests.

Also take the opportunity to remove man page building as well.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Roman Yeryomin 3f1e8c0131 tools: libressl: update to 2.9.2 version
To keep in sync with OpenSSL 1.1.x branch version options.

Signed-off-by: Roman Yeryomin <roman@advem.lv>
5 years ago
Petr Štetiar ff7909f69e firmware-utils: mkfwimage: fix build failure on macOS with gcc 9
Fixes following errors:

 src/mkfwimage.c:279:8: error: format specifies type 'long' but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                      d->stats.st_size,
                     ^~~~~~~~~~~~~~~~
 src/mkfwimage.c:280:8: error: format specifies type 'long' but the argument has type 'long long' [-Werror,-Wformat]
                      d->partition_length - d->stats.st_size);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 src/mkfwimage.c:378:6: error: format specifies type 'unsigned long' but the argument has type 'long long' [-Werror,-Wformat]
                      d->stats.st_size - d->partition_length);
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reported-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 04cb651376 firmware-utils: mkfwimage: fix more errors reported by gcc-6/7/9
src/mkfwimage.c:276:8: error: format '%lld' expects argument of type 'long long int', but argument 4 has type '__off_t' {aka 'const long int'} [-Werror=format=]
src/fw.h:71:36: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__off_t' {aka 'long int'} [-Werror=format=]
    inlined from 'main' at src/mkfwimage.c:543:12:
/string_fortified.h:106:10: error: '__builtin_strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation]
    inlined from 'write_part' at src/mkfwimage.c:235:2,
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:477:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 256 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:496:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:481:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
    inlined from 'main' at src/mkfwimage.c:485:5:
string_fortified.h:106:10: error: '__builtin_strncpy' specified bound 16 equals destination size [-Werror=stringop-truncation]

Runtested on ath79 and UBNT Bullet M XW.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Kevin Darbyshire-Bryant 90b7dbf7d8 firmware-utils: mkfwimage: fix more errors
Fix 4 errors reported by gcc 9

3 mismatched format type errors
1 unused variable error

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Petr Štetiar 9401780c2c firmware-utils: mkfwimage: provide human readable error
While looking at the ath25 build breakage of 19.07 images today I've
encountered following error:

 mkfwimage -B XS5 -v [...] ath25-ubnt5-squashfs-sysupgrade.bin.new
 ERROR: Failed creating firmware layout description - error code: -2

Which is barely human readable and needs poking into the source code, so
this patch makes the error more verbose and usable by mere mortals.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Petr Štetiar 83e60f0df6 firmware-utils: mkfwimage: enable extra compiler checks and fix them
Let's enforce additional automatic checks enforced by the compiler in
order to catch possible errors during compilation.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Andrew Cameron cad4132e00 ath79: add support for TP-Link CPE510-v2/v3
TP-Link CPE510-v2/v3 is an outdoor wireless CPE for 5 GHz with
one Ethernet port based on Atheros AR9344

Specifications:
 - Based on the same underlying hardware as the TP-Link CPE510
 - Power, LAN, and 4 green LEDs
 - 1 10/100Mbps Shielded Ethernet Port (Passive PoE in)
 - Built-in 13dBi 2x2 dual-polarized directional MIMO antenna
 - Adjustable transmission power from 0 to 23dBm/200mw

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 4-5 seconds and release.
 Rename factory image to recovery.bin
 Stock TFTP server IP:192.168.0.100
 Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
[whitespace fixes]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Georgi Vlaev 8c51ddeff0 ramips: add support for TP-Link RE650 v1
TP-Link RE650 v1 is a dual-band AC2600 range extender,
based on MediaTek MT7621A and MT7615E. According to the
wikidevi entry for RE650 this device is identical with
TP-Link RE500 as hardware. This patch supports only RE650.

Hardware specification:

- SoC 880 MHz - MediaTek MT7621AT
- 128 MB of DDR3 RAM
- 16 MB - Winbond 25Q128FVSG
- 4T4R 2.4 GHz - MediaTek MT7615E
- 4T4R 5 GHz - MediaTek MT7615E
- 1x 1 Gbps Ethernet - MT7621AT integrated
- 7x LEDs (Power, 2G, 5G, WPS(x2), Lan(x2))
- 4x buttons (Reset, Power, WPS, LED)
- UART header (J1) - 2:GND, 3:RX, 4:TX
  Serial console @ 57600,8n1

Flash instructions:

Upload
openwrt-ramips-mt7621-tplink_re650-v1-squashfs-factory.bin
from the RE650 web interface.

TFTP recovery to stock firmware:

Unfortunately, I can't find an easy way to recover the RE
without opening the device and using modified binaries. The
TFTP upload will only work if selected from u-boot, which
means you have to open the device and attach to the serial
console. The TFTP update procedure does *not* accept the
published vendor firmware binaries. However, it allows to
flash kernel + rootfs binaries, and this works if you have
a backup of the original contents of the flash. It's probably
possible to create special image out of the vendor binaries
and use that as recovery image.

Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com>
[re-added variables for kernel header]
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Daniel Engberg 6fac9077c6 tools/gengetopt: Update to 2.23
Update gengetopt to 2.23
Remove 100-dependency_fix.patch, fixed upstream
Rework no tests and docs patch
Fix typo in copyright section

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Andrew Cameron d5a38725f8 ath79: increase kernel partition size for CPE610v1
Increase the Kernel partition to address the issue discussed here
https://forum.openwrt.org/t/cpe610-v1-sysupgrade-bin-missing-too-big/39637/5
Switch Back to the okli Loader to support increased partition size

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> [add <> for e-mail]
5 years ago
Andrew Cameron e15049c88b ath79: add support for TP-Link CPE610-v1
TP-Link CPE610-v1 is an outdoor wireless CPE for 5 GHz with
one Ethernet port based on Atheros AR9344

Specifications:
 - Based on the same underlying hardware as the TP-Link CPE510
 - Power, LAN, WLAN5G green LEDs
 - 23dBi high-gain directional 2×2 MIMO antenna and a dedicated metal reflector

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 4-5 seconds and release.
 Rename factory image to recovery.bin
 Stock TFTP server IP:192.168.0.100
 Stock device TFTP adress:192.168.0.254

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
5 years ago
Daniel Engberg 9fc03832bc tools/bison: Update to 3.4.1
Update bison to 3.4.1
Remove 010-intl-stub-compat.patch

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Deng Qingfang 0f4e65ec7b tools/ccache: update to 3.7.1
Update ccache to 3.7.1

Release notes:
https://ccache.dev/releasenotes.html#_ccache_3_7_1

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Davide Fioravanti d95dff162a firmware-utils: jcgimage: add support for 4MiB+ images
The first version of this script allowed just 4Mb factory images.
With this patch is possible to set the maximum size of the payload.

For an 8Mb flash, the corresponding maxsize is:
8 * 1024 * 1024 - 5 * 64 * 1024 = 8388608 - 327680 = 8060928

If the -m argument is not set, the default maximum size will be
used for backward compatibility.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years ago
Davide Fioravanti 1bbd524e84 firmware-utils: jcgimage: fix style and compiler warnings
Fixed some compilation warnings.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years ago
Hans Dedecker 33b81b5721 Revert "bc: update to 1.07.1"
This reverts commit 0111b86f1d as it
breaks on Linux distributions without ed support

./fix-libmath_h: line 1: ed: command not found

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Deng Qingfang 0111b86f1d bc: update to 1.07.1
Update bc to 1.07.1
Use GNU mirror

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Deng Qingfang 9ccb24c548 scons: update to 3.0.5
Update scons to 3.0.5

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Davide Fioravanti c349cc5752 tools/firmware-utils: mktplinkfw2: add Qualcomm layouts
This commit adds the partition layout used by the TP-Link Archer D50
and probably by the TP-Link Archer D7 to mktplinkfw2.

Signed-off-by: Davide Fioravanti <pantanastyle@gmail.com>
5 years ago
Steve Glennon 6411eac5da ipq40xx: add factory image for EnGenius ENS620EXT
Extended  mksenaofw to support new "capwap" header structure.
This supports flashing from factory 3.0.0, 3.0.1, 3.1.0 and 3.5.5
firmware.

Note that the factory image format changes for 3.1 and later firmware,
and that the 3.1.0 and 3.5.5 Engenius firmware will refuse the
factory_30.bin file. Similarly, the 3.0.0 and 3.0.1 Engenius firmware
will refuse the factory_35.bin file.

Flashing from the Engenius 3.1.0 firmware with the factory_35.bin
firmware has not been tested, as 3.1.0 firmware (Engenius "middleFW")
is only intended as part of the upgrade path to 3.5.5 firmware.

Modified ipq40xx image Makefile to appropriately invoke mksenaofw
with new parameters to configure the capwap header.

Note that there is currently no method to return to factory firmware,
so this is a one-way street.

Path from factory 3.0.0 and 3.0.1 (EnGenius) software to OpenWrt is
to navigate to 192.168.1.1 on the stock firmware and navigate to the
firmware menu. Then copy the URL you have for that page, something like
http://192.168.1.1/cgi-bin/luci/;stok=12345abcdef/admin/system/flashops
and replace the trailing /admin/system/flashops with just /easyflashops

You should then be presented with a simple "Firmware Upgrade" page.
On that page, BE SURE TO CLEAR the "Keep Settings:" checkbox.

Choose the openwrt-ipq40xx-engenius_ens620ext-squashfs-factory_30.bin,
click "Upgrade" and on the following page select "Proceed".

Path from factory 3.5.5 (EnGenius) software to OpenWrt is simply to
use the stock firmware update menu. Choose the
openwrt-ipq40xx-engenius_ens620ext-squashfs-factory_35.bin and click
"Upload" and "Proceed".

The device should then flash the OpenWrt firmware and reboot. Note
that this resets the device to a default configuration with Wi-Fi
disabled, LAN1/PoE acting as a WAN port (running DHCP client) and LAN2
acting as a LAN port with a DHCP server on 192.168.1.x (AP is at
192.168.1.1)

Signed-off-by: Steve Glennon <s.glennon@cablelabs.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[sorry, for unfixing the 80-lines eyesores.]
5 years ago
Deng Qingfang ed5409dbe9 tools/ccache: update to 3.7
Update ccache to 3.7

Release notes:
https://ccache.dev/releasenotes.html#_ccache_3_7

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Tomasz Maciej Nowak f0be038897 tools: cbootimage: depend on automake
Fix missing aclocal reported by buildbot.

Fixes: 8595bb0 ("tools: add cbootimage for tegra")
Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Christian Lamparter 7f3facfce2 firmware-utils: fix nec-enc build on older architectures
This patch enable gnu99 mode for the nec-enc utility which
fixes the following build-breaking errors on some older
architectures.

nec-enc.c: In function ‘xor_data’:
nec-enc.c:34:2: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
  for (int i = 0; i < len; i++) {
  ^~~
nec-enc.c:34:2: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code
nec-enc.c: In function ‘main’:
nec-enc.c:101:3: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   for (int i = 0; i < n; i++) {
   ^~~

Spotted-By: Buildbot
Fixes: fac27643f0 ("firmware-utils: add nec-enc")
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
5 years ago
INAGAKI Hiroshi fac27643f0 firmware-utils: add nec-enc
nec-enc provides firmware encoding/decoding with model specific key
for NEC devices.

known devices:

  - Aterm WF1200CR
  - Aterm WG1200CR
  - Aterm WG2600HS

usage:

  nec-enc -i infile -o outfile -k key

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[checkpatch fixes, marked usage as noreturn, added static function,
moved buf* from stack to the global data segment]
5 years ago
Rosen Penev 46dc4e206d tools/xz: Compile with PIC to fix linking errors
I made a similar change to this here:
https://github.com/openwrt/packages/pull/8159

However, it turns out this did not fix the problem as the problem has to
do with tools/xz and not the xz package. The error is the same and causes
linking errors as can be seen above.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
5 years ago
Michael Gray 5198258d10 tools: tplink-safeloader: add C7v5 KR Support
The added entry originates from TP-Links latest Archer C7 v5 KR firmware.

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
5 years ago
Tomasz Maciej Nowak b874437644 tools: add cbootimage-configs for tegra
This provides board configuraion tables for various Tegra boards needed
by cbootimage tool to create flashable bootloader images.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Tomasz Maciej Nowak 8595bb0b17 tools: add cbootimage for tegra
Tegra BCT and bootable flash image generator/compiler

>From documentation:
This project provides a tool which compiles BCT (Boot Configuration
Table) images to place into the boot flash of a Tegra-based device.

The tool will either:

a) Compile a textual representation of a BCT into a binary image.

b) Generate an entire boot image from a previously compiled BCT and a
   bootloader binary.

Signed-off-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
5 years ago
Mario Schroen 5ec205d7ac ath79: Add support for TP-Link CPE210 v3
Specifications:

    * SoC: Qualcomm Atheros QCA9533 (650MHz)
    * RAM: 64MB
    * Storage: 8 MB SPI NOR
    * Wireless: 2.4GHz N based built into SoC 2x2
    * Ethernet: 1x 100/10 Mbps, integrated into SoC, 24V POE IN

Installation:
    Flash factory image through stock firmware WEB UI or TFTP
    To get to TFTP recovery just hold reset button while powering
    on for around 4-5 seconds and release.
    Rename factory image to recovery.bin
    Stock TFTP server IP:192.168.0.100
    Stock device TFTP adress:192.168.0.254

Thanks to robimarko for the work inside the ar71xx tree.
Thanks to adrianschmutzler for deep discussion and fixes.

Signed-off-by: Mario Schroen <m.schroen@web.de>
[Split into DTS/DTSI, read-only config partition in DTSI]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
[renamed dtsi filename, light subject touches]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
5 years ago
Adrian Schmutzler a2a972b2cf ar71xx: Use dynamic partitions for TP-Link CPE210 v2
This is also helpful to add support in ath79.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
5 years ago
Deng Qingfang bfdf00977d tools/ccache: update to 3.6
Update ccache to 3.6

Signed-off-by: Deng Qingfang <dengqf6@mail2.sysu.edu.cn>
5 years ago
Pawel Dembicki 1f149fcad3 firmware-utils: mkdlinkfw: add kernel image offset
Some boards with JBOOT have partiton between bootloader
and kernel image. This patch add possibility to change kernel
partition start address.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years ago
Stijn Tintel d454035430 Revert "tools/cmake: Update to 3.14.0"
The cmake bump to 3.14.0 breaks build on all targets. Revert it for now.

This reverts commit a3446257a8.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
5 years ago
Daniel Engberg a56c21f582 tools/libelf: Add mirrors as main site is dead
Main site hasn't resolved for days so just add a few mirrors instead

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Daniel Engberg a3446257a8 tools/cmake: Update to 3.14.0
Update CMake to 3.14.0
Refresh patches
Remove inofficial fossies.org and replace with GitHub (link on official site)
Remote 150-C-feature-checks-Match-warnings-more-strictly.patch as it's
a no longer needed backport from upstream.

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Piotr Dymacz db91418766 ath79: add support for TP-Link RE350K v1
TP-Link RE350K v1 (FCC ID: TE7RE350K) is a wall-plug AC1200 Wi-Fi range
extender with 'Kasa Smart' support. Device is based on Qualcomm/Atheros
QCA9558 + QCA9882 + AR8035 platform and is available only on US market.

Specification:

- 720/600/200 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of flash (SPI NOR)
- 1x 1 Gbps Ethernet (AR8035)
- 2T2R 2.4 GHz (QCA9558), with ext. PA (SE2565T) and LNA (SKY65971-11)
- 2T2R 5 GHz (QCA9882), with ext. PA (SE5003L1-R) and LNA (SKY65981-11)
- 2x U.FL connector on PCB
- 2x dual-band PCB antennas
- 1x LED, 2x dual-color LED (all driven by GPIO)
- 3x button (app config, led, reset)
- 1x mechanical on/off slide switch
- 1x UART (4-pin, 2.54 mm pitch) header on PCB
- 1x JTAG (8-pin, 1.27 mm pitch) header on PCB

Flash instruction:
Use 'factory' image directly in vendor GUI (default IP: 192.168.0.254,
default credentials: admin/admin).

Warning:
This device does not include any kind of recovery mechanism in U-Boot.

Vendor firmware access:
You can access vendor firmware over serial (RX line requires jumper
resistor in R306 place, near XTAL) with: root/sohoadmin credentials.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
5 years ago
Daniel Golle a18d41996e tools: tar: update to version 1.32
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years ago
Moritz Warning 7fc4dd3611 cmake: match warnings more strictly in C++ feature checks
Require the word "warning" to appear at the start of a line, after
whitespace, or after a `:`.  This is the same that CTest launchers use
to match warnings.  It avoids matching "warning" inside file paths.
Fixed in cmake 3.14.0.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
5 years ago
Felix Fietkau fd8705e635 tools/mkimage: use http download server (fixes FS#2052)
Fixes timeouts with trying to access the FTP site.
Also remove mirror2.openwrt.org, which does not keep current tarballs

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Felix Fietkau 068c4cf407 tools: squashfskit4 should only depend on coreutils on non-linux systems
Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 years ago
Alexander Couzens ac3bae907f tools/squashfskit: fix version detection on non-linux system
gnu date is present in our staging_dir which means squashfskit will fail
to build. Prevent also a race condition if coreutils is build after
squashfskit.

To prevent a race condition, depend on coreutils.

Acked-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
5 years ago
Alexander Couzens 889b6423b7
tools: migrate from squashfs4 to squashfskit4
squashfskit is a fork of the squashfs-tools.
squashfskit creates reproducible filesystems and includes
many of the distro patches.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Tested-by: Paul Spooren <mail@aparcar.org>
5 years ago
Syrone Wong 7fb58b8f00 tools/isl: update to 0.20
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
5 years ago
Linus Walleij c72b1d8468 gemini: Generate harddisk image for DNS-313
This makes OpenWrt build an Ext2+Ext4 partitioned image
for the D-Link DNS-313 with two blank partitions, a boot
partition on /dev/sda3 and a rootfs partition on
/dev/sda4.

This uses the methods already used in apm821xx including
the tricks to convert the generated Ext2 filesystem
partition to version 1 so that the firmware bootloader
will properly recognize it.

We patch a bit around the build files to make sure we
get the rootfs size set and that genext2fs is properly
built.

Tested on the D-Link DNS-313.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[Fixing and tricksing]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Linus Walleij 6cdf08f026 firmware-tools/ptgen: Allow generation 0 size partitions
The firmware on the D-Link DNS-313 NAS require two blank
partitions before the boot partition. Support this if
explicitly requested with a "-n" flag.

Tested on the D-Link DNS-313.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
[Broken out from original patch]
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
5 years ago
Daniel Engberg 93034bf7f0 tools/mpfr: Update to 4.0.2
Update mpfr to 4.0.2
Use official site as last resort
Force thread-safety functionality
Refresh patches

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Daniel Engberg a3383e4b01 tools/bison: Update to 3.3.2
Update bison to 3.3.2
Enable pthreads support
Refresh patches

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Daniel Engberg a3df068b31 tools/sed: Update to 4.7
Update sed to 4.7
Enable pthreads support

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Daniel Engberg 1d1dabdf0a tools/tar: Update to 1.31
Update tar to 1.31
Fixes CVE-2018-20482
Switch to tar.xz tarball
Refresh patches

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Skirmantas Lauzikas 9c01273e5e ath79: add support for TP-Link Archer C2 V3 (AC900)
This commit adds support for the TP-link Archer C2 V3 (AC900).

Specifications:

 - CPU: QCA9563 750Mhz
 - Ram: 64MB (DDR2)
 - Flash: 8MB (SPI NOR)
 - Ethernet: 5x 10/100/1000
 - Wifi: QCA9563 bgn + QCA9887 an+ac
 - 9x Leds, 2x buttons

Flash instructions:

Upload openwrt-ath79-generic-tplink_archer-c2-v3-squashfs-factory.bin
via the router Web interface and flash as normal firmware update.

Signed-off-by: Skirmantas Lauzikas <skirmantas.lauzikas@blackraven.lt>
[reorder entries, fix trailing whitespace in dts, add firmware partition
 compatible string, remove led default off states, use default on state
 for system led, reuse tplink-safeloader-uimage image build recipe, squash
 with dynamic partitioning commit, reword commit message, add
 installation instructions]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Skirmantas Lauzikas 30f48fb107 firmware-utils: tplink-safeloader: Fix for Archer C2 V3 image generation
Fix for factory image generation, so that stock firmware will accept the
openwrt image.

Ref: https://forum.openwrt.org/t/support-for-tp-link-archer-c2-v3/15617/17
Signed-off-by: Skirmantas Lauzikas <skirmantas.lauzikas@blackraven.lt>
[reword commit message, use correct order for conditions,
 trim trailing whitespace]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years ago
Michael Gray 963a83d82b tools: tplink-safeloader: add C7v5 RU Support
The added entry originates from TP-Links latest Archer C7 v5 RU firmware.

Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
5 years ago
David Bauer 36a091cb07 tools: mktplinkfw2: add split-uboot layout
This commit adds the split-uboot partition layout used by the
Archer C50 v4 to mktplinkfw2.

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years ago
Kuang Rufan eb31562370 tools/sed: fix incorrect dependency.
sed shall depend on xz instead of xz depends on sed.

Signed-off-by: Kuang Rufan <master@a1983.com.cn>
5 years ago
Mathias Kresin 26a016731d firmware-utils: mksercommfw: overhaul image creation
Move the zip compression into a build recipe. Pad the image using the
existing build recipes as well to remove duplicate functionality

Change the code to append header and footer in two steps. Allow to use a
fixed filename as the netgear update image does.

Use a fixed timestamp within the zip archive to make the images
reproducible.

Due to the changes we are now compatible to the gnu89 c standard used by
default on the buildbots and we don't need to force a more recent
standard anymore.

Beside all changes, the footer still looks wrong in compare to the
netgear update image.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 18c9faa032 tools: zip: add option for reproducible archives
Add the option -mt/--mtime to pass a timestamp which is used as filedate
for the containing files.

So far, it isn't used for anything written to the extra fields,
therefore requires the -X (eXclude eXtra file attributes) parameter to
be effective.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin ad8c2d6099 tools: add zip utility
One image requires a zip compressed image, so add the zip util found in
the packages feed, and extend it with some useful debian patches.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 01e95dc0dc firmware-utils: mkdlinkfw: fix build
While we don't need the gnu99 option anymore, we still need to force the
c99 standard to fix the following build error on the build bots:

src/mkdlinkfw.c: In function 'find_auh_headers':
src/mkdlinkfw.c:267:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   for (int i = 0; i < header_counter; i++) {
   ^
src/mkdlinkfw.c:267:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin 0e78af22d9 firmware-utils: mkdlinkfw: fix error handling
fread() doesn't set errno, ferror need to be used to check for errors.
While at it, check if we read the expect number of elements.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin e428b127e7 firmware-utils: mkdlinkfw: create reproducible header
Use the SOURCE_DATE_EPOCH environment variable if set instead of the
current time. The used timestamp matches the timestamp of the latest
commit this way and make the images reproducible.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Mathias Kresin f4aa9d8839 firmware-utils: mkdlinkfw: cleanup code
Drop unused function and macros. With the cleanup the gnu extension
typeof isn't used any longer and the gnu99 compile flag can be dropped.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Hans Dedecker e42a227ee3 tools/firmware-utils: fix sysupgrade typo in mkdapimg2
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Hans Dedecker 7197115c25 tools/firmware-utils: fix sysupgrade typo in mkdapimg
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Egor Mikhaylov ff62e83211 bison: update to 3.2.4
Signed-off-by: Egor Mikhaylov <nagakamira@gmail.com>
5 years ago
Georgi Vlaev d03aae1a09 ath79: add support for TP-Link Archer C6 v2
This patch adds support for TP-Link Archer C6 v2 (EU)

Hardware specification:
- SOC: Qualcomm QCA9563 @ 775MHz
- Flash: GigaDevice GD25Q64CSIG (8MiB)
- RAM: Zentel A3R1GE40JBF (128 MiB DDR2)
- Ethernet: Qualcomm QCA8337N: 4x 1Gbps LAN + 1x 1Gbps WAN
- Wireless:
  - 2.4GHz (bgn) QCA9563 integrated (3x3)
  - 5GHz (ac) Qualcomm QCA9886 (2x2)
- Button: 1x power, 1x reset, 1x wps
- LED: 6x LEDs: power, wlan2g, wlan5g, lan, wan, wps
- UART: There's no UART header on the board

Flash instructions:

Upload
openwrt-ath79-generic-tplink_archer-c6-v2-squashfs-factory.bin
via the router Web interface.

Flash instruction using tftp recovery:

1. Connect the computer to one of the LAN ports of the router
2. Set the computer IP to 192.168.0.66
3. Start a tftp server with the OpenWrt factory image in the
   tftp root directory renamed to ArcherC6v2_tp_recovery.bin.
4. Connect power cable to router, press and hold the reset
   button and turn the router on
5. Keep the reset button pressed until the WPS LED lights up
6. Wait ~150 seconds to complete flashing

According to the GPL source the non-EU variant has different
GPIOs assigned to some of the LEDs and buttons. The flash
layout might be different as well. The wikidevi entry for
Archer A6/C6 assumes they are identical.

Signed-off-by: Georgi Vlaev <georgi.vlaev@gmail.com>
5 years ago
Hans Dedecker 77429a820f tools/cmake: update to 3.13.2
Update to the latest stable version and refresh patches; see
https://cmake.org/cmake/help/v3.13/release/3.13.html for the latest
changes in 3.13.x

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
5 years ago
Daniel Engberg 5f978eec18 tools/e2fsprogs: Update to 1.44.5
Update e2fsprogs to 1.44.5

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
INAGAKI Hiroshi 9145f5209f firmware-utils: add hex pattern mode for xorimage
This commit adds "hex pattern mode" to xorimage. This mode allows xor
with a hexadecimal pattern that cannot be expressed with ASCII
charactors.

usage (example):
  xorimage -i firmware.bin -o firmware.bin.new -p 6A57190601121E4C -x

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com> (fix checkpatch)
5 years ago
Daniel Engberg 666dd5dc01 tools/mtools: Update to 4.0.23
Update mtools to 4.0.23
Drop patch, workaround in upstream

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
5 years ago
Kevin Darbyshire-Bryant 99ddff0c7f tools: Update endian definitions for Mac OSX
- it appears (at least from OS X verison 10.10, Yosemite) that the
    big and little endian defintions have changed.

    the older

       #include <sys/_endian.h>
       #include <architecture/byte_order.h>

    reference yielded the following warning:

         #define __bswap_16(x)      NXSwapShort(x)
                                    ^
       /usr/include/architecture/byte_order.h:45:1: note: 'NXSwapShort' has been explicitly marked deprecated here

    For the new OS X editions, it seems that we need to refer to:

      #include <netinet/in.h>
      #include <libkern/OSByteOrder.h>

    and respectively use 'OSSwapInt16', 'OSSwapInt32', & 'OSSwapInt64', in
    place of 'NXSwapShort', 'NXSwapLong' & 'NXSwapLongLong'.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
5 years ago
Karl-Felix Glatzer 1e4ee63cc8 ath79: add support for TP-Link Archer A7
This patch adds support for TP-Link Archer A7

Specification:
- SOC: QCA9563
- Flash: 16 MiB (SPI)
- RAM: 128 MiB (DDR2)
- Ethernet: 4x 1Gbps LAN + 1x 1Gbps WAN
- Wireless:
  - 2.4GHz (bgn) SoC internal
  - 5GHz (ac) QCA988x
- USB: 1x USB 2.0 port
- Button: 1x power, 1x reset, 1x wps
- LED: 10x LEDs
- UART: holes in PCB
  - Vcc, GND, RX, TX from ethernet port side
  - 115200n8

Flash instructions:

Upload openwrt-ath79-generic-tplink_archer-a7-v5-squashfs-factory.bin
via the Webinterface.

Flash instruction using tftp recovery:

1. Connect the computer to one of the LAN ports of the Archer A7
2. Set the computer IP to 192.168.0.66
3. Start a tftp server with the OpenWrt factory image in the tftp
   root directory renamed to ArcherC7v5_tp_recovery.bin
2. Connect power cable to Archer A7, press and hold the reset button
   and turn the router on
3. Keep the reset button pressed for ~5 seconds
4. Wait ~150 seconds to complete flashing

Changes since first revision:

  - Flash instructions using stock image webinterface
  - Changed "Version 5" in model string to "v5"
  - Split DTS file in qca9563_tplink_archer-x7-v5.dtsi
    and qca9563_tplink_archer-a7-v5.dts
  - Firmware image is now build with dynamic partitioning
  - Default to ath10k-ct

Changes since second revision:
  - Changed uboot@0 to uboot@20000 in DTS file
  - Fixed ordering issue in board led script
  - Specify firmware partition format in DTS file
  - Rebased Makefile device definition on common
    Device/tplink-safeloader-uimage definition
  - Merged switch section in network script
    (same configuration as tplink,tl-wdr3600
    and tplink,tl-wdr4300)

Signed-off-by: Karl-Felix Glatzer <karl.glatzer@gmx.de>
5 years ago
Hauke Mehrtens 02324da206 tools/sdimage: Fix build with host Linux headers < 3.18
The ufb tool needs the host UAPI Linux headers from kernel 3.18
or later, remove it for now as it is not used anyway.

Fixes: 4bf5c4395b ("tools/sdimage: update to latest git version")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years ago
Michael Heimpold 4bf5c4395b tools/sdimage: update to latest git version
This includes code cleanups and fixes some portability issues,
compiler warnings about printf arguments etc.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
5 years ago
Mathias Kresin 262b885b83 ramips: use new image build code for D-Link DCS-930 family
Drop the factory images and the firmware tool to create them. They don't
work any more, since the factory image has an uImage header covering the
whole kernel + rootfs. This way the uImage splitter will not be able to
find the rootfs and the kernel will panic later on.

The factory images were most likely added at a time the board had
distinct partitions for kernel and rootfs.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years ago
Daniel Engberg 731a12ad83 tools/bison: Update to 3.2.2
Update bison to 3.2.2

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Rosen Penev 7ef38e42c8 flex: Add a lex symlink
Some packages like libpfring assume the presense of lex, which on some
other systems is a symlink to flex but not all. Symlink flex to fix
compilation.

Arch Linux and Fedora do this as far as I know.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
David Bauer 53020ed4b9 tools: tplink-safeloader: add C7v5 EU SupportList
Currently flash from WebIF is broken for Archer C7 v5 EU models as their
SupportList entries are missing.

The added entries originate from TP-Links latest Archer C7 v5 EU
firmware.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Hans Dedecker 80526d2fed bison: update to 3.2.1
Chnages since 3.2:

b590ad02 version 3.2.1
05e70adf build: fix issues in the generated tarball
7efe0b5d build: fix typo
351e3630 NEWS: update
4fd1fc70 examples: ship them
e02ce4c7 build: minor fixes in doc/
7cab285e CI: maximize chances of errors sooner
86efe282 c++: improve the generated documentation
cf1446dc tests: don't fail if the C++ compiler does not work
e93c40b3 tests: don't disable C++ warnings in C files
eff67391 c++: workaround portability issue
5a0d7802 tests: work around getopt portability issues
f1e0839c doc: -Wzero-as-null-pointer-constant was added to GCC 4.7
3bf429ae examples: #include <cstring> in calc++
f8cadc73 c: provide a definition of _Noreturn that works for C++
bd7aebb8 c: update the definition of _Noreturn
ca8039e6 tests: don't expect the shell to support 'local'
5d07f4f7 bitset: fix warning
e605ad96 build: fix use of gnulib Make variables
50fac71d maint: post-release administrivia

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
6 years ago
Ted Hess 042d68a195 tools/pkg-config: Handle variable substitution of 'bindir' to redirect to STAGING_DIR/bin
Signed-off-by: Ted Hess <thess@kitschensync.net>
6 years ago
Daniel Engberg 04f4dd6fa2 tools/cmake: Update to 3.12.4
Update cmake to 3.12.4

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Kevin Darbyshire-Bryant 1a73b2d089 tools: firmware-utils: mksercommfw build on Darwin
asm/byteorder.h & hence __cpu_to_be32() doesn't exist on Darwin

Shamelessly copy some byte swap functions from oseama.c

Acked-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Koen Vandeputte b4e17a7440 ramips: fix netgear r6120 factory image generation
as indicated in commit c5bf408ed6 "(ramips: fix image generation for mt76x8")
more rework was needed to fix the other issues.

Building on another machine, but using the same arch, showed
the application failing again for different reasons.

Fix this by completely rewriting the application, fixing following found issues:

- buffer overflows, resulting in stack corruption
- flaws in memory requirement calculations (too small, too large)
- memory leaks
- missing bounds checking on string handling
- non-reproducable images, by using unitilized memory in checksum calculation
- missing error handling, resulting in succes on specific image errors
- endianness errors when building on BE machines
- various minor build warnings
- documentation did not match the code actions (header item locations)
- allowing input to be decimal, hex or octal now

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte c5bf408ed6 ramips: fix image generation for mt76x8
Buildbot fails to generate images for targets also generating a
Sercomm binary with following error:

Opening file: /mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img.rootfs.zip
Filesize: 3648606 .
mksercommfw: malloc.c:2427: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.
Makefile:287: recipe for target '/mnt/ramdisk/koen/firmware/builds/owrt_mt76x8/build_dir/target-mipsel_24kc_musl/linux-ramips_mt76x8/tmp/openwrt-ramips-mt76x8-netgear_r6120-squashfs-factory.img' failed

Debugging using valgrind shows stack corruption due to a buffer overflow.
The author of the generator assumes the filename ends with "root",
while it should be "rootfs".

Fix this by accounting for the 2 missing characters which solves the build issues.

More work is required to cleanup this source, which will be done later on.

Reported-by: Hannu Nyman <hannu.nyman@iki.fi>
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Hannu Nyman f1ed7747bb tools/bison: update to version 3.2
Update bison to version 3.2

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Rosen Penev 32fc41baab tools/patch: Add fedora patch for crashing git style patches
https://lists.gnu.org/archive/html/bug-patch/2018-10/msg00000.html

I assume a CVE number will be assigned soon.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Thorsten Glaser a395563f68 build: fix libressl build on x32 (amd64ilp32) host
disable use of assembly code since x32 gets misdetected as amd64

Signed-off-by: Thorsten Glaser <tg@mirbsd.org>
6 years ago
Hannu Nyman b0a2e60793 tools/ccache: update to 3.5
Update ccache to 3.5

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Koen Vandeputte f3b80c36bb ar71xx: fix sysupgrade generation for some targets
These targets are already defined as having a dynamic partition
but the safeloader was not adapted for them.

This causes a build warning for the sysupgrade image being too big.

Targets:
- c58-v1
- c60-v1
- c60-v2
- TL-WR1043 v5
- TL-WR902AC v1
- TL-WR942N V1

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Koen Vandeputte 7c78be1b74 ar71xx: switch more targets to dynamic partitioning
Targets:
- TP-LINK ER355
- TP-LINK C25 V1
- TP-LINK C59 V1
- TP-LINK C7 V4
- TP-LINK C7 V5

Fixes build issues seen due to the kernel being too big

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Radek Dostál 9d35b68776 ar71xx: switch TP-Link RE450 v1 to dynamic partitioning
As mentioned in commit 5f24933 recent changes on ar71xx (switch to 4.14,
memory compaction, ...) cause an increase in kernel size, making it too
big for RE450.

RE450 images were not build due to the following error message:
os-image partition too big (more than 1572864 bytes): Success

Tested on RE450, device boots and was used to send this patch.

Reported-by: Enrico Mioso <mrkiko.rs@gmail.com>
Suggested-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Radek Dostál <rd@radekdostal.com>
[rewrote commit msg keeping it tight + fixed SoB lines]
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Arthur Skowronek 5f2cb6d7dc tools/pkg-config: pass arguments at the end
Go for openwrt passes pkg-config arguments in the format of

        pkg-config --cflags -- pkg-name

which in turn will be passed down to the real pkg-config as something
like

        pkg-config.real --cflags -- pkg-name --define...

and causes the real pkg-config implementation to missinterpret the given
argument list.

This also helps to fix https://github.com/golang/go/issues/27940

Signed-off-by: Arthur Skowronek <arthur.skowronek@tuta.io>
6 years ago
Rosen Penev 622176262d tools/xz: Add PKG_CPE_ID for proper CVE tracking
Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev 74a5c619dc tools/libressl: Add PKG_CPE_ID for proper CVE tracking
Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years ago
Rosen Penev a6bd9d0cb6 tools: patch: Add missing CVE-2018-6951 fix
uscan reports a new CVE now that PKG_CPE_ID was added.

Reordered patches by date.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[re-title commit & refresh patches]
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
6 years ago
Hauke Mehrtens 759f111f8d tools: patch: Fix build by not modifing Makefile.am
A new test case was adding in one of the patches fixing a problem, this
also included a change in the test/Makefile.am to add this test case.
The build system detected a change in the Makefile.am and wants to
regenerate the Makefile.in, but this fails because automake-1.15 is not
installed yet. As automake depends on patch being build first, make sure
we do not modify the Makefile.am.

This fixes build problem seen by the build bots.

Fixes: 4797dddfde ("patch: apply upstream cve fixes")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago