Commit Graph

1359 Commits (93034bf7f0a246cd99ca9bfa7c8961ae26989a37)

Author SHA1 Message Date
Daniel Engberg 93034bf7f0 tools/mpfr: Update to 4.0.2
Update mpfr to 4.0.2
Use official site as last resort
Force thread-safety functionality
Refresh patches

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

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

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

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

Specifications:

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

Flash instructions:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Flash instructions:

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

Flash instruction using tftp recovery:

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

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

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

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

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

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

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

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

    the older

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

    reference yielded the following warning:

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

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

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

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

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

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

Flash instructions:

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

Flash instruction using tftp recovery:

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

Changes since first revision:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Shamelessly copy some byte swap functions from oseama.c

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

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

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

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

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

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

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

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

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

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

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

I assume a CVE number will be assigned soon.

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

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

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

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

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

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

Fixes build issues seen due to the kernel being too big

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

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

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

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

        pkg-config --cflags -- pkg-name

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

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

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

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

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

Reordered patches by date.

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

This fixes build problem seen by the build bots.

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