Commit Graph

1794 Commits

Author SHA1 Message Date
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