Commit Graph

1873 Commits

Author SHA1 Message Date
Rosen Penev 9a44bc78b4 tools/fakeroot: update to 1.28
Refreshed patches.

Upstream says there's only a bugfix for GNU Hurd.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 19:24:13 +01:00
Rosen Penev f88a6da020 tools/cmake: update to 3.22.3
Seems to be mostly pthread fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 19:24:13 +01:00
Rosen Penev 7f92046dff tools/mtools: update to 4.0.38
No real changelog available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 19:24:13 +01:00
Rosen Penev cca5367f27 tools/expat: enable DTD
Fixes gdb usage, which depends on it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 10:10:30 +01:00
Rosen Penev 3150e8bf3e tools/expat: update to 2.4.7
Mostly a bug fix to the bug fix to CVE-2022-25236

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-13 10:10:30 +01:00
Sungbo Eo 4f3a565f5d tools: zip: make encrypted archives reproducible
Zip always try to generate new encryption header depending on execution
time and process id, which is far from being reproducible. This commit
changes the zip srand() seed to a predictable value to generate
reproducible random bytes for the encryption header. This will compromise
the goal of secure archive encryption, but it would not be a big problem
for our purpose.

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-09 15:38:23 +09:00
Sungbo Eo 39d06472eb tools: zip: fetch SOURCE_DATE_EPOCH directly
Remove "--mtime" option introduced in commit 18c9faa032 ("tools: zip:
add option for reproducible archives") and instead fetch SOURCE_DATE_EPOCH
environment variable directly in the code.

Ref: https://sourceforge.net/p/infozip/patches/25/
Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-03-09 15:38:23 +09:00
Felix Fietkau 545cabee9e tools/fakeroot: restore macos bugfix that was dropped during the last update
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-03-05 16:58:58 +01:00
Josef Schlehofer 495c4f4e19 tools/libressl: update to version 3.4.2
Release notes:
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.2-relnotes.txt

```
It includes the following security fix

  * In some situations the X.509 verifier would discard an error on an
    unverified certificate chain, resulting in an authentication bypass.
    Thanks to Ilya Shipitsin and Timo Steinlein for reporting.
```

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-03-01 00:08:08 +01:00
Huangbin Zhan 4a19cf3bc7 tools/mkimage: update to 2022.01
- enable dot config
- enable openwrt verbose
- add bison as dependency to avoid failure
```
  bison -oscripts/kconfig/zconf.tab.c -t -l scripts/kconfig/zconf.y
bison: /builder/shared-workdir/build/staging_dir/host/share/bison/m4sugar/m4sugar.m4: cannot open: No such file or directory
```

Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 40f91f6a2f tools/fakeroot: update to 1.27
Remove macOS stuff. Upstream has fixed it in the same way.

Add SOL_TCP define. Taken from elsewhere in the code.

Refreshed patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 4e13229dd1 tools/expat: update to 2.4.6
Switched to CMake for faster compilation and greater parallel
friendliness.

Added CMake options from the packages feed.

This release fixes various CVEs.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev c8fdca4f6f tools/findutils: update to 4.9.0
Add compilation fix for Ubuntu 20.04. Provided by upstream maintainer:

https://github.com/openwrt/packages/issues/17912#issuecomment-1046726426

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 94dd68ff73 tools/zstd: update to 1.5.2
Switched to building with meson as it's faster and does not need a
dependency on cmake, which takes a long time to build.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 2d5f03205a tools/ccache: add cmake dependency
This will be needed for the next commit as ccache's cmake dependency is
satisfied by zstd currenly.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 03f55708cb tools/cmake: update to 3.22.2
Mostly random Python 3.10 fixes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev 63e530a519 tools/mtools: update to 4.0.37
No changelog is available.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Rosen Penev c8b7065f61 tools/mklibs: update to 0.1.45
Refresh 2to3 patch. Upstream partially did this against some older
python version. This is still needed.

Refreshed other patches to be python3 safe.

Remove uClibc patches as only musl is present now.

Refresh others.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-01 00:08:08 +01:00
Stijn Tintel 0dc3566a3b firmware-utils: bump to git HEAD
002cfaf firmware-utils: fix compilation with macOS

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-02-28 13:12:00 +02:00
Stijn Tintel 73dfc9e7d9 firmware-utils: bump to git HEAD
706e9cc tplink-safeloader: support for Archer A6 v3 JP
  497726b firmware-utils: support checksum for AVM fritzbox wasp SOCs
  2ca6462 iptime-crc32: add support for AX8004M
  57d0e31 tplink-safeloader: TP-Link EAP615-Wall v1 support
  8a8da19 tplink-safeloader: add TL-WPA8631P v3 support
  eea4ee7 tplink-safeloader: add TP-Link Archer A9 v6 support

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-02-27 12:01:22 +02:00
Rosen Penev 628970a195 tools/meson: update to 0.61.2
Seems to be minor bugfixes with Cygwin and Windows.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-02-26 13:44:14 +01:00
Rosen Penev 68a20d8631 tools/quilt: update to 0.67
- Call pager with original LANG environment variable
  - Consistently complain early if no series file is found
  - Fix handling of symbolic links by several commands
  - Tighten the patch format parsing
  - Reuse the shell (performance)
  - Document the series file format further
  - Document that quilt loads /etc/quilt.quiltrc
  - configure: Make stat configurable
  - series: Minor optimizations
  - setup: Don't obey the settings of any englobing .pc
  - setup: Default to fast mode
  - quilt.el: Fix documentation of quilt-pc-directory
  - quilt.el: Load /etc/quilt.quiltrc if ~/.quiltrc doesn't exist
  - quilt.el: Fix quilt-editable when QUILT_PATCHES_PREFIX is set

Refresh patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
[add changelog]
Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-25 14:12:39 +01:00
Paul Spooren 1e2549045c tools: use https for bc mirrors
All mirrors offer encrypted downloads, use it.

Signed-off-by: Paul Spooren <mail@aparcar.org>
2022-02-24 15:36:28 +01:00
Rosen Penev 0d25db7f17 tools/cmake: add MAKE config variable
Makes sure that Ninja from staging_dir is used and nowhere else.

Reported by reproducible builds project. Builds have been failing ever
since tools/cmake started using Ninja.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-02-11 12:04:09 +01:00
Jo-Philipp Wich af79853c73 Revert "tools/zstd: update to 1.5.2"
This reverts commit 8de901ccf7.

Apparently this update breaks tools building.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-02-07 09:03:19 +01:00
Rosen Penev 8de901ccf7 tools/zstd: update to 1.5.2
Switched to building with meson as it's faster and does not need a
dependency on cmake, which takes a long time to build.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-02-07 00:03:27 +01:00
Rosen Penev fb6cf22866 tools/meson: update to 0.61.1
Changelog:

backend_startup_project
Add a man page backend to refman
extract_objects() supports generated sources
Python 3.6 support will be dropped in the next release
Warning if check kwarg of run_command is missing
meson rewrite can modify extra_files
meson rewrite target <target> info outputs target's extra_files
Visual Studio 2022 backend
Support for CMake <3.14 is now deprecated for CMake subprojects
Added support for sccache
install_symlink function

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-02-03 23:16:00 +01:00
Sungbo Eo 536a8021c3 firmware-utils: bump to git HEAD
0c15cad iptime-naspkg: add image header tool for ipTIME NAS series
872c87c iptime-crc32: add image header tool for new ipTIME models

Signed-off-by: Sungbo Eo <mans0n@gorani.run>
2022-01-29 23:49:39 +09:00
Daniel Golle ebeb003470
firmware-utils: update to git HEAD of 2022-01-28
6c95945 ptgen: add Chromium OS kernel partition support
 8e7274e cros-vbutil: add Chrome OS vboot kernel-signing utility

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2022-01-28 13:00:25 +00:00
Felix Fietkau 3869ccbcc8 tools: build bash on macOS and use it for ipkg-build
On macOS, system binaries silently drop the environment variables for injecting
extra shared libraries (used by fakeroot). This is done for security reasons.
Work around this by building bash from source, so that it gets an ad-hoc signature
and does not have these restrictions

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-27 13:38:48 +01:00
Felix Fietkau 1d4750fd50 tools/coreutils: build chown
On ARM macOS, injecting extra shared libraries does not work for system
binaries. This causes fakeroot to fail for chown calls

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-27 13:38:48 +01:00
Felix Fietkau 53ebacacf9 tools/fakeroot: fix unresolved symbols on arm64 macOS
The $INODE64 symbol variants are not present, since the base system
always uses 64-bit file offsets

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2022-01-27 13:38:48 +01:00
Hauke Mehrtens f1d4c77766 firmware-utils: update to latest master
d885b49 tplink-safeloader: support Archer C6v3.0 (BR)

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2022-01-16 21:56:51 +01:00
Matthias Schiffer 9e15dea36e
firmware-utils: update to latest master
84dbf8ee49f5 tplink-safeloader: fix Archer A7v5 factory flashing from vendor fw > v1.1.x

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2022-01-14 23:13:23 +01:00
Josef Schlehofer 4b587f2561 tools/cmake: update to version 3.22.1
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-12-31 15:38:56 +01:00
Huangbin Zhan b6385a3668 tools/mkimage: update to 2021.10
Changelog:

 - upstream now needs OpenSSL in order to be able to sign FITs. See:
commit cb9faa6f98ae ("tools: Use a single target-independent config to enable OpenSSL")

 - removes upstream patches.

Link: cb9faa6f98
Tested-by: Sergey V. Lobanov <sergey@lobanov.in>
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
2021-12-27 13:51:41 +01:00
Sergey V. Lobanov 8261b85844 tools/mkimage: fix build on MacOS arm64
Fixed -no-pie compilation warning on MacOS
Fixed errors related to using absolute addressing on MacOS arm64

Based on upstream patch from Jessica Clarke and suggestions from Ronny Kotzschmar

Link to original patch and discussion:
3b142045e8

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
2021-12-06 23:36:35 +01:00
Rosen Penev 75093d1b1d tools/meson: update to 0.60.1
change meson binary to use py extension. Fixes issue with meson's
symbolextractor using the host python instead of the system one.

We intentionally use a .py extension here so that meson launches
additional python scripts with the same build host python interpreter as
itself is running under (and not the host package one once it becomes
available)

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-12-05 18:49:14 +01:00
Sergey V. Lobanov 8fedc17d01 tools/fakeroot: fix build on MacOS arm64
Added patch for MacOS without 32 bit inodes support
(__DARWIN_ONLY_64_BIT_INO_T is true)

This patch based on discussion https://github.com/archmac/bootstrap/issues/4

Signed-off-by: Sergey V. Lobanov <sergey@lobanov.in>
2021-12-02 14:43:41 +01:00
Rafał Miłecki 51d4e85068 firmware-utils: bump to the latest master
56e8e19 otrx: support TRX from stdin when extracting
a37ccaf otrx: support unsorted partitions offsets
1fa145e otrx: extract shared code opening & parsing TRX format
0fbc135 oseama: support extracting entity to stdout
58c9d5d oseama: allow reading from stdin
4ecefda otrx: allow validating TRX from stdin
cf01e69 otrx: avoid unneeded fseek() when calculating CRC32
fa35379 tplink-safeloader: add EAP225 v1 support
f4d1263 build, cmake: switch OPENSSL_CRYPTO_LIBRARY -> OPENSSL_CRYPTO_LIBRARIES
cd3f6ee build, cmake: add quotes for FW_UTIL variable arguments

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-12-02 09:14:09 +01:00
Rosen Penev d1c7df9c4b tools/ccache: update to 4.5.1
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-26 21:33:09 +01:00
Rosen Penev a18047de45 tools/cmake: update to 3.22.0
Refreshed patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-26 21:27:50 +01:00
Felix Fietkau 340c2ed2ef tools/llvm-bpf: move tarball packing to target/llvm-bpf
This ensures that the tarball is regenerated after make clean or after switching
to a different target

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-22 12:00:40 +01:00
Felix Fietkau 203c86f061 tools/llvm-bpf: include host os/arch in tarball name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-21 13:47:18 +01:00
Huangbin Zhan 1126855911 tools/llvm-bpf: make sure llvm-bpf.tar.gz is created
The llvm-bpf-$version.tar.xz might be absent. For example `make clean` executed, CONFIG_TARGET changed.
This commit can only guarantee that the target file can be built when tools/compile is explicitly called rather than $(tools/stamp-compile).

Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2021-11-21 13:47:18 +01:00
Felix Fietkau 848499c1cf tools: include the value of CONFIG_SDK_LLVM_BPF in the stampfile
tools/llvm-bpf needs to be checked if the value changes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-21 13:47:18 +01:00
Rosen Penev 9211af712f tools/cpio: fix compilation with clang
A define dealing with builtin type is wrong. A gnulib update fixes
this, but that requires a new cpio version.

Refresh other patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-20 21:08:25 +01:00
Andre Heider e37dffbf35 tools/mkimage: pass --static via PKG_CONFIG_EXTRAARGS
Remove the then unnecessary patch doing exactly that individually.

See also 09465d80 "u-boot.mk: always link host libraries static".

Signed-off-by: Andre Heider <a.heider@gmail.com>
2021-11-06 14:22:26 +01:00
Felix Fietkau 10cbce3b52 tools: ensure that BIN_DIR is created early
Fixes llvm-bpf buildbot failure

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-04 19:05:17 +01:00
Felix Fietkau 2a832b3df5 llvm-bpf: support creating a tarball in bin
This can be used for adding the toolchain to an existing tree without having
to build it from scratch.
Enable building the toolchain + tarball by default on buildbot

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-04 16:59:22 +01:00
Felix Fietkau a7c0d7c06c llvm-bpf: move to staging_dir/host/llvm-bpf
This makes it easier to package it up for the download server

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-04 16:55:04 +01:00
Rosen Penev 03bb3412a2 tools/libressl: update to 3.4.1
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-11-02 10:00:32 -10:00
Felix Fietkau 6738820bf6 build: fix bpf toolchain dependency for qosify
Add hidden symbols to fix defaults with CONFIG_DEVEL unset

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 18:41:20 +01:00
Felix Fietkau 5ad663b765 config: add choice for selecting the LLVM toolchain type
This is global for all BPF based packages

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-11-01 16:38:40 +01:00
Adrian Schmutzler b4f2e52309 firmware-utils: bump to latest git HEAD
7073760 ramips: add support for TP-Link RE305 v3
86739f2 Add more missing include for byte swap operations

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-10-30 22:05:25 +02:00
Rosen Penev 3bd31cc4d2 tools/meson: update to 0.60.0
Add cmake support to meson. Otherwise only pkgconfig can be used.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-30 21:17:20 +02:00
Andre Heider 0e411c69a8 tools/pkgconf: add PKG_CONFIG_EXTRAARGS for additional arguments
This can be used my the OpenWrt build system to pass additional
arguments when required.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2021-10-24 18:00:49 +02:00
Rui Salvaterra dd0ad9b661 tools/isl: update the download URL
isl.gforge.inria.fr has been dead since early this month [1]. Switch to
libisl.sourceforge.io for the time being.

[1] https://groups.google.com/g/isl-development/c/JGaMo2VUu_8

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-10-21 20:37:20 +01:00
Felix Fietkau faa6a9a04b tools/llvm-bpf: add llvm+clang build suitable for compiling code to eBPF
Preparation for building packages that ship eBPF code

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-10-20 11:35:34 +02:00
Felix Fietkau 48e209e5c5 tools/fakeroot: explicitly pass CPP variable
For some reason, the generated configure script fails to properly set up
the internal preprocessor command variable, causing the host OS check for
Darwin to fail after the last update.
Explicitly setting CPP fixes this issue

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-10-13 16:48:53 +02:00
Rosen Penev 977bf5e980 tools/ccache: update to 4.4.2
Refreshed patch.

Disable hiredis backend since it seems to default to it now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-10 13:05:54 -10:00
Rosen Penev 7c0fb87443 tools/meson: fix usage with SDK
The python path cannot be embedded in the meson binary as it changes
with the SDK.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-10 19:39:32 +01:00
Rosen Penev c2222f74c8 tools/meson: update to 0.59.2
Update install procedure based on upstream feedback. Normally, meson is
to be installed with pip. But as pip is not mandated by the build
system, it cannot be used. Upstream provides a nice script to pack meson
automatically.

Moved src/ to files/. No need to copy to BUILD_DIR.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-07 14:09:40 -10:00
Kevin Darbyshire-Bryant 81ba544f88 firmware-utils: bump to git HEAD
f9ad6b3 Add more missing includes for byte swap operations

Basically stop it exploding on MacOS

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-10-05 21:52:58 +01:00
Rosen Penev 297cb8c147 tools/cmake: update to 3.21.3
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-05 20:59:51 +02:00
Rosen Penev 5266a27359 tools/bison: update to 3.8.2
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-10-05 20:59:41 +02:00
Petr Štetiar 8cc9a74a3f firmware-utils: update to version 2021-10-05
Includes following changes:

 db65821f006c cmake: fix missing install target
 3a0cfc856991 Add initial GitLab CI support
 8f47adea6f87 Add missing includes for byte swap operations
 fbafae9f8037 Convert to CMake based project

Additionaly moves source code into separate Git project repository and
converts the package build to utilize CMake.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
[rmilecki: rebase, update to the latest repo git & rm -r src]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-10-05 16:20:10 +02:00
Andrew Cameron ac03e24635 ath79: add support for TP-Link CPE710-v1
TP-Link CPE710-v1 is an outdoor wireless CPE for 5 GHz with
one Ethernet port based on the AP152 reference board

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 antenna and a dedicated metal
  reflector
- Power, LAN, WLAN5G Blue LEDs
- 3x 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: Andrew Cameron <apcameron@softhome.net>
[convert to nvmem, fix MAC assignment in 11-ath10k-caldata]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-25 19:28:54 +02:00
Felix Fietkau ea44aebc27 tools/fakeroot: fix build error on macOS
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-09-25 09:38:46 +02:00
Alan Luck 2c9a07ed28 ramips: add missing information to dlink headers
Add additional header information required for newer
bootloaders found on DIR-2660-A1 & A2.

Also remove the MTD splitter compatible from the second firmware
partition, as OpenWrt only supports handling of the first one.

Signed-off-by: Alan Luck <luckyhome2008@gmail.com>
[rephrase commit message, remove removal of read-only flags]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-09-24 12:32:28 +02:00
Hauke Mehrtens 96e05e2e36 libtool: Revert "libtool: bump to 2.4.6"
This breaks the package builds using the SDK.
The targets all build fine, but the package builder fails on many
packages. The package builder uses the OpenWrt SDK.

This reverts commit c377d874be.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-09-23 13:39:11 +02:00
Eneas U de Queiroz c377d874be libtool: bump to 2.4.6
This updates libtool to its current release, from 2015.  Current patches
were renumbered and given a description text.  The fix in
160-passthrough-ssp.patch is no longer needed.

A patch to speed up build was cherry-picked, and another openwrt
specific patch was needed to not use quotes in $(SHELL), to acommodate
our "SHELL=/usr/bin/env bash" usage.

The already present call to ./bootstrap ensures that generated files are
refreshed, so the patches are applied only to their sources.  Also, that
bootstrap call was adjusted to run at the appropriate time when QUILT=1.

Signed-off-by: Eneas U de Queiroz <cotequeiroz@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev 8c863f604d tools/e2fsprogs: update to 1.46.4
Refresh patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev 0d983c2a68 tools/autoconf-archive: update to 2021.02.19
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev d23c5ecb19 tools/sstrip: update to 3.2
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev 674bda09e2 tools/sparse: update to 0.6.4
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev aae4bf7c62 tools/mtools: update to 4.0.35
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev fc9682ed39 tools/m4: update to 1.4.19
Remove upstreamed patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev 22c30ed958 tools/fakeroot: update to 1.26
Remove upstreamed patches. Refresh other.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev af1853af60 tools/bison: update to 3.8.1
Remove upstreamed patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-20 15:21:17 +02:00
Rosen Penev aa344bcfa8 tools/pkgconf: update to 1.8.0
Switch to compiling with meson for faster and more reliable compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-16 16:31:28 -10:00
Rosen Penev c4dfdde2ea tools: add meson
meson is a next generation build system designed to have good defaults,
simpler build files, and fast compilation.

It is built upon python and uses ninja for compilation. The latter
provides fast by default (parallel) and problem free compilation.

There are over 40 packages already successfully using meson. The next
commit will convert pkgconf to use meson compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-16 16:31:28 -10:00
Rosen Penev 4b898afdd2 tools/mm-macros: remove
ccaaab1c04 says that this is in the
codebase because of libsigc++, which is not in the codebase anymore.
Neither in base nor in packages. It doesn't seem to be needed by
anything else either. GNOME packages have transitioned to using meson,
which does not use m4 files.

Tested local compile with CONFIG_ALL. No problems seen.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-16 16:27:32 -10:00
Sander Vanheule 46dec9952b firmware-utils: tplink-safeloader: set EAP235-Wall v1 soft-version
Starting with v3 of the vendor firmware for the TP-Link EAP235-Wall v1,
downgrades to firmware versions below v3 as not allowed.  Since OpenWrt
uses version 0.0.0 as a default, this causes the factory install to fail
on devices with a recent firmware. This failure is associated by the
following message on the device's serial console:

    EAP235/230-Wall forbid fw reverted from 3.x.x to lower version!

Vendor firmware (v3) also uses build and release numbers to compare
images, so identical version numbers are very unlikely to cause issues.
Bump the firmware version to 3.0.0 to ensure users can install OpenWrt
on their devices.

Reported-by: Colton Conor <colton.conor@gmail.com>
Tested-by: Colton Conor <colton.conor@gmail.com>
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-09-13 18:36:15 +02:00
Sander Vanheule 8dba4741b3 firmware-utils: tplink-safeloader: improve soft-version customisation
Some devices using the safeloader firmware format require a minimum or
specific version to be set in the soft-version metadata partition.
Currently only custom text values can be provided, but not all device
firmware support this format.

Modify the device info struct to allow for more well-defined types of
soft-version overwrites, and provide a few macros for easy value
initialisation. Requires all existing values to be updated to match the
new structure.

Signed-off-by: Sander Vanheule <sander@svanheule.net>
[Adapt TL-WA1201-V2 entry too]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2021-09-13 18:36:15 +02:00
Sander Vanheule df63619eea firmware-utils: tplink-safeloader: use revision field
The structured soft-version partition has a field which contains a
(source) revision number. Factory images used to include this, but
it was accidentaly removed during an earlier refactoring.

Include the source revision number again in the generated soft-version
partition. Additionaly, also show this revision number when printing
image info.

Fixes: 1a211af2cb ("firmware-utils: tplink-safeloader: refactor meta-partition generation")
Signed-off-by: Sander Vanheule <sander@svanheule.net>
2021-09-09 23:36:13 +02:00
Ivan Pavlov cdc646c032 tools/libtool: update to 2.4.2
Refresh patches.
Remove upstreamed: 001-fix-func_append.patch

Signed-off-by: Ivan Pavlov <AuthorReflex@gmail.com>
2021-09-07 21:10:53 +02:00
Rafał Miłecki 2f7a73329f firmware-utils: seama.h: replace LGPL-2.1-or-later boilerplate with SPDX
This was missed because scancode license scanner was confused by a
slightly different than expected license text (96,75% license score).

License text included "file" instead of "library" in the main part of
the licensing info. It also used "The GNU C Library" instead of the
standard "This library" in 2nd and 3rd paragraphs.

The first paragraph clearly mentions LGPL-2.1-or-later and the use of
"file" instead of "library" should not affect licensing.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-07 09:37:35 +02:00
Kevin Darbyshire-Bryant 96a7a4738c tools/findutils: fix build on macos
Use same fix as homebrew:

https://github.com/Homebrew/homebrew-core/pull/69761

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-09-06 09:24:23 +01:00
Robert Balas baacdd53df ath79: add support for TP-Link TL-WA1201 v2
This device is a wireless access point working on the 2.4 GHz and 5 GHz
band, based on Qualcomm/Atheros QCA9563 + QCA9886.

Specification
- 775 MHz CPU
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- QCA9563: 2.4 GHz 3x3
- QCA9886: 5 GHz
- AR8033: 1x 1 Gbs Ethernet
- 4x LED, WPS factory reset and power button
- bare UART on PCB (accessible through testpoints)

Methods for Flashing:
- Apply factory image in OEM firmware web-gui. Wait a minute after the
  progress bar completes and restart the device.
- Sysupgrade on top of existing OpenWRT image
- Solder wires onto UART testpoints and attach a terminal.
  Boot the device and press enter to enter u-boot's menu. Then issue the
  following commands
  1. setenv serverip your-server-ip
     setenv ipaddr your-device-ip
  2. tftp 0x80060000 openwrt-squashfs.bin (Rembember output of size in
    hex, henceforth "sizeinhex")
  3. erase 0x9f030000 +"sizeinhex"
  4. cp.b 0x80060000 0x9f030000 0x"sizeinhex"
  5. reboot

Recover:
- U-boot serial console

Signed-off-by: Robert Balas <balasr@iis.ee.ethz.ch>
[convert to nvmem]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-09-05 23:52:35 +02:00
Rosen Penev f78ad901e1 tools/libressl: update to 3.3.4
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:28:55 +02:00
Rosen Penev eef7f9ea37 tools/cmake: update to 3.21.2
Refreshed patches.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:28:43 +02:00
Rosen Penev f431f2c4b6 tools/bison: update to 3.7.6
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:28:32 +02:00
Rosen Penev fe1942a87d tools/dosfstools: update to 4.2
Remove upstream backport.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:28:20 +02:00
Rosen Penev af8a5d240b tools/findutils: update to 4.8.0
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:28:08 +02:00
Rosen Penev cb8e5ede19 tools/tar: update to 1.34
Refresh patch.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:26:48 +02:00
Rosen Penev c5953d5f30 tools/zstd: update to 1.5.0
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-09-05 21:26:32 +02:00
Matthew Hagan 6f39649555 firmware-utils: mkmerakifw-old: Add le32 support
mkmerakifw-old was created for the z1 which uses the AR9344 SoC with
be32 addressing. The MX64/MX65 devices use the same header style, however
these boards use a BCM NSP SoC with le32 addressing.

Since we may be booting initramfs images with this header, which may be
of any size, within reason, board->imagelen is set to 0. The kernel
image shoule be limited in the image Makefile.

Signed-off-by: Matthew Hagan <mnhagan88@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-31 12:39:53 +02:00
Kevin Darbyshire-Bryant c9faa84b31 firmware-utils: fix build on not Linux
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-08-21 20:16:39 +01:00
Vincent Wiemann c4a426746f firmware-utils: add support for ZyXEL ZLD firmware
This commit adds a tool for extracting and creating firmware archives for:
- ZyXEL NWA5121-N
- ZyXEL NWA5121-NI
- ZyXEL NWA5123-NI
- ZyXEL NWA5123-AC
- ZyXEL NWA5301
- ZyXEL NWA3560N v2
- ZyXEL WAC6100
- ZyXEL WAC6500

And maybe others...

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
2021-08-21 15:59:39 +02:00
Rafał Miłecki 5ecd99f7d2 firmware-utils: nand_ecc: replace GPL boilerplate with SPDX
Cc: yajin <yajin@vm-kernel.org>
Cc: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-09 16:08:59 +02:00
Rafał Miłecki 0e85dc0e91 firmware-utils: trx: replace GPL-2.0-or-later boilerplate with SPDX
This was missed because scancode license scanner was confused by
comments about crc32buf().

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-09 16:08:59 +02:00
Rafał Miłecki cc8bc2168d firmware-utils: osbridge-crc: replace GPL-2.0-only boilerplate with SPDX
This was missed because scancode license scanner was confused by
comments about crc32buf().

Cc: Gabor Juhos <juhosg@openwrt.org>
Cc: Gabor Juhos <juhosg@freemail.hu>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-09 16:08:59 +02:00
Rafał Miłecki f2e86d54c4 firmware-utils: mkmylofw: replace GPL-2.0-or-later boilerplate with SPDX
This was missed because scancode license scanner was confused by a
comment about (no) copyrights in the init_crc_table().

Cc: Gabor Juhos <juhosg@openwrt.org>
Cc: Gabor Juhos <juhosg@freemail.hu>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-09 16:08:59 +02:00
Rafał Miłecki fe54c3a0db firmware-utils: mkmerakifw-old: replace GPL-2.0-only boilerplate with SPDX
This was missed because scancode license scanner was confused by a
comment about Cisco's GPL code github repository.

Cc: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Christian Lamparter <chunkeey@gmail.com>
2021-08-09 16:08:59 +02:00
Rafał Miłecki 2dc1e4b488 firmware-utils: add GPL 2.0 SPDX to files with no license info
These files fall under the project license: GPL-2.0-only.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-06 09:50:44 +02:00
Rafał Miłecki e7ae32b8df firmware-utils: tplink-safeloader: replace BSD-2-Clause boilerplate with SPDX
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Matthias Schiffer <mschiffer@universe-factory.net>
2021-08-06 09:50:44 +02:00
Rafał Miłecki 63bf027cc1 firmware-utils: seama: replace BSD-3-Clause boilerplate with SPDX
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-06 09:50:44 +02:00
Rafał Miłecki 60aa12984a firmware-utils: replace GPL 2.0+ boilerplate/reference with SPDX
This uses "GPL-2.0-or-later" header for files identified using scancode
license scanner with 100% score as GPL 2.0 or later.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-08-06 09:50:42 +02:00
Rafał Miłecki f705008d7e firmware-utils: replace GPL 2.0 boilerplate/reference with SPDX
This uses "GPL-2.0-only" header for files identified using scancode
license scanner with 100% score as GPL 2.0.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-08-06 09:34:55 +02:00
Roberto Valentini af56075a8f ath79: add support for TP-Link RE455 v1
TP-Link RE455 v1 is a dual band router/range-extender based on
Qualcomm/Atheros QCA9563 + QCA9880.

This device is nearly identical to RE450 v3

Specification:

- 775 MHz CPU
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 1x 10/100/1000 Mbps Ethernet (AR8033 PHY)
- 7x LED, 4x button
- UART header on PCB[1]

Flash instruction:
Apply factory image in OEM firmware web-gui.

[1] Didn't work, probably need to short unpopulated resistor R64
    and R69 as RE450v3

Signed-off-by: Roberto Valentini <valantin89@gmail.com>
2021-07-11 16:58:12 +02:00
Diogenes Rengo cce2e8db56 ath79: add support for TP-Link TL-WR941HP v1
Specifications:
    SOC:        Qualcomm Atheros TP9343 (750 MHz)
    Flash:      8 Mb (GigaDevice GD25Q64CSIG)
    RAM:        64 Mb (Zentel A3R12E40DBF-8E)
    Serial:     yes, 4-pin header
    Wlan:       Qualcomm Atheros TP9343, antenna: MIM0 3x3:3 RP-SMA
                3 x 2.4GHz power amp module Skyworks (SiGe) SE2576L
    Ethernet:   Qualcomm Atheros TP9343
    Lan speed:  100M ports: 4
    Lan speed:  100M ports: 1
    Other info: same case, ram and flash that TP-Link TL-WR841HP,
                different SOC

    https://forum.openwrt.org/t/adding-device-support-tp-link-wr941hp/

Label MAC addresses based on vendor firmware:
    LAN   *:ee  label
    WAN   *:ef  label +1
    WLAN  *:ee  label

    The label MAC address found in "config" partition at 0x8

Flash instruction:
    Upload the generated factory firmware on web interface.

Signed-off-by: Diogenes Rengo <rengocbx250@gmail.com>
[remove various whitespace issues, squash commits, use short 0x0]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2021-07-04 18:07:35 +02:00
Rosen Penev 5cff6c1abb tools/cmake: update to 3.20.3 + build with Ninja
Compile with Ninja. Ninja compiles faster and is more stable with
parallel builds. Routines copied from cmake.mk.

Speed improves from:

Executed in	127.47 secs	fish		external
usr time	17.02 mins	446.00 micros	17.02 mins
sys time	1.18 mins	40.00 micros	1.18 mins

to:

Executed in	118.91 secs	fish		external
usr time	17.28 mins	499.00 micros	17.28 mins
sys time	1.13 mins	45.00 micros	1.13 mins

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-20 20:12:14 -10:00
Rosen Penev 3cbdc13bc1 tools/squashfskit4: fix compilation under big endian
The macro used is for the wrong struct. Just byte swap manually.

Refreshed patches.

Tested on sparc64.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-20 18:59:36 -10:00
Rosen Penev b154a2f8d3 tools/e2fsprogs: update to 1.46.2
Fix wrong FPIC flag to fix compilation under sparc64

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-20 18:10:15 -10:00
Rosen Penev bf4dbbb55e tools/libressl: update to 3.3.3
Fix wrong FPIC variable usage. Fixes compilation under sparc64 host.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-20 15:20:54 -10:00
Rosen Penev 2e745e9be6 treewide: remove BUILD_PARALLEL from CMake packages
It's already default. The only exception is mt76 which has Ninja
disabled.

Found with:

git grep BUILD_PARALLEL | cut -d ':' -f 1 | sort -u > par
git grep cmake.mk | cut -d ':' -f 1 > cmake
comm -1 -2 par cmake

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-19 20:44:59 -10:00
Stijn Segers b6245fbd58 firmware-utils: tplink-safeloader: support Archer A6 v3 CA
The Canadian edition of the TP-Link Archer A6 v3 uses a different header, but
otherwise it's identical to the already supported EU/US editions.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
Tested-by: Brian Lee <dev@leebrian.me>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
2021-06-20 00:49:06 +02:00
Rosen Penev 90338370d1 tools/ccache: update to 4.3
Remove BUILD_PARALLEL as it's default now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-19 08:42:50 -10:00
Amish Vishwakarma d22fb7f4fd ramips: add support for TP-Link Archer C6 v3
The patch adds support for the TP-Link Archer C6 v3 (FCC ID TE7A6V3)
The patch adds identification changes to the existing TP-Link Archer A6,
by Vinay Patil <post2vinay@gmail.com>, which has identical hardware.

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration & Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-c6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-c6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated by powercycling the router four times
before the boot process is complete.
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Signed-off-by: Amish Vishwakarma <vishwakarma.amish@gmail.com>
[fix indent]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-06-13 11:32:31 +02:00
Felix Fietkau fa0aea53b2 tools: build ninja before ccache to fix the build order
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-12 14:33:57 +02:00
Felix Fietkau d45baa860f tools: fix dependencies of cmake packages
Make cmake depend on ninja, so that other cmake based tools also depend on it

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-12 12:40:27 +02:00
Felix Fietkau 97258f5363 build: add ninja build tool and make it available for cmake
ninja is faster at building cmake packages than make, and according to reports
also more reliable at handling parallel builds
This commit includes a patch that adds GNU make jobserver support, in order to
allow more precise control over the number of parallel tasks

Enable parallel build by default for packages using ninja

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-12 10:46:39 +02:00
Rui Salvaterra 609aa39783 tools/isl: bump to 0.24
Tested with Graphite and -floop-nest-optimize, without issues.

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2021-06-06 00:26:13 +02:00
Michael Pratt 7b9a0c264c ath79: use dynamic partitioning for TP-Link CPE series
CPExxx and WBSxxx boards with AR9344 SOC
use the OKLI lzma kernel loader
with the offset of 3 blocks of length 4k (0x3000)
in order to have a fake "kernel" that cannot grow larger
than how it is defined in the now static OEM partition table.

Before recent changes to the mtdsplit driver,
the uImage parser for OKLI only supported images
that started exactly on an eraseblock boundary.

The mtdsplit parser for uImage now supports identifying images
with any magic number value
and at any offset from the eraseblock boundary
using DTS properties to define those values.

So, it is no longer necessary to use fixed sizes
for kernel and rootfs

Tested-by: Andrew Cameron <apcameron@softhome.net>  [CPE510 v2]
Tested-by: Bernhard Geier <freifunk@geierb.de>      [WBS210 v2]
Tested-by: Petrov <d7c48mWsPKx67w2@gmail.com>       [CPE210 v1]
Signed-off-by: Michael Pratt <mcpratt@pm.me>
2021-06-05 23:39:14 +02:00
Georgi Vlaev a46ad596a3 ramips: add support for TP-Link Archer C6U v1 (EU)
This patch adds support for TP-Link Archer C6U v1 (EU).
The device is also known in some market as Archer C6 v3.
This patch supports only Archer C6U v1 (EU).

Specifications:
--------------

* SoC: Mediatek MT7621AT 2C2T, 880MHz
* RAM: 128MB DDR3
* Flash: 16MB SPI NOR flash (Winbond 25Q128)
* WiFi 5GHz: Mediatek MT7613BEN (2x2:2)
* WiFi 2.4GHz: Mediatek MT7603EN (2x2:2)
* Ethernet: MT7630, 5x 1000Base-T.
* LED: Power, WAN, LAN, WiFi 2GHz and 5GHz, USB
* Buttons: Reset, WPS.
* UART: Serial console (115200 8n1), J1(GND:3)
* USB: One USB2 port.

Installation:
------------

Install the OpenWrt factory image for C6U is from the
TP-Link web interface.

1) Go to "Advanced/System Tools/Firmware Update".
2) Click "Browse" and upload the OpenWrt factory image:
openwrt-ramips-mt7621-tplink_archer-c6u-v1-squashfs-factory.bin.
3) Click the "Upgrade" button, and select "Yes" when prompted.

Recovery to stock firmware:
--------------------------

The C6U bootloader has a failsafe mode that provides a web
interface (running at 192.168.0.1) for reverting back to the
stock TP-Link firmware. The failsafe interface is triggered
from the serial console or on failed kernel boot. Unfortunately,
there's no key combination that enables the failsafe mode. This
gives us two options for recovery:

1) Recover using the serial console (J1 header).
The recovery interface can be selected by hitting 'x' when
prompted on boot.

2) Trigger the bootloader failsafe mode.
A more dangerous option is force the bootloader into
recovery mode by erasing the OpenWrt partition from the
OpenWrt's shell - e.g "mtd erase firmware". Please be
careful, since erasing the wrong partition can brick
your device.

MAC addresses:
-------------

OEM firmware configuration:
D8:07:B6:xx:xx:83 : 5G
D8:07:B6:xx:xx:84 : LAN (label)
D8:07:B6:xx:xx:84 : 2.4G
D8:07:B6:xx:xx:85 : WAN

Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
2021-05-26 23:10:25 +02:00
Vinay Patil f8f8935adb ramips: add support for TP-Link Archer A6 v3
The patch adds support for the TP-Link Archer A6 v3
The router is sold in US and India with FCC ID TE7A6V3

Specification
-------------
MediaTek MT7621 SOC
RAM:         128MB DDR3
SPI Flash:   W25Q128 (16MB)
Ethernet:    MT7530 5x 1000Base-T
WiFi 5GHz:   Mediatek MT7613BE
WiFi 2.4GHz: Mediatek MT7603E
UART/Serial: 115200 8n1

Device Configuration & Serial Port Pins
---------------------------------------
ETH Ports:    LAN4 LAN3 LAN2 LAN1 WAN
             _______________________
             |                     |
Serial Pins: |   VCC GND TXD RXD   |
             |_____________________|

LEDs:         Power Wifi2G Wifi5G LAN WAN

Build Output
------------
The build will generate following set of files
[1] openwrt-ramips-mt7621-tplink_archer-a6-v3-initramfs-kernel.bin
[2] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-factory.bin
[3] openwrt-ramips-mt7621-tplink_archer-a6-v3-squashfs-sysupgrade.bin

How to Use - Flashing from TP-Link Web Interface
------------------------------------------------
* Go to "Advanced/System Tools/Firmware Update".
* Click "Browse" and upload the OpenWrt factory image: factory.bin[2]
* Click the "Upgrade" button, and select "Yes" when prompted.

TFTP Booting
------------
Setup a TFTP boot server with address 192.168.0.5.
While starting U-boot press '4' key to stop autoboot.
Copy the initramfs-kernel.bin[1] to TFTP server folder, rename as test.bin
From u-boot command prompt run tftpboot followed by bootm.

Recovery
--------
Archer A6 V3 has recovery page activated if SPI booting from flash fails.
Recovery page can be activated from serial console only.
Press 'x' while u-boot is starting
Note: TFTP boot can be activated only from u-boot serial console.
Device recovery address: 192.168.0.1

Thanks to: Frankis for Randmon MAC address fix.

Signed-off-by: Vinay Patil <post2vinay@gmail.com>
[remove superfluous factory image definition, whitespacing]
Signed-off-by: David Bauer <mail@david-bauer.net>
2021-05-26 23:10:14 +02:00
David Adair 2d15468323 ccache: Build with ENABLE_DOCUMENTATION=OFF
This adjusts the Makefile to use the new option to turn off the
doc builds. It will not cause any problems except a warning
about unused options if combined with a ccache source missing
the upstream patch.

Since a config setting is required to re-enable the doc build this
is equivalent to unconditionally disabling the docs if the config
setting is not created.

Signed-off-by: David Adair <djabhead@aol.com>
2021-05-23 15:11:38 +02:00
Ruslan Isaev 7a70f78fb7 fakeroot: Alpine linux libc.musl build error fix
Prevent build error on Alpine Linux host:
libfakeroot.c error: conflicting types for 'id_t'
Error relocating openwrt/staging_dir/host/lib/libfakeroot.so: SEND_GET_XATTR: symbol not found

Signed-off-by: Ruslan Isaev <legale.legale@gmail.com>
2021-05-23 15:11:19 +02:00
Kevin Darbyshire-Bryant baf2a50ef3 firmware-utils: fix coverity zytrx.c resource leak
fix coverity resource leak warning:

    	*len = stat.st_size;
    	mapped = mmap(NULL, stat.st_size, PROT_READ, MAP_SHARED, fd, 0);
    	if (close(fd) < 0)
CID 1484880:  Resource leaks  (RESOURCE_LEAK)
Variable "mapped" going out of scope leaks the storage it points to.
    		return NULL;
    	return mapped;
    }

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-05-20 11:56:38 +01:00
Bjørn Mork 48cad07a55 firmware-utils: zytrx: Add util for ZyXEL specific header
The ZyXEL NR7101 prepend an additional header to U-Boot images. This
header use the TRX magic 0x30524448 (HDR0), but is incompatible with
TRX images.

This code is reverse-engineered based on matching 32 bit numbers
found in the header with lengths and different checksum
calculations of the vendor images found on the device.  The result
was matched against the validation output produced by the
bootloader to name the associated header fields.

Example bootloader validation output:

 Zyxel TRX Image 1 --> Found!  Header Checksum OK
 ============ZyXEL header information==================
         chipId             : MT7621A
         boardId            : NR7101
         modelId            : 07 01 00 01
         kernel_len         : (14177560)
         kernelChksum       : (0x8DD31F69)
         swVersionInt       : 1.00(ABUV.0)D1
         swVersionExt       : 1.00(ABUV.0)D1

 Zyxel TRX Image 2 --> Found!  Header Checksum OK
 ============ZyXEL header information==================
         chipId             : MT7621A
         boardId            : NR7101
         modelId            : 07 01 00 01
         kernel_len         : (14176660)
         kernelChksum       : (0x951A7637)
         swVersionInt       : 1.00(ABUV.0)D0
         swVersionExt       : 1.00(ABUV.0)D0

 =================================================
 Check image validation:
 Image1 Header Magic Number --> OK
 Image2 Header Magic Number --> OK
 Image1 Header Checksum --> OK
 Image2 Header Checksum --> OK
 Image1 Data Checksum --> OK
 Image2 Data Checksum --> OK
 Image1 Stable Flag --> Stable
 Image1 Try Counter --> 0
 Image1: OK
 Image2: OK

The coverage and algorithm for the kernelChksum field is unknown.
This field is not validated by the bootloader or the OEM firmware
upgrade tool. It is therefore set to a static value for now.

The swVersion fields contain free form string values.  The OEM firmware
use ZyXEL structured version numbers as shown above.  The strings are
not interpreted or validated on boot, so they can be repurposed for
anything we want the bootloader to display to the user.  But the OEM
web GUI fails to flash images with freeform strings.

The purpose of the other strings in the header is not known.  The
values appear to be static.  We assume they are fixed for now, until
we have other examples.  One of these strings is the platform name,
which is taken as an input parameter for support other members of
the device family.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
2021-05-09 09:15:44 +02:00
Alex Henrie dfef88b6ca tplink-safeloader: fix product_name of TP-Link AD7200
The stock firmware does not accept firmware with "Talon" in the name.

Tested on firmware version 1.0.10 Build 20160902 rel. 57400 which came
preinstalled, as well as latest firmware version 2.0.1 Build 20170103
rel.71053 flashed from
AD7200v1-up-ver2-0-1-P1[20170103-rel71053]_2017-01-04_10.08.28.bin.

Fixes: 1a775a4fd0 ("ipq806x: add support for TP-Link Talon AD7200")
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
[added details about vendor firmware]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-05-06 09:51:58 +02:00
DENG Qingfang 3ebfd0078d ccache: update to 4.2.1
Update ccache to 4.2.1

Signed-off-by: DENG Qingfang <dqfext@gmail.com>
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com> [refresh patch]
2021-04-23 20:57:33 +02:00
Rafał Miłecki 5eb3508ad2 firmware-utils: tplink-safeloader: support displaying fw info
Add "-i" option for reading & displaying firmware info. First it lists
in-firmware partitions ("fwup-ptn"). Then it checks for human
understandable partitions and prints data found in each of them.

This new feature is meant for development & debug purposes.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-14 14:04:04 +02:00
Rafał Miłecki d4f2c2914a firmware-utils: mkmylofw: fix blocks padding
The old code didn't make sense as it was using "len" variable which was
guaranteed to be always 0. Loop right above broken code is:
while (len > 0) { }

With this recent ALIGN macro fix this resulted in subtracting block size
from 0 and calling write_out_padding() with a negative length.

To calculate amount of bytes needed for padding & alignment it should be
enough to use % 4.

Fixes: a2f6622945 ("firmware-utils: fix few random warnings")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-13 14:00:49 +02:00
Rafał Miłecki 489aa752d7 firmware-utils: zyimage: drop POSIX SOURCE defines
This fixes:
src/zyimage.c:10:0: warning: "_POSIX_SOURCE" redefined
src/zyimage.c:11:0: warning: "_POSIX_C_SOURCE" redefined

This change has been tested on Linux with -Wextra and on Mac OS.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-13 13:18:17 +02:00
Petr Štetiar e6d66375cb tplink-safeloader: fix C7v5 factory flashing from vendor fw > v1.1.x
Currently it's not possible to flash factory images on devices shipped
with vendor firmware versions 1.1.0 Build 20201120 rel. 50406 (published
2020-12-22):

 (curFw_ver, newFw_ver) == (1.1, 1.0) [NM_Error](nm_checkSoftVer) 00848: Firmwave not supports, check failed.
 [NM_Error](nm_checkUpdateContent) 01084: software version dismatched
 [NM_Error](nm_buildUpgradeStruct) 01188: checkUpdateContent failed.

They've even following note in release notes:

 Note: You will be unable to downgrade to the previous firmware version
       after updating this firmware.

This version check in vendor firmware is implemented in
/usr/bin/nvrammanager binary likely as following C code[1]:

 sscanf(buf, "%d.%d.%*s",&upd_fw_major, &upd_fw_minor);
 ...
 if (((int)upd_fw_major < (int)cur_fw_major) ||
     ((ret = 1, cur_fw_major == upd_fw_major && (upd_fw_minor < (int)cur_fw_minor)))) {
       ret = 0;
       printf("[NM_Error](%s) %05d: Firmwave not supports, check failed.\r\n\r\n","nm_checkSoftVer" ,0x350);
 }
 ...
 return ret;

So in order to fix this and make it future proof it should be enough to
ship our factory firmware images with major version 7 (lucky number).

Tested on latest firmware version 1.1.2 Build 20210125 rel.37999:

 Firmwave supports, check OK.
  (curFw_ver, newFw_ver) == (1.1, 7.0) check firmware ok!

Flashing back to vendor firmware
c7v5_us-up-ver1-1-2-P1[20210125-rel37999]_2021-01-25_10.33.55.bin works
as well:

 U-Boot 1.1.4-gbec22107-dirty (Nov 18 2020 - 18:19:12)
 ...
 Firmware downloaded... filesize = 0xeeae77 fileaddr = 0x80060000.
 Firmware Recovery file length : 15642231
 Firmware process id 2.
 handle_fw_cloud 146
 Image verify OK!
 Firmware file Verify ok!
 product-info:product_name:Archer C7
 product_ver:5.0.0
 special_id:55530000
 [Error]sysmgr_cfg_checkSupportList(): 1023 @ specialId 45550000 NOT Match.
 Firmware supports, check OK.
 Firmware Recovery check ok!

1. https://gist.github.com/ynezz/2e0583647d863386a66c3d231541b6d1

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2021-04-13 10:29:25 +02:00
Rafał Miłecki 1a55a2b112 firmware-utils: add -Wall to most tools
This helps spotting possible problems

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 11:05:57 +02:00
Rafał Miłecki 69e9138080 firmware-utils: fix -Wpointer-sign warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 11:05:54 +02:00
Rafał Miłecki 052a30d65e firmware-utils: fix -Wmaybe-uninitialized warnings
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 10:46:15 +02:00
Rafał Miłecki a2f6622945 firmware-utils: fix few random warnings
1. -Wunused-label
2. -Wparentheses
3. -Wmisleading-indentation
4. -Wformat-overflow

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 10:46:15 +02:00
Rafał Miłecki 7c01e2bac1 firmware-utils: fix unused variable warnings
This fixes warnings from the:
1. -Wunused-variable
2. -Wunused-but-set-variable

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 10:46:15 +02:00
Rafał Miłecki e65b633a5b firmware-utils: fix all -Wformat warnings
1. Use %hhu for uint8_t
2. Use %z for size_t

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-09 10:46:15 +02:00
Rafał Miłecki 9b4fc4cae9 firmware-utils: bcm4908img: convert into a package
bcm4908img is a tool managing BCM4908 platform images. It's used for
creating them as well as checking, modifying and extracting data from.

It's required by both: host (for building firmware images) and target
(for sysupgrade purposes). Make it a host/target package.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-08 10:50:59 +02:00
Rafał Miłecki 5a2086d230 firmware-utils: bcm4908img: fix uninitialized var usage
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-08 10:50:59 +02:00
Rafał Miłecki ed7edf88e2 firmware-utils: bcm4908img: extract bootfs without padding
JFFS2 bootfs partition in a BCM4908 image usually includes some padding.
For flashing it individually (writing to designed MTD partition) we want
just JFFS2 data.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 08:02:41 +02:00
Rafał Miłecki dcbde11af1 firmware-utils: bcm4908img: fix extracting cferom
Fix offset to extract proper data when image contains vendor header.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 00:22:37 +02:00
Rafał Miłecki e33957c241 firmware-utils: bcm4908img: support extracting bootfs & rootfs
It's required for upgrading firmware using single partitions instead of
just blindly writing whole image.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 00:21:40 +02:00
Rafał Miłecki 5314cab729 firmware-utils: bcm4908img: replace size with offset
It's much easier to operate on BCM4908 image data with absolute offset
of each section stored. It doesn't require summing sizes over and over.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-07 00:12:01 +02:00
Rafał Miłecki ed847ef5f3 firmware-utils: bcm4908img: add bootfs support
This adds support for accessing bootfs JFFS2 partition in the BCM4908
image. Support includes:
1. Listing files
2. Renaming file (requires unchanged name length)

Above commands are useful for flashing BCM4908 images which by defualt
come with cferom.000 file and require renaming it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2021-04-05 10:13:05 +02:00