Commit Graph

1389 Commits (33b81b572148e2de52fbcb986e238c2efbd1939f)

Author SHA1 Message Date
Hans Dedecker 77429a820f tools/cmake: update to 3.13.2
Update to the latest stable version and refresh patches; see
https://cmake.org/cmake/help/v3.13/release/3.13.html for the latest
changes in 3.13.x

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

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

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

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

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

    the older

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

    reference yielded the following warning:

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

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

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

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

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

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

Flash instructions:

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

Flash instruction using tftp recovery:

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

Changes since first revision:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Shamelessly copy some byte swap functions from oseama.c

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

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

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

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

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

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

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

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

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

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

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

I assume a CVE number will be assigned soon.

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

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

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

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

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

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

Fixes build issues seen due to the kernel being too big

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

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

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

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

        pkg-config --cflags -- pkg-name

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

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

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

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

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

Reordered patches by date.

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

This fixes build problem seen by the build bots.

Fixes: 4797dddfde ("patch: apply upstream cve fixes")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 07e8c217cb tools: patch: make patch build depend on automake
The Makefile.am changed and now patch wants to use automake to
regenerate the Makefile.in. Make sure automake was build before we build
patch.

This fixes build problem seen by the build bots.
Fixes: 4797dddfde ("patch: apply upstream cve fixes")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Russell Senior 4797dddfde patch: apply upstream cve fixes
Apply two upstream patches to address two CVEs:

 * CVE-2018-1000156
 * CVE-2018-6952

Add PKG_CPE_ID to Makefile.

Build tested on apm821xx and ar71xx.

Signed-off-by: Russell Senior <russell@personaltelco.net>
6 years ago
Tobias Schramm 8f697e406a mkfwimage: Add image type definition for WA images
This patch adds a new type of ubiquiti image, the WA image. First seen
on the NanoStation AC loco the generic name implies that we will see
this type of image on more ubiquiti devices thus it makes sense to
implement it in mkfwimage.

The main difference is that WA images are signed. The "END" header has
been replaced by a "ENDS" header followed by a 2048 bit RSA signature.
This signature is not being generated by mkfwimage and filled with 0x00.

Signed-off-by: Tobias Schramm <tobleminer@gmail.com>
6 years ago
Daniel Engberg f6159c1e37 tools/cmake: Update to 3.12.3
Update CMake to 3.12.3

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 9efd0cb403 tools/bison: Update to 3.1
Update bison to 3.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 6bdc6cdd04 tools/libressl: Update to 2.8.1
Update libressl to 2.8.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 7808ba86ea tools/mtools: Update to 4.0.19
Update mtools to 4.0.19

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Felix Fietkau 03c7c8c853 tools/e2fsprogs: fix build with clang
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Marko Ratkaj 6e80dd58bb tools/expat: fix docbook2man error on some systems
On some systems (Gentoo) configure stage fails because of docbook2man
working with SGML rather than with XML. We don't need xmlwf man pages so
we disable this.

Signed-off-by: Marko Ratkaj <marko.ratkaj@sartura.hr>
6 years ago
Daniel Engberg 3e734e822b tools/expat: Update to 2.2.6
Update (lib)expat to 2.2.6

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg c6a0d57ca9 tools/e2fsprogs: Update to 1.44.4
Update e2fsprogs to 1.44.4

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
INAGAKI Hiroshi 7a67b437e7 firmware-utils: mkedimaximg: add "big-endianness mode" option
In addition to the default little-endianness format, I added a mode
so that we can generate firmware with big-endianness format.

example: ELECOM WRC-300GHBK2-I (QCA9563)

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
6 years ago
Daniel Engberg 791a3a22ad tools/cmake: Update to 3.12.2
Update CMake to 3.12.2

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
David Bauer 8e9a59a6b9 build: add mkrasimage
The current make-ras.sh image generation script for the ZyXEL NBG6617
has portability issues with bash. Because of this, factory images are
currently not built correctly by the OpenWRT buildbots.

This commit replaces the make-ras.sh by C-written mkrasimage.

The new mkrasimage is also compatible with other ZyXEL devices using
the ras image-format.
This is not tested with the NBG6616 but it correctly builds the
header for ZyXEL factory image.

Signed-off-by: David Bauer <mail@david-bauer.net>
6 years ago
Ryan Mounce 9c6c7d11c7 firmware-utils/mksercommfw: fix build with clang/macOS
fixes error: non-void function 'main' should return a value

Fixes: FS#1770

Signed-off-by: Ryan Mounce <ryan@mounce.com.au>
6 years ago
Andy Walsh 22b8237ba1 firmware-utils/mksercommfw: fix musl build
* add missing <sys/types.h> for musl

Signed-off-by: Andy Walsh <andy.walsh44+github@gmail.com>
6 years ago
Daniel Engberg 0578993a41 tools/cmake: Update to 3.12.1
Update cmake to 3.12.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Ludwig Thomeczek e5b802b9c2 firmware-utils: add sercomm/netgear tool
This adds a tool to generate a firmware file accepted
by Netgear or sercomm devices.

They use a zip-packed rootfs with header and a custom
checksum. The generated Image can be flashed via the
nmrpflash tool or the webinterface of the router.

Signed-off-by: Ludwig Thomeczek <ledesrc@wxorx.net>
6 years ago
Luis Araneda caebb77b45 tools: findutils: fix compilation with glibc 2.28
Add a temporary workaround to compile with glibc 2.28
as some constants were removed and others made private

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Luis Araneda 8ae8489986 tools: m4: fix compilation with glibc 2.28
Add a temporary workaround to compile with glibc 2.28
as some constants were removed and others made private

Signed-off-by: Luis Araneda <luaraneda@gmail.com>
6 years ago
Andrew Cameron bae927c551 ar71xx: add support for TP-LINK CPE510 V2.0
Adds Support for the TP-LINK CPE510 V2.0 by TP-Link.
The hardware is almost the same as the CPE510 V1.0
Follow the same processes as for the CPE510 V1.0

Signed-off-by: Andrew Cameron <apcameron@softhome.net>
6 years ago
Keith Maika 4caab80830 ar71xx: add support for TP-Link Archer C59 v2
TP-Link Archer C59v2 is a dual-band AC1350 router based on
Qualcomm/Atheros QCA9561+QCA9886 chips.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- USB 2.0 port
- UART header on PCB

Flash instruction:
  - via web UI:
    1. Download openwrt-ar71xx-generic-archer-c59-v2-squashfs-factory.bin
    2. Login to router and open the Advanced tab
    3. Navigate to System Tools -> Firmware Upgrade
    4. Upload firmware using the Manual Upgrade form
  - via TFTP:
    1. Set PC to fixed ip address 192.168.0.66
    2. Download openwrt-ar71xx-generic-archer-c59-v2-squashfs-factory.bin
       and rename it to tp_recovery.bin
    3. Start a tftp server with the file tp_recovery.bin in its root directory
    4. Turn off the router
    5. Press and hold Reset button
    6. Turn on router with the reset button pressed and wait ~15 seconds
    7. Release the reset button and after a short time
       the firmware should be transferred from the tftp server
    8. Wait ~30 second to complete recovery.

Signed-off-by: Keith Maika <keithm@aoeex.com>
6 years ago
Daniel Engberg b078229412 tools/cmake: Update to 3.12.0
Update cmake to 3.12.0
Remove 140-curl-fix-libressl.patch as fix is in upstream

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg df5f914b83 tools/e2fsprogs: Update to 1.44.3
Update e2fsprogs to 1.44.3

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Mathias Kresin a07e1126bc tools: kernel2minor: update to latest version
9fa9190 create reproducible images

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Hannu Nyman 7ec931b7f0 tools/ccache: update to 3.4.2
update version and refresh patch

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Hannu Nyman 55fa8068c4 tools/cmake: update to 3.11.4
Update cmake and refresh patches.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
6 years ago
Hyeonsik Song c2766270ef firmware-utils: tplink-safeloader: add calloc error handling
Signed-off-by: Hyeonsik Song <blogcin@naver.com>
6 years ago
Peter Lundkvist 781ad46206 ath79: add support for TP-Link RE450 v2
TP-Link RE450 v2 is a dual band router/range-extender
based on Qualcomm/Atheros QCA9563 + QCA9880.

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 (needs unmounted R64 & R69 0201 resistors/jumpers)

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

U-Boot does not seem to have any recovery functions, so
debricking requires connection via UART.

Signed-off-by: Peter Lundkvist <peter.lundkvist@gmail.com>
6 years ago
Lucian Cristian 4ec9763ee9 firmware-utils: tplink-safeloader: switch tl-wr1043nd-v4 to dynamic partitions
Use the new dynamic partition split in tplink-safeloader so we no longer
have to worry about kernel size increases.

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Alex Maclean 97da92b127 firmware-utils: tplink-safeloader: switch RE350 to dynamic partitions
Use the new dynamic partition split in tplink-safeloader so we no longer
have to worry about kernel size increases.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean 408c54b02f firmware-utils: tplink-safeloader: add dynamic partitions
Add support to dynamically split the firmware partition into os-image
and file-system partitions. This is done by replacing those entries in
the partition table with a single unified firmware partition, which is
then split according to actual kernel image size.

The factory image will have the file-system partition aligned to a 64K
erase block, but the sysupgrade image skips this and aligns only the
JFFS2 EOF marker to squeeze out more space.

This should prevent further creeping updates to the kernel partition
size while maximizing space for the overlay filesystem on smaller
devices.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Alex Maclean 0a2f21fa71 firmware-utils: mktplinkfw: add rootfs offset for combined images
Add an option (-O) to calculate rootfs offset for combined images.

This is needed for the TP-Link mtdsplit driver to locate the rootfs
when the start is not aligned to an erase block. This will be the
case for sysupgrade images produced by tplink-safeloader with upcoming
dynamic partition splitting.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Adrian Schmutzler 5c5bf8b865
ar71xx: Add support for TP-Link CPE210 v2
This PR adds support for a popular low-cost 2.4GHz N based AP

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

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

Notes:
TP-Link does not use bootstrap registers so without this patch reference
clock detects as 40MHz while it is actually 25MHz.
This is due to messed up bootstrap resistor configuration on the PCB.
Provided GPL code just forces 25MHz reference clock.
That causes booting with completely wrong clocks, for example, CPU tries
to boot at 1040MHz while the stock is 650MHz.
So this PR depends on PR #672 to remove 40MHz reference clock.
Thanks to Sven Eckelmann <sven@narfation.org> for properly patching that.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
6 years ago
Arvid E. Picciani bf39d5594b ar71xx: add support for TP-LINK Archer C7 v5
TP-Link Archer C7 v5 is a dual-band AC1750 router, based on Qualcomm/Atheros
QCA9563+QCA9880.

Specification:

- 750/400/250 MHz (CPU/DDR/AHB
- 128 MB of RAM (DDR2)
- 16 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 3T3R 5 GHz
- 5x 10/100/1000 Mbps Ethernet
- 10x LED, 2x button
- UART header on PCB

Flash instruction:
1. Upload lede-ar71xx-generic-archer-c7-v5-squashfs-factory.bin via Web interface

Flash instruction using TFTP recovery:
1. Set PC to fixed ip address 192.168.0.66
2. Download lede-ar71xx-generic-archer-c7-v5-squashfs-factory.bin
and rename it to ArcherC7v5_tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root directory
4. Turn off the router
5. Press and hold Reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time
the firmware should be transferred from the tftp server
8. Wait ~30 second to complete recovery.

Signed-off-by: Arvid E. Picciani <aep@exys.org>
6 years ago
Krystian Kozak 142477e751 b43-tools: update to latest git HEAD
122ca37 Rename bits in hostflags to match new identifiers for the hostflags
32c2a3c Change order of identifiers to be ascending with the spr numbers
f7016b5 Remove definitions which are not Broadcom specific
b77c0a3 debug: Fix ordering of HF bits
3f46e61 fwcutter: Add firmware 9.10.178.27
27892ef fwcutter/make: Avoid _DEFAULT_SOURCE warning

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
6 years ago
Lucian Cristian 71ae0792ba ath79: add tl-wr1043nd-v4 support everything is working
tplink-safeloader: resize kernel partition
kernel 4.14 is much bigger, resize the partition

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
6 years ago
Zoltan HERPAI 3e0489dcd9 tools: build squashfs (v3) for ath79
Certain Netgear and AVM devices use BE squashfs for the kernel image. As
squashfs4 only supports creating LE images, add squashfs (v3) into
the tools to be built for ath79.

Trying to use an LE squashfs (thus trying to use squashfs4 only for
building the image) for the kernel image results in the bootloader
barfing and stopping.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Signed-off-by: Zoltan HERPAI <wigyori@uid0.hu>
6 years ago
Daniel Engberg df02e7a3c7 tools/bison: Update to 3.0.5
Update bison to 3.0.5
Bugfix release
Remove 001-fix-macos-vasnprintf.patch as it is fixed upstream

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 651a62353b tools/e2fsprogs: Update to 1.44.2
Update e2fsprogs to 1.44.2

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Krystian Kozak 0e9927d157 sparse: updated to version 0.5.2
Updated to latest stable release

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
6 years ago
Krystian Kozak c844d6a8e4 imx-uuc: updated to latest git HEAD
8e29d86 linuxrc: remove superfluous shebang line
12d2045 gitignore: remove Windows stuff
57d8969 Add travis hint
8edf4cc sdimage: use fsync before closing the device (fixes #1)
d395b31 uuc: fix some compiler warnings

Signed-off-by: Krystian Kozak <krystian.kozak20@gmail.com>
6 years ago
Jo-Philipp Wich 4da832e201 tools: zlib: do not hardcode the install prefix in zlib.pc
Our pkg-config wrapper relies on the ability to redefine the $prefix and
$exec_prefix variables in order to construct proper search paths relative
to the build environment.

Patch the .pc file template to construct libdir, sharedlibdir and includedir
relative to the ${prefix} variable so that it can be overridden as needed.

This also fixes the libxml2/host build issue raised at
https://github.com/openwrt/packages/issues/6073 - it was caused by libxml2's
configure picking up a wrong host search path through zlib.pc, letting it
include the wrong endian.h, causing spurious member redeclaration errors in
system headers.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Stefan Lippers-Hollmann b72b36653a ipq806x: increase kernel partition size for the TP-Link Archer C2600
The default image does not fit 2 MB anymore, expand os-image partition
to 4 MB.

Upgrading works transparently via sysupgrade in both directions.
Another option would have been to merge "os-image" and "rootfs" into a
single "firmware" partition using MTD_SPLIT_TPLINK_FW, but just
changing the sizes of the existing partitioning has been deemed safer
and actually tested on an affected device; the maximum for rootfs
changes from 27 MB to 25 MB.

Run-tested on TP-Link Archer C2600.

Signed-off-by: Joris de Vries <joris@apptrician.nl>
[slh: extend comments and commit message, rename rootfs]
Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
6 years ago
Daniel Engberg bc5283381c tools/cmake: Update to 3.11.1
Update cmake to 3.11.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 93959bd86d tools/xz: Update to 5.2.4
Update to 5.2.4
Remove FreeBSD fix as it's not needed
Disable docs

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 0f5e01b691 tools/mm-macros: Update to 0.9.12
Update mm-macros to 0.9.12

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg 2d913fc48d tools/sed: Update to 4.5
Update sed to 4.5

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Linus Walleij 20d0dace40 firmware-utils: add DNS-313 image header tool
This tool is used to create headers on images for the
D-Link DNS-313 in gemini target.
Will be used after switching gemini to 4.14 kernel.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
6 years ago
Felix Fietkau 56ae9f9b0b mtd-utils: add back macOS compatibility code that was dropped during the update
Signed-off-by: Felix Fietkau <nbd@nbd.name>
6 years ago
Hauke Mehrtens 60427a940f tools/make-ext4fs: Fix build on MacOSX
MacOSX does not support "-Wl,-Bstatic" so do not force the static
linking.
We only copy the static libz library into the staging libraries
directories, the linker will anyway only find the static version and
link against that on all systems.

Fixes: 8dcd941d8b ("tools/zlib: move zlib build to tools")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens 2c192b6916 tools/libressl: update to version 2.7.2
Libressl version 2.7.0 and later implement more of the OpenSSL 1.1 API
and this needs some modifications of the code using it.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Hauke Mehrtens c7cd166479 tools/mtd-utils: update to version 2.0.2
This version now uses autotools to configure the build system. They are
also using the newly added zlib package.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Hauke Mehrtens bf167f8a9a tools/mtd-utils: Mark some lzma functions as static
These functions are not declared in any header file and only used in
same compile unit, mark them as static to remove one gcc warning and
make it easier for the compiler to optimize them out.

This also fixes some style problems to make this patch match the version
in the packages folder.

This is copied from this commit to the mtd-utils we pack into the image:
56d0dd56e9 ("mtd-utils: Mark some lzma functions as static")

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Hauke Mehrtens 8dcd941d8b tools/zlib: move zlib build to tools
This allows us to link the other tools against our libz and we do not
need the system zlib any more.

Only the static linked library is copied to the staging directory so we
have a statically linked library on all systems and not only on Linux.
This also adds the new dependencies of the packages which are depending
on zlib.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
6 years ago
Alex Maclean a31107a97a firmware-utils: tplink-safeloader: increase RE350 kernel size
4.14 increased kernel size, so grow the kernel partition by 128K to compensate.

Fixes FS#1479.

Signed-off-by: Alex Maclean <monkeh@monkeh.net>
6 years ago
Jo-Philipp Wich a656ea0bdb tools: mkimage: provide dtc path during build
The new mkimage version requires a CONFIG_MKIMAGE_DTC_PATH variable to be
provided during build, in order to hardcode a path to a suitable DT
compiler executable.

Failure to do so will result in stray "sh: 1: -I: not found" errors when
invoking mkimage for FIT image generation.

Fix the issue by supplying "dtc" as CONFIG_MKIMAGE_DTC_PATH value during
build. As we intend our host utilities to be relocatable and since we're
already overriding PATH when invoking mkimage, an absolute path is not
required.

Fixes: b13e981d72 ("tools/mkimage: update to version 2018.03")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Hauke Mehrtens b13e981d72 tools/mkimage: update to version 2018.03
This activates support for fit images and some other new mkimage
features. Some of the patches were applied upstream and could be
removed.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
6 years ago
Daniel Engberg 85282ae69c tools/mpfr: Update to 4.0.1
Update mpfr to 4.0.1

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Daniel Engberg a8c315192b tools/cmake: Update to 3.11.0
Update cmake to 3.11.0
Remove 110-alpine_musl-compat.patch as it's integrated upstream
Rename and refresh patches

Signed-off-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
6 years ago
Matthias Schiffer e39847ea2f
ar71xx: increase kernel partition size for CPE/WBS 210/510
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Matthias Schiffer 373dc11b51
firmware-utils: tplink-safeloader: move CPE/WBS 210/510 version metainfo to the end
Having the metainfo between kernel and rootfs prevents us from resizing
the kernel partition as necessary.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
6 years ago
Henryk Heisig c0742307a1 ar71xx: add support for TP-Link Archer C60 v2
TP-Link Archer C60 v2 is a dual-band AC1350 router, based on
Qualcomm/Atheros QCA9561 + QCA9886.

Specification:

- 775/650/258 MHz (CPU/DDR/AHB)
- 64 MB of RAM (DDR2)
- 8 MB of FLASH (SPI NOR)
- 3T3R 2.4 GHz
- 2T2R 5 GHz
- 5x 10/100 Mbps Ethernet
- 7x LED, 2x button
- UART header on PCB

Flash instruction (web):

Download lede-ar71xx-generic-archer-c60-v2-squashfs-factory.bin and use
OEM System Tools - Firmware Upgrade site.

Flash instruction (recovery):

1. Set PC to fixed IP address 192.168.0.66
2. Download lede-ar71xx-generic-archer-c60-v2-squashfs-factory.bin and
   rename it to tp_recovery.bin
3. Start a tftp server with the file tp_recovery.bin in its root
   directory
4. Turn off the router
5. Press and hold reset button
6. Turn on router with the reset button pressed and wait ~15 seconds
7. Release the reset button and after a short time the firmware should
   be transferred from the tftp server
8. Wait ~30 second to complete recovery

Flash instruction (under U-Boot, using UART):

tftp 0x81000000 lede-ar71xx-...-sysupgrade.bin
erase 0x9f030000 +$filesize
cp.b $fileaddr 0x9f030000 $filesize
reset

Signed-off-by: Henryk Heisig <hyniu@o2.pl>
6 years ago
Nicolò Veronese 0d8a0a6a17
firmware-utils: image generator for D-Link DAP-1330
Signed-off-by: Nicolò Veronese <nicveronese@gmail.com>
6 years ago
Paul Wassi 8262179f4a tools/e2fsprogs: update to 1.44.1
Update e2fsprogs to upstream 1.44.1 (feature and bugfix release)

Signed-off-by: Paul Wassi <p.wassi@gmx.at>
6 years ago
Mathias Kresin 9fc916a40c firmware-utils: mkdlinkfw: compile as gnu99
Compile as gnu99 to fix the build.

Signed-off-by: Mathias Kresin <dev@kresin.me>
6 years ago
Pawel Dembicki 84c1b786b9 firmware-utils: add JBOOT bootloader image support
Tested on D-Link DWR-116.
Based on mktplinkfw.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
6 years ago
Alexander Couzens 3137622efb
firmware-utils: tplink-safeloader: compile as gnu99
Also fix minor coding style issue and one redeclaration.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
6 years ago
Jo-Philipp Wich 677d8df9b8 firmware-utils: fix erroneous variable redeclaration
Fixes: 638e2193fe ("tplink-safeloader: add support to split & extract firmwares")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years ago
Alexander Couzens 068ba612db
tplink-safeloader: add support to convert factory into sysupgrade
Those converted factory images can be used to regain the original
tp-link firmware.
Be aware of firmware upgrade which additional require changes of
other partition than os-image (kernel) & file-system (rootfs).
OEM factory images from tplink can change nearly all partitions.
However using those images, OpenWrt's sysupgrade will only
modify the partitions os-image and file-system.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
6 years ago