openwrt/openwrt.git
3 years agoramips: add support for HooToo HT-TM05
Russell Morris [Wed, 25 Dec 2019 00:38:36 +0000 (18:38 -0600)]
ramips: add support for HooToo HT-TM05

The HooToo HT-TM05 is a battery powered router, with an Ethernet and USB port.
Vendor U-Boot limited to 1.5 MB kernel size, so use lzma loader (loader-okli).

Specifications:

  SOC:     MediaTek MT7620N
  BATTERY: 10400mAh
  WLAN:    802.11bgn
  LAN:     1x 10/100 Mbps Ethernet
  USB:     1x USB 2.0 (Type-A)
  RAM:     64 MB
  FLASH:   GigaDevice GD25Q64, Serial 8 MB Flash, clocked at 50 MHz
           Flash itself specified to 80 MHz, but speed limited by mt7620 SPI
           fast-read enabled (m25p)
  LED:     Status LED (blue after boot, green with WiFi traffic
           4 leds to indicate power level of the battery (unable to control)
  INPUT:   Power, reset button

MAC assignment based on vendor firmware:

  2.4 GHz    *:b4   (factory 0x04)
  LAN/label  *:b4   (factory 0x28)
  WAN        *:b5   (factory 0x2e)

Tested and working:

 - Ethernet
 - 2.4 GHz WiFi (Correct MAC-address)
 - Installation from TFTP (recovery)
 - OpenWRT sysupgrade (Preserving and non-preserving), through the usual
   ways: command line and LuCI
 - LEDs (except as noted above)
 - Button (reset)
 - I2C, which is needed for reading battery charge status and level
 - U-Boot environment / variables (from U-Boot, and OpenWrt)

Installation:

 - Download the needed OpenWrt install files, place them in the root
   of a clean TFTP server running on your computer. Rename the files as,
   - ramips-mt7620-hootoo_tm05-squashfs-kernel.bin => kernel
   - ramips-mt7620-hootoo_tm05-squashfs-rootfs.bin => rootfs
 - Plug the router into your computer via Ethernet
 - Set your computer to use 10.10.10.254 as its IP address
 - With your router shut down, hold down the power button until the first
   white LED lights up.
 - Push and hold the reset button and release the power button. Continue
   holding the reset button for 30 seconds or until it begins searching
   for files on your TFTP server, whichever comes first.
 - The router (10.10.10.128) will look for your computer at 10.10.10.254
   and install the two files. Once it has finished installation, it will
   automatically reboot and start up OpenWrt.
 - Set your computer to use DHCP for its IP address

Notes:

 - U-Boot environment can be modified, u-boot-env is preserved on initial
   install or sysupgrade
 - mtd-concat functionality is included, to leave a "hole" for u-boot-env,
   combining the OEM kernel and rootfs partitions

I would like to thank @mpratt14 and @xabolcs for their help getting the
lzma loader to work!

Signed-off-by: Russell Morris <rmorris@rkmorris.us>
[drop changes in image/Makefile, fix indent and PKG_RELEASE in
uboot-envtools, fix LOADER_FLASH_OFFS, minor commit message facelift,
add COMPILE to Device/Default]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: image: add recipe for OKLI loader
Chuanhong Guo [Wed, 2 Sep 2020 06:22:30 +0000 (14:22 +0800)]
ramips: image: add recipe for OKLI loader

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
3 years agoramips: lzma-loader: make FLASH_START configurable
Chuanhong Guo [Wed, 2 Sep 2020 06:22:29 +0000 (14:22 +0800)]
ramips: lzma-loader: make FLASH_START configurable

FLASH_START is supposed to point at the memory area where NOR flash are
mapped. We currently have an incorrect FLASH_START copied from ar71xx
back then and the loader doesn't work under OKLI mode.
On ramips, mt7621 has it's flash mapped to 0x1fc00000 and other SoCs
uses 0x1c000000. This commit makes FLASH_START a configurable value to
handle both cases.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
3 years agopolicycoreutils: add nls.mk
Rosen Penev [Wed, 2 Sep 2020 21:25:19 +0000 (14:25 -0700)]
policycoreutils: add nls.mk

Fixes compilation under uClibc-ng.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agokernel: remove obsolete kernel version switches for 4.14
Adrian Schmutzler [Fri, 7 Aug 2020 12:21:10 +0000 (14:21 +0200)]
kernel: remove obsolete kernel version switches for 4.14

This removes switches dependent on kernel version 4.14 as well as
several packages/modules selected only for that version.

This also removes sched-cake-virtual, which is not required anymore
now that we have only one variant of cake.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agokernel: remove support for kernel 4.14
Adrian Schmutzler [Fri, 7 Aug 2020 12:29:11 +0000 (14:29 +0200)]
kernel: remove support for kernel 4.14

No target uses kernel 4.14 anymore.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoramips: drop support for kernel 4.14
Adrian Schmutzler [Fri, 7 Aug 2020 14:35:05 +0000 (16:35 +0200)]
ramips: drop support for kernel 4.14

The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agopistachio: drop support for kernel 4.14
Adrian Schmutzler [Thu, 20 Aug 2020 12:26:27 +0000 (14:26 +0200)]
pistachio: drop support for kernel 4.14

The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoarc770: drop support for kernel 4.14
Adrian Schmutzler [Fri, 7 Aug 2020 14:34:09 +0000 (16:34 +0200)]
arc770: drop support for kernel 4.14

The target seems to be working on 5.4, so drop 4.14 support in
preparation for removing it from master entirely.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agosamsung: drop target
Adrian Schmutzler [Fri, 7 Aug 2020 14:11:39 +0000 (16:11 +0200)]
samsung: drop target

This target is still on kernel 4.14, and no attempt has been made to
update it to a newer kernel. Since we already are two LTS versions ahead
of that the target is dropped, as the chance of somebody bumping it will
only decrease with time.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agorb532: drop target
Adrian Schmutzler [Fri, 7 Aug 2020 14:08:28 +0000 (16:08 +0200)]
rb532: drop target

This target is still on kernel 4.14, and recent attempts to move it to
kernel 5.4 have not led to success. The device tester reported that it
wouldn't boot with the following messages:

From sysupgrade:

  Press any key within 4 seconds to enter setup....
  loading kernel from nand... OK
  setting up elf image... OK
  jumping to kernel code

At this point the system hangs.

From CompactFlash:

  Press any key within 4 seconds to enter setup....
  Booting CF
  Loading kernel... done
  setting up elf image... kernel out of range kernel loading failed

The tester reported that the same was observed with current master
(kernel 4.14) as well. This looks like some kernel size restriction.

Since this target is quite old and only supports one device, and since
nobody else seemed interested in working on this for quite some time,
I decided to not put further work into analyzing the problem and drop
this together with the other 4.14-only targets.

Patchwork series:
https://patchwork.ozlabs.org/project/openwrt/list/?series=197066&state=*

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath25: drop target
Adrian Schmutzler [Fri, 7 Aug 2020 13:58:52 +0000 (15:58 +0200)]
ath25: drop target

This target still only works with kernel 4.14, and not so recent
attempts of getting newer kernel versions supported did not lead
to success. Therefore, drop the target, as we are already two
LTS kernel versions ahead and it does not seem like anybody will
pick up the work.

Patchwork series:
https://patchwork.ozlabs.org/project/openwrt/list/?series=169991&state=*

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agotools: sort alphabetically
Adrian Schmutzler [Mon, 31 Aug 2020 11:27:57 +0000 (13:27 +0200)]
tools: sort alphabetically

This sorts the added tools and builddir dependencies alphabetically
to make it easier to find something in the Makefile.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agotools: drop unused upslug2 and wrt350nv2-builder
Adrian Schmutzler [Mon, 31 Aug 2020 11:17:54 +0000 (13:17 +0200)]
tools: drop unused upslug2 and wrt350nv2-builder

These tools have been used by the orion target which has been
removed in Jan 2020 [1].

Both were specifically meant for the WRT350Nv2, which is not
supported anymore.

So, let's remove them as well.

[1] 89f2deb372b7 ("orion: remove unmaintained target")

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agombedtls: update to 2.16.8
Magnus Kroken [Tue, 1 Sep 2020 20:28:25 +0000 (22:28 +0200)]
mbedtls: update to 2.16.8

This release of Mbed TLS provides bug fixes and minor enhancements. This
release includes fixes for security issues and the most notable of them
are described in more detail in the security advisories.

* Local side channel attack on RSA and static Diffie-Hellman
* Local side channel attack on classical CBC decryption in (D)TLS
* When checking X.509 CRLs, a certificate was only considered as revoked
if its revocationDate was in the past according to the local clock if
available.

Full release announcement:
https://github.com/ARMmbed/mbedtls/releases/tag/v2.16.8

Signed-off-by: Magnus Kroken <mkroken@gmail.com>
3 years agobase-files: fix comment typo in lib/functions/network.sh
Walter Sonius [Tue, 1 Sep 2020 21:49:54 +0000 (23:49 +0200)]
base-files: fix comment typo in lib/functions/network.sh

Fix typo in comment.

Signed-off-by: Walter Sonius <walterav1984@gmail.com>
[commit title/message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agohostapd: add hs20 variant
Daniel Golle [Tue, 1 Sep 2020 20:31:20 +0000 (21:31 +0100)]
hostapd: add hs20 variant

Add hostapd variant compiled with support for Hotspot 2.0 AP features.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agotools/squashfskit4: fix build on non-linux systems
Felix Fietkau [Tue, 1 Sep 2020 13:37:14 +0000 (15:37 +0200)]
tools/squashfskit4: fix build on non-linux systems

The xattr related function calls are linux specific

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: remove an obsolete patch that is no longer doing anything useful
Felix Fietkau [Sat, 29 Aug 2020 05:50:07 +0000 (07:50 +0200)]
mac80211: remove an obsolete patch that is no longer doing anything useful

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomac80211: add more AQL fixes/improvements
Felix Fietkau [Thu, 27 Aug 2020 11:02:42 +0000 (13:02 +0200)]
mac80211: add more AQL fixes/improvements

Fix aggregation length estimation, add HE and VHT160 support

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agomediatek/ramips: unify ethernet driver fixes and add performance optimizations
Felix Fietkau [Thu, 27 Aug 2020 04:39:48 +0000 (06:39 +0200)]
mediatek/ramips: unify ethernet driver fixes and add performance optimizations

Increase DMA burst size and tx ring size and optimize tx processing

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agobuild: fix path to libfakeroot on macOS
Felix Fietkau [Tue, 1 Sep 2020 15:00:45 +0000 (17:00 +0200)]
build: fix path to libfakeroot on macOS

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agorefpolicy: skip building docs
Daniel Golle [Tue, 1 Sep 2020 13:34:15 +0000 (14:34 +0100)]
refpolicy: skip building docs

Building docs requires xmllint and other bulky things being present on
the host. Skip that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolibaudit: add host-build required by policycoreutils/host
Daniel Golle [Tue, 1 Sep 2020 13:23:07 +0000 (14:23 +0100)]
libaudit: add host-build required by policycoreutils/host

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolibsemanage: host-build depends on renamed libaudit package
Daniel Golle [Tue, 1 Sep 2020 11:29:51 +0000 (12:29 +0100)]
libsemanage: host-build depends on renamed libaudit package

Fixes: efdf619f21 ("audit: build only libaudit")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agougps: update to the latest version
Hauke Mehrtens [Tue, 1 Sep 2020 11:04:23 +0000 (13:04 +0200)]
ugps: update to the latest version

511a5b3 ugps: fix 64-bit time_t

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agofstools: update to the latest version
Hauke Mehrtens [Tue, 1 Sep 2020 11:00:52 +0000 (13:00 +0200)]
fstools: update to the latest version

5345343 fstoools: add define for GLOB_ONLYDIR

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agomediatek: pull in some fixes fromt he latest SDK
John Crispin [Tue, 1 Sep 2020 07:09:13 +0000 (09:09 +0200)]
mediatek: pull in some fixes fromt he latest SDK

Signed-off-by: John Crispin <john@phrozen.org>
3 years agouboot-mediatek: update to latest version
John Crispin [Tue, 1 Sep 2020 07:08:52 +0000 (09:08 +0200)]
uboot-mediatek: update to latest version

Signed-off-by: John Crispin <john@phrozen.org>
3 years agobuild: unbreak fakeroot in SDK
Daniel Golle [Tue, 1 Sep 2020 03:08:47 +0000 (04:08 +0100)]
build: unbreak fakeroot in SDK

Using fakeroot without passing the paths to libfakeroot.sh and faked
causes havoc. Use the $(FAKEROOT) Make variable which includes them.

Fixes: 353ce2e521 ("build: ipkg-build use fakeroot with PKG_FILE_MODES")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agotools: fakeroot: pass paths of libfakeroot.so and faked
Daniel Golle [Tue, 1 Sep 2020 03:07:11 +0000 (04:07 +0100)]
tools: fakeroot: pass paths of libfakeroot.so and faked

Fixes: 9e7ef46065 ("tools: add fakeroot")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agolibaudit: drop unused file
Daniel Golle [Mon, 31 Aug 2020 23:31:22 +0000 (00:31 +0100)]
libaudit: drop unused file

Drop init script from libaudit package. It will be added to the
'audit' package in the packages feed.

Fixes: efdf619f21 ("audit: build only libaudit")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobuild: opkg-key variable key folder
Paul Spooren [Wed, 26 Aug 2020 00:55:27 +0000 (14:55 -1000)]
build: opkg-key variable key folder

The key folder is used by `opkg` and `usign` to store and retrieve
trusted public keys. Using `opkg-key` outside a running device is
unfeasible as the key folder is hard coded to `/etc/opkg/keys`.

This commit adds a variable OPKG_KEYS which defaults to `/etc/opkg/keys`
if unset, however allows set arbitrary key folder locations.

Arbitrary key folder locations are useful to add signature verification
to the ImageBuilders.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agopx5g-wolfssl: cleanup Makefile and SPDX license
Paul Spooren [Mon, 31 Aug 2020 20:55:04 +0000 (10:55 -1000)]
px5g-wolfssl: cleanup Makefile and SPDX license

Minor cosmetic cleanups of the Makefile and add a SPDX compatible
license headers.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agolibsemanage: add missing package metadata
Daniel Golle [Mon, 31 Aug 2020 21:01:46 +0000 (22:01 +0100)]
libsemanage: add missing package metadata

License and CPE-ID were missing, add them.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoaudit: build only libaudit
Daniel Golle [Mon, 31 Aug 2020 20:49:36 +0000 (21:49 +0100)]
audit: build only libaudit

Turns out auditd depends on libev. Lets have that in packages.git.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agostrace: Update to version 5.8
Hauke Mehrtens [Mon, 24 Aug 2020 09:47:52 +0000 (11:47 +0200)]
strace: Update to version 5.8

Deactivate multiple personalities support, because this causes compile
problems at least on the x86/64 target. As OpenWrt compiles all
binaries itself all binaries will use the native personality which is
also used by strace. This change will make it impossible to debug i386
binaries on x86_64 OpenWrt targets for example.

Just deactivate it for ARM64 too.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agoutil-linux: update to 2.36
Rosen Penev [Fri, 7 Aug 2020 21:23:39 +0000 (14:23 -0700)]
util-linux: update to 2.36

hwclock was fixed to work with musl.

Unfortunately, the fix breaks under musl 1.2.x. Backported patch to fix
that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agolibcxx: update to 10.0.0
Rosen Penev [Sat, 29 Aug 2020 03:17:39 +0000 (20:17 -0700)]
libcxx: update to 10.0.0

Switched to upstream tarballs.

Switched to libcxxabi as using libsupc++ is quite wonky.

Fixed description.

Removed patches. The fixes are cosmetic.

Added ssp patch. This one is needed for i386 and powerpc under musl.

Compile tested every C++ package in the tree with the exception of
several boost packages. There's something broken with boost.

Ran tested with gerbera.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agolibcxxabi: add
Rosen Penev [Sat, 29 Aug 2020 03:17:38 +0000 (20:17 -0700)]
libcxxabi: add

This will be used for libcxx.

libcxxabi is needed as libsupc++ is not good enough for libcxx. It uses
GCC specific stuff which causes failed compilation for some packages.
There are also runtime issues, most notably with cxxopts where the
program just crashes.

Reference: https://github.com/gerbera/gerbera/issues/795

Added patch to fix ARM compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years agotoolchain: Update GCC 10 to version 10.2.0
DENG Qingfang [Tue, 25 Aug 2020 04:03:28 +0000 (12:03 +0800)]
toolchain: Update GCC 10 to version 10.2.0

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
3 years agotoolchain/binutils: add binutils 2.35
DENG Qingfang [Tue, 25 Aug 2020 03:55:05 +0000 (11:55 +0800)]
toolchain/binutils: add binutils 2.35

Add binutils version 2.35

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
3 years agocheckpolicy: build-depend on libselinux
Daniel Golle [Mon, 31 Aug 2020 19:41:21 +0000 (20:41 +0100)]
checkpolicy: build-depend on libselinux

Static libraries and headers of libselinux and libsepol are required
for checkpolicy to build.
Fixes error:
policy_parse.y:45:10: fatal error: sepol/policydb/expand.h: No such file or directory
 #include <sepol/policydb/expand.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agopolicycoreutils: fix i18n depends
Daniel Golle [Mon, 31 Aug 2020 19:36:32 +0000 (20:36 +0100)]
policycoreutils: fix i18n depends

Fixes build error:
load_policy.c:11:10: fatal error: libintl.h: No such file or directory
 #include <libintl.h>  /* for gettext() */
          ^~~~~~~~~~~
 compilation terminated.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoath79: add support for Senao Engenius ENH202 v1
Michael Pratt [Mon, 17 Aug 2020 19:35:20 +0000 (15:35 -0400)]
ath79: add support for Senao Engenius ENH202 v1

FCC ID: U2M-ENH200

Engenius ENH202 is an outdoor wireless access point with 2 10/100 ports,
built-in ethernet switch, internal antenna plates and proprietery PoE.

Specification:

  - Qualcomm/Atheros AR7240 rev 2
  - 40 MHz reference clock
  - 8 MB FLASH                  ST25P64V6P (aka ST M25P64)
  - 32 MB RAM
  - UART at J3                  (populated)
  - 2x 10/100 Mbps Ethernet     (built-in switch at gmac1)
  - 2.4 GHz, 2x2, 29dBm         (Atheros AR9280 rev 2)
  - internal antenna plates     (10 dbi, semi-directional)
  - 5 LEDs, 1 button            (LAN, WAN, RSSI) (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Power LED not controllable, or unknown gpio

MAC addresses:

  eth0/eth1  *:11   art 0x0/0x6
  wlan       *:10   art 0x120c

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop or halt which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9f670000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to Engenius boards.
  If the failsafe image is missing or damaged this will not work
  DO NOT downgrade to ar71xx this way, can cause kernel loop or halt

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

Format of OEM firmware image:

  The OEM software of ENH202 is a heavily modified version
  of Openwrt Kamikaze bleeding-edge. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-enh202-uImage-lzma.bin
    openwrt-senao-enh202-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring, and by swapping headers to see
  what the OEM upgrade utility accepts and rejects.

  OKLI kernel loader is required because the OEM firmware
  expects the kernel to be no greater than 1024k
  and the factory.bin upgrade procedure would otherwise
  overwrite part of the kernel when writing rootfs.

Note on built-in switch:

  ENH202 is originally configured to be an access point,
  but with two ethernet ports, both WAN and LAN is possible.

  the POE port is gmac0 which is preferred to be
  the port for WAN because it gives link status
  where swconfig does not.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[assign label_mac in 02_network, use ucidef_set_interface_wan,
use common device definition, some reordering]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: add support for Senao Engenius ENS202EXT v1
Michael Pratt [Mon, 11 May 2020 20:58:02 +0000 (16:58 -0400)]
ath79: add support for Senao Engenius ENS202EXT v1

Engenius ENS202EXT v1 is an outdoor wireless access point with 2 10/100 ports,
with built-in ethernet switch, detachable antennas and proprietery PoE.

FCC ID: A8J-ENS202

Specification:

  - Qualcomm/Atheros AR9341 v1
  - 535/400/200/40 MHz          (CPU/DDR/AHB/REF)
  - 64 MB of RAM
  - 16 MB of FLASH              MX25L12835F(MI-10G)
  - UART (J1) header on PCB     (unpopulated)
  - 2x 10/100 Mbps Ethernet     (built-in switch Atheros AR8229)
  - 2.4 GHz, up to 27dBm        (Atheros AR9340)
  - 2x external, detachable antennas
  - 7x LED (5 programmable in ath79), 1x GPIO button (Reset)

Known Issues:

  - Sysupgrade from ar71xx no longer possible
  - Ethernet LEDs stay on solid when connected, not programmable

MAC addresses:

  eth0/eth1  *:7b   art 0x0/0x6
  wlan       *:7a   art 0x1002

  The device label lists both addresses, WLAN MAC and ETH MAC,
  in that order.

  Since 0x0 and 0x6 have the same content, it cannot be
  determined which is eth0 and eth1, so we chose 0x0 for both.

Installation:

  2 ways to flash factory.bin from OEM:

  - Connect ethernet directly to board (the non POE port)
      this is LAN for all images
  - if you get Failsafe Mode from failed flash:
      only use it to flash Original firmware from Engenius
      or risk kernel loop which requires serial cable

  Method 1: Firmware upgrade page:

    OEM webpage at 192.168.1.1
    username and password "admin"
    In upper right select Reset
    "Restore to factory default settings"
    Wait for reboot and login again
    Navigate to "Firmware Upgrade" page from left pane
    Click Browse and select the factory.bin image
    Upload and verify checksum
    Click Continue to confirm and wait 3 minutes

  Method 2: Serial to load Failsafe webpage:

    After connecting to serial console and rebooting...
    Interrupt boot with any key pressed rapidly
    execute `run failsafe_boot` OR `bootm 0x9fdf0000`
    wait a minute
    connect to ethernet and navigate to
    "192.168.1.1/index.htm"
    Select the factory.bin image and upload
    wait about 3 minutes

  *If you are unable to get network/LuCI after flashing*
  You must perform another factory reset:

    After waiting 3 minutes or when Power LED stop blinking:

    Hold Reset button for 15 seconds while powered on
    or until Power LED blinks very fast

    release and wait 2 minutes

Return to OEM:

  If you have a serial cable, see Serial Failsafe instructions

  *DISCLAIMER*
  The Failsafe image is unique to this model.
  The following directions are unique to this model.
  DO NOT downgrade to ar71xx this way, can cause kernel loop

  The easiest way to return to the OEM software is the Failsafe image
  If you dont have a serial cable, you can ssh into openwrt and run

  `mtd -r erase fakeroot`

  Wait 3 minutes
  connect to ethernet and navigate to 192.168.1.1/index.htm
  select OEM firmware image from Engenius and click upgrade

TFTP Recovery:

  For some reason, TFTP is not reliable on this board.
  Takes many attempts, many timeouts before it fully transfers.

  Starting with an initramfs.bin:

  Connect to ethernet
  set IP address and TFTP server to 192.168.1.101
  set up infinite ping to 192.168.1.1
  rename the initramfs.bin to "vmlinux-art-ramdisk" and host on TFTP server
  disconnect power to the board
  hold reset button while powering on board for 8 seconds

  Wait a minute, power LED should blink eventually if successful
  and a minute after that the pings should get replies
  You have now loaded a temporary Openwrt with default settings temporarily.
  You can use that image to sysupgrade another image to overwrite flash.

Format of OEM firmware image:

  The OEM software of ENS202EXT is a heavily modified version
  of Openwrt Kamikaze bleeding-edge. One of the many modifications
  is to the sysupgrade program. Image verification is performed
  simply by the successful ungzip and untar of the supplied file
  and name check and header verification of the resulting contents.
  To form a factory.bin that is accepted by OEM Openwrt build,
  the kernel and rootfs must have specific names...

    openwrt-senao-ens202ext-uImage-lzma.bin
    openwrt-senao-ens202ext-root.squashfs

  and begin with the respective headers (uImage, squashfs).
  Then the files must be tarballed and gzipped.
  The resulting binary is actually a tar.gz file in disguise.
  This can be verified by using binwalk on the OEM firmware images,
  ungzipping then untaring, and by swapping headers to see
  what the OEM upgrade utility accepts and rejects.

Note on the factory.bin:

  The newest kernel is too large to be in the kernel partition

  the new ath79 kernel is beyond   1592k
  Even ath79-tiny is               1580k

  Checksum fails at boot because the bootloader (modified uboot)
  expects kernel to be 1536k. If the kernel is larger, it gets
  overwritten when rootfs is flashed, causing a broken image.
  The mtdparts variable is part of the build and saving a new
  uboot environment will not persist after flashing.
  OEM version might interact with uboot or with the custom
  OEM partition at 0x9f050000.

  Failed checksums at boot cause failsafe image to launch,
  allowing any image to be flashed again.

  HOWEVER: one should not install older Openwrt from failsafe
  because it can cause rootfs to be unmountable,
  causing kernel loop after successful checksum.
  The only way to rescue after that is with a serial cable.

  For these reasons, a fake kernel (OKLI kernel loader)
  and fake squashfs rootfs is implemented to take care of
  the OEM firmware image verification and checksums at boot.
  The OEM only verifies the checksum of the first image
  of each partition respectively, which is the loader
  and the fake squashfs. This completely frees
  the "firmware" partition from all checks.

  virtual_flash is implemented to make use of the wasted space.
  this leaves only 2 erase blocks actually wasted.

  The loader and fakeroot partitions must remain intact, otherwise
  the next boot will fail, redirecting to the Failsafe image.

  Because the partition table required is so different
  than the OEM partition table and ar71xx partition table,
  sysupgrades are not possible until one switches to ath79 kernel.

Note on sysupgrade.tgz:

  To make things even more complicated, another change is needed to
  fix an issue where network does not work after flashing from either
  OEM software or Failsafe image, which implants the OEM (Openwrt Kamikaze)
  configuration into the jffs2 /overlay when writing rootfs from factory.bin.

  The upgrade script has this:

    mtd -j "/tmp/_sys/sysupgrade.tgz" write "${rootfs}" "rootfs"

  However, it also accepts scripts before and after:

    before_local="/etc/before-upgradelocal.sh"
    after_local="/etc/after-upgradelocal.sh"
    before="before-upgrade.sh"
    after="after-upgrade.sh"

  Thus, we can solve the issue by making the .tgz an empty file
  by making a before-upgrade.sh in the factory.bin

Note on built-in switch:

  There is two ports on the board, POE through the power supply brick,
  the other is on the board. For whatever reason, in the ar71xx target,
  both ports were on the built-in switch on eth1. In order to make use
  of a port for WAN or a different LAN, one has to set up VLANs.

  In ath79, eth0 and eth1 is defined in the DTS so that the
  built-in switch is seen as eth0, but only for 1 port
  the other port is on eth1 without a built-in switch.

  eth0: switch0
    CPU is port 0
    board port is port 1

  eth1: POE port on the power brick

  Since there is two physical ports,
  it can be configured as a full router,
  with LAN for both wired and wireless.

  According to the Datasheet, the port that is not on the switch
  is connected to gmac0. It is preferred that gmac0 is chosen as WAN
  over a port on an internal switch, so that link status can pass
  to the kernel immediately which is more important for WAN connections.

Signed-off-by: Michael Pratt <mpratt51@gmail.com>
[apply sorting in 01_leds, make factory recipe more generic, create common
device node, move label-mac to 02_network, add MAC addresses to commit
message, remove kmod-leds-gpio, use gzip directly]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: mikrotik: fix network setup for lhg-hb platform
Roger Pueyo Centelles [Fri, 28 Aug 2020 11:51:48 +0000 (13:51 +0200)]
ath79: mikrotik: fix network setup for lhg-hb platform

This network setup for MikroTik devices based on the LHG-HB platform
avoids using the integrated switch and connects the single Ethernet
port directly. This way, link speed (10/100 Mbps) is properly repor-
ted by eth0.

Fixes: FS#3309
Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
3 years agoath79: use correct MAC address for TP-Link TL-WPA8630 v2
Sven Wegener [Fri, 17 Apr 2020 22:19:51 +0000 (00:19 +0200)]
ath79: use correct MAC address for TP-Link TL-WPA8630 v2

The base address is used for the LAN and 2G WLAN interfaces.
5G WLAN interface is +1 and the PLC interface uses +2.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
[improve commit title, fix assignment in 11-ath10k-caldata]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoath79: add support for Meraki MR16
Martin Kennedy [Sat, 29 Aug 2020 04:22:53 +0000 (00:22 -0400)]
ath79: add support for Meraki MR16

Port device support for Meraki MR16 from the ar71xx target to ath79.

Specifications:

  * AR7161 CPU, 16 MiB Flash, 64 MiB RAM
  * One PoE-capable Gigabit Ethernet Port
  * AR9220 / AR9223 (2x2 11an / 11n) WLAN

Installation:

  * Requires TFTP server at 192.168.1.101, w/ initramfs & sysupgrade .bins
  * Open shell case and connect a USB to TTL cable to upper serial headers
  * Power on the router; connect to U-boot over 115200-baud connection
  * Interrupt U-boot process to boot Openwrt by running:
       setenv bootcmd bootm 0xbf0a0000; saveenv;
       tftpboot 0c00000 <filename-of-initramfs-kernel>.bin;
       bootm 0c00000;
  * Copy sysupgrade image to /tmp on MR16
  * sysupgrade /tmp/<filename-of-sysupgrade>.bin

Notes:

  - There are two separate ARTs in the partition (offset 0x1000/0x5000 and
    0x11000/0x15000) in the OEM device. I suspect this is an OEM artifact;
    possibly used to configure the radios for different regions,
    circumstances or RF frontends. Since the ar71xx target uses the
    second offsets, use that second set (0x11000 and 0x15000) for the ART.

  - kmod-owl-loader is still required to load the ART partition into the
    driver.

  - The manner of storing MAC addresses is updated from ar71xx; it is
    at 0x66 of the 'config' partition, where it was discovered that the
    OEM firmware stores it. This is set as read-only. If you are
    migrating from ar71xx and used the method mentioned above to
    upgrade, use kmod-mtd-rw or UCI to add the MAC back in. One more
    method for doing this is described below.

  - Migrating directly from ar71xx has not been thoroughly tested, but
    one method has been used a couple of times with good success,
    migrating 18.06.2 to a full image produced as of this commit. Please
    note that these instructions are only for experienced users, and/or
    those still able to open their device up to flash it via the serial
    headers should anything go wrong.

    1) Install kmod-mtd-rw and uboot-envtools
    2) Run `insmod mtd-rw.ko i_want_a_brick=1`
    3) Modify /etc/fw_env.config to point to the u-boot-env partition.
       The file /etc/fw_env.config should contain:

       # MTD device   env offset  env size    sector size
       /dev/mtd1      0x00000     0x10000     0x10000

       See https://openwrt.org/docs/techref/bootloader/uboot.config
       for more details.

    4) Run `fw_printenv` to verify everything is correct, as per the
       link above.
    5) Run `fw_setenv bootcmd bootm 0xbf0a0000` to set a new boot address.
    6) Manually modify /lib/upgrade/common.sh's get_image function:
       Change ...

       cat "$from" 2>/dev/null | $cmd

       ... into ...

       (
         dd if=/dev/zero bs=1 count=$((0x66)) ; # Pad the first 102 bytes
         echo -ne '\x00\x18\x0a\x12\x34\x56'  ; # Add in MAC address
         dd if=/dev/zero bs=1 count=$((0x20000-0x66-0x6)) ; # Pad the rest
         cat "$from" 2>/dev/null | $cmd
       )

       ... which, during the upgrade process, will pad the image by
       128K of zeroes-plus-MAC-address, in order for the ar71xx's
       firmware partition -- which starts at 0xbf080000 -- to be
       instead aligned with the ath79 firmware partition, which
       starts 128K later at 0xbf0a0000.

    7) Copy the sysupgrade image into /tmp, as above
    8) Run `sysupgrade -F /tmp/<sysupgrade>.bin`, then wait

    Again, this may BRICK YOUR DEVICE, so make *sure* to have your
    serial cable handy.

Addenda:

  - The MR12 should be able to be migrated in a nearly identical manner as
    it shares much of its hardware with the MR16.

  - Thank-you Chris B for copious help with this port.

Signed-off-by: Martin Kennedy <hurricos@gmail.com>
[fix typo in compat message, drop art DT label,
move 05_fix-compat-version to subtarget]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agolibsemanage: new package
Daniel Golle [Mon, 31 Aug 2020 12:37:08 +0000 (13:37 +0100)]
libsemanage: new package

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[update to 3.1]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
[removed python part for inclusion in core]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoaudit: new package
Thomas Petazzoni [Tue, 14 Jul 2020 21:36:10 +0000 (16:36 -0500)]
audit: new package

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[fix build with GCC 10 and disable MIPS16 as build emits sync instruction]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agobpftools: add utility and library packages supporting eBPF usage
Tony Ambardar [Thu, 20 Aug 2020 18:46:50 +0000 (11:46 -0700)]
bpftools: add utility and library packages supporting eBPF usage

Add support for building bpftool and libbpf from the latest 5.8.3 kernel
sources, ensuring up-to-date functionality and fixes. Both are written to
be backwards compatible, which simplfies build and usage across different
OpenWRT image kernels.

'bpftool' is the primary userspace tool widely used for introspection and
manipulation of eBPF programs and maps. Two variants are built: a 'full'
version which supports object disassembly and depends on libbfd/libopcodes
(total ~500KB); and a 'minimal' version without disassembly functions and
dependencies. The default 'minimal' variant is otherwise fully functional,
and both are compiled using LTO for further (~30KB) size reductions.

'libbpf' provides shared/static libraries and dev files needed for building
userspace programs that perform eBPF interaction.

Several cross-compilation and build-failure problems are addressed by new
patches and ones backported from farther upstream:

  * 001-libbpf-ensure-no-local-symbols-counted-in-ABI-check.patch
  * 002-libbpf-fix-build-failure-from-uninitialized-variable.patch
  * 003-bpftool-allow-passing-BPFTOOL_VERSION-to-make.patch
  * 004-v5.9-bpftool-use-only-ftw-for-file-tree-parsing.patch

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agomusl: add common glibc extention for nftw
Tony Ambardar [Mon, 13 Jul 2020 04:18:43 +0000 (21:18 -0700)]
musl: add common glibc extention for nftw

Add FTW_ACTIONRETVAL mode and update nftw library for walking file trees.
Update needed to build bpftool userspace utility from Linux kernel source.

Also increment PKG_RELEASE.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
3 years agobuild: switch VERSION_REPO to HTTPS
Paul Spooren [Thu, 27 Aug 2020 21:47:08 +0000 (11:47 -1000)]
build: switch VERSION_REPO to HTTPS

The variable VERSION_REPO is used by opkg to download package(list)s.
Now that the default installation support encrypted HTTP opkg should
make use of it.

Suggested-by: Petr Štetiar <ynezz@true.cz>
Suggested-by: Baptiste Jonglez <baptiste@bitsofnetworks.org>
Signed-off-by: Paul Spooren <mail@aparcar.org>
Acked-by: Baptiste Jonglez <baptiste@bitsofnetworks.org>
3 years agobuild: sort default packages and split by newlines
Paul Spooren [Thu, 27 Aug 2020 21:47:07 +0000 (11:47 -1000)]
build: sort default packages and split by newlines

The line of default packages became very long and it is easier to read
one package per line, therefore split it by newlines and sort it
alphabetically.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: add libustream and certs to default pkgs
Paul Spooren [Thu, 27 Aug 2020 21:47:06 +0000 (11:47 -1000)]
build: add libustream and certs to default pkgs

To allow HTTPS usage on a router it requires both certificates
(ca-bundle) and a fitting libustream library (libustream-wolfssl)

By adding both, uclient-fetch and wget can connect to encrypted HTTP.

This allows opkg to update package lists in a more secure fashion.

Suggested-by: Petr Štetiar <ynezz@true.cz>
Suggested-by: Baptiste Jonglez <baptiste@bitsofnetworks.org>
Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agotreewide: https for downloads.openwrt.org sources
Paul Spooren [Tue, 25 Aug 2020 20:52:22 +0000 (10:52 -1000)]
treewide: https for downloads.openwrt.org sources

Instead of using http and https for source downloads from
downloads.openwrt.org, always use https for it's better security.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: add whatdepends target to imagebuilder
Paul Spooren [Fri, 21 Aug 2020 01:44:51 +0000 (15:44 -1000)]
build: add whatdepends target to imagebuilder

The package manager `opkg` offers the function `whatdepends` to print
packages that depend on a specific package.

This feature is useful when used in a CI to not only build an upgraded
package but all packages with a dependency.

Usage:
    make whatdepends PACKAGE=libipset

The resulting list can be fed into a SDK building all packages and warn
if anything fails.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: store SourceDateEpoch in manifest
Paul Spooren [Sat, 15 Aug 2020 20:57:03 +0000 (10:57 -1000)]
build: store SourceDateEpoch in manifest

The usage of granular `SOURCE_DATE_EPOCH` for packages is an
incrementing integer which could be useful for downstream tooling,
therefore add it to the packages manifest.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: store granular timestamps in packages
Paul Spooren [Sat, 15 Aug 2020 20:57:02 +0000 (10:57 -1000)]
build: store granular timestamps in packages

With the new `SOURCE` argument of `get_source_date_epoch` it is possible
to set package timestamps based on actual package changes rather thane
$TOPDIR changes.

This commit adds a new variable PKG_SOURCE_DATE_EPOCH which is used by
the `ipkg` build script. As a fallback the existing SOURCE_DATE_EPOCH is
used or as last resort the current time.

The redundant checks for `.git/` and `.svn/` are removed.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: get_source_date_epoch allow external repos
Paul Spooren [Sat, 15 Aug 2020 20:57:01 +0000 (10:57 -1000)]
build: get_source_date_epoch allow external repos

The SOURCE_DATE_EPOCH variable is used to make builds reproducible even
if rebuild at different times. Instead of using the current timestamp,
the time of the last source change is used.

Created packages are `touch`ed with a specific timestamp so resulting
packages have the same checksums.

The `get_source_date_epoch.sh` script tries multiple ways (file, git,
hg) to determine the correct timestamp.

Until now the script would only consider the $TOPDIR instead of package
specific changes. Resulting in packages with same versions but different
timestamps, as $TOPDIR (openwrt.git) received changes not affecting
package versions. This results in warning/erros in `opkg` as the package
versions stay the same but checksums changed.

This commit adds an optional argument to get the `SOURCE_DATE_EPOCH` of
a specific path (e.g. package SOURCE) rather than the $TOPDIR. As a
consequence this allows granular but still reproducible timestamps.

As packages might be distributed over multiple repositories the check
for `.git/` becomes unfeasible. Instead tell `git` and `hg` to change
their working directories and automatically traverse the repo folder.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: Fix Shellcheck for get_source_date_epoch.sh
Paul Spooren [Sat, 15 Aug 2020 20:57:00 +0000 (10:57 -1000)]
build: Fix Shellcheck for get_source_date_epoch.sh

If a `cd` to `TOPDIR` fails the script should quit.

Also unify `try_mtime` function by storing it in a variable.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobusybox: Use PKG_FILE_MODES for SUID
Paul Spooren [Fri, 7 Aug 2020 21:13:01 +0000 (11:13 -1000)]
busybox: Use PKG_FILE_MODES for SUID

Instead of using INSTALL_SUID use the more flexible PKG_FILE_MODES
variable withn the Makefile to set the SUID bit.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agobuild: ipkg-build use fakeroot with PKG_FILE_MODES
Paul Spooren [Fri, 7 Aug 2020 21:13:00 +0000 (11:13 -1000)]
build: ipkg-build use fakeroot with PKG_FILE_MODES

The `ipkg-build` script converts a folder into a `opkg` installable
package. Until now it would use root:root for all packages and try to
preserve file modes.

This has the two drawbacks of packages want to add non-root files or add
SUID files, like the `sudo` package does.

To give more flexibility regarding file modes and avoid init script
hacks, a new variable called `PKG_FILE_MODES`. The variable contains a
list of files modes in the format `path:owner:group:mode`.

An example for the `sudo` package below:

```
PKG_FILE_MODES:=\
        /usr/bin/sudo:root:root:4755 \
        /etc/sudoers:root:root:0440
```

The `ipkg-build` now runs within a fakeroot environment to set any mode
and directly store it in the resulting `ipk` package archive.

Both options `-o` and `-g` are no longer required due to the introduction
of the more flexible `-m` options, which takes the `PKG_FILE_MODES` as
input.

Lastly the option `-c` is removed as it's unused within the script.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agoopkg: update to git HEAD
Daniel Golle [Mon, 31 Aug 2020 10:01:37 +0000 (11:01 +0100)]
opkg: update to git HEAD

 4318ab1 opkg: allow to configure the path to the signature verification script
 cf44c2f libopkg: fix compiler warning

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agopx5g: rename to px5g-mbedtls
Paul Spooren [Sun, 30 Aug 2020 07:37:29 +0000 (21:37 -1000)]
px5g: rename to px5g-mbedtls

Two versions of `px5g` exists without sharing code. For clarification
rename the previously existing MbedTLS based version to `px5g-mbedtls`
to exists next to `px5g-wolfssl`.

Rename code file of MbedTLS from `px5g.c` to `px5g-mbedtls.c`.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agopx5g-wolfssl: add package
Paul Spooren [Sat, 29 Aug 2020 08:18:53 +0000 (22:18 -1000)]
px5g-wolfssl: add package

This package creates certificates and private keys, just like `px5g`
does. Hower it uses WolfSSL rather than MbedTLS.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agowolfssl: add certgen config option
Paul Spooren [Sat, 29 Aug 2020 08:20:18 +0000 (22:20 -1000)]
wolfssl: add certgen config option

The option allows to generate certificates.

Signed-off-by: Paul Spooren <mail@aparcar.org>
3 years agonghttp2: move to packages.git
Hans Dedecker [Sat, 29 Aug 2020 18:54:56 +0000 (20:54 +0200)]
nghttp2: move to packages.git

As the package curl has been moved to packages.git and only libcurl
depends on libnghttps move it as well to packages.git.
This is based on the Hamburg  2019 decision that non essential packages
should move outside base.

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agorefpolicy: new package
Thomas Petazzoni [Mon, 24 Aug 2020 03:03:44 +0000 (22:03 -0500)]
refpolicy: new package

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[update to 2.20200229, adjust Makefile, and move to openwrt.git]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agocheckpolicy: new package
Thomas Petazzoni [Mon, 24 Aug 2020 03:02:45 +0000 (22:02 -0500)]
checkpolicy: new package

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[update to 3.1, make use of Python 3, and move to openwrt.git]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agopolicycoreutils: new package
Thomas Petazzoni [Mon, 24 Aug 2020 03:01:34 +0000 (22:01 -0500)]
policycoreutils: new package

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[update to 3.1, make use of Python 3, use ALTERNATIVES, and move to openwrt.git]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agokernel: add options needed for SELinux
Thomas Petazzoni [Mon, 24 Aug 2020 02:45:52 +0000 (21:45 -0500)]
kernel: add options needed for SELinux

This adds a number of options to config/Config-kernel.in so that
packages related to SELinux support can enable the appropriate Linux
kernel support.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[rebase; add ext4, F2FS, UBIFS, and JFFS2 support; add commit message]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agotools/squashfskit4: add xattr support to mksquashfs for SELinux
Thomas Petazzoni [Sat, 18 Jul 2020 18:53:24 +0000 (13:53 -0500)]
tools/squashfskit4: add xattr support to mksquashfs for SELinux

SELinux uses extended attributes to store SELinux security contexts.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[rebase, add commit message]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agobuild: add support for SELinux to include/image.mk
Thomas Petazzoni [Sat, 18 Jul 2020 13:01:54 +0000 (08:01 -0500)]
build: add support for SELinux to include/image.mk

This allows the build process to prepare a squashfs filesystem for use
with SELinux.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
[rebase, add commit message]
Signed-off-by: W. Michael Petullo <mike@flyn.org>
3 years agotools: add back lzma-old for ath79
David Bauer [Sun, 30 Aug 2020 21:34:41 +0000 (23:34 +0200)]
tools: add back lzma-old for ath79

lzma-old host package is required for building ath79 images, as
mksquashfs-lzma is required for generating netgear images.

Fixes commit 4e4ee4649553 ("ar71xx: drop target")

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agotools/coreutils: update to 8.32
Hannu Nyman [Mon, 24 Aug 2020 17:04:56 +0000 (20:04 +0300)]
tools/coreutils: update to 8.32

Update coreutils to version 8.32.
Remove upstreamed patch.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
3 years agoleds: add activity led trigger kernel module package
Sven Wegener [Tue, 12 May 2020 17:21:16 +0000 (19:21 +0200)]
leds: add activity led trigger kernel module package

The activity trigger flashes like the heartbeat trigger, but adjusts
based on system load.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
3 years agokernel: add missing symbol NET_DSA_TAG_RTL4_A
Hannu Nyman [Tue, 25 Aug 2020 17:40:00 +0000 (20:40 +0300)]
kernel: add missing symbol NET_DSA_TAG_RTL4_A

Fix build breakage caused by the missing kernel config symbol.

Fixes: 8735997686a3 ("kernel: backport RTL8366RB patches")
Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
3 years agoethtool: Update to version 5.8
Hauke Mehrtens [Mon, 24 Aug 2020 09:47:43 +0000 (11:47 +0200)]
ethtool: Update to version 5.8

The ipk sizes for mips_24Kc change like this:
old:
ethtool_5.4-1_mips_24kc.ipk 101.909

new:
ethtool_5.8-1_mips_24kc.ipk 109.699

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Hans Dedecker <dedeckeh@gmail.com>
3 years agoiproute2: Update to version 5.8
Hauke Mehrtens [Mon, 24 Aug 2020 09:47:25 +0000 (11:47 +0200)]
iproute2: Update to version 5.8

The ipk sizes for mips_24Kc change like this:
old:
ip-full_5.7.0-2_mips_24kc.ipk 165.786
ip-tiny_5.7.0-2_mips_24kc.ipk 117.730
tc_5.7.0-2_mips_24kc.ipk 144.405

new:
ip-full_5.8.0-1_mips_24kc.ipk 169.775
ip-tiny_5.8.0-1_mips_24kc.ipk 119.808
tc_5.8.0-1_mips_24kc.ipk 149.053

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agomac80211: Fix potential endless loop
Hauke Mehrtens [Sat, 29 Aug 2020 17:23:57 +0000 (19:23 +0200)]
mac80211: Fix potential endless loop

Backport a fix from kernel 5.8.3.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
3 years agoath79: increase kernel partition for ar9344 TP-Link CPE/WBS
Adrian Schmutzler [Sun, 30 Aug 2020 19:26:57 +0000 (21:26 +0200)]
ath79: increase kernel partition for ar9344 TP-Link CPE/WBS

The kernel has become too big again for the ar9344-based TP-Link
CPE/WBS devices which still have no firmware-partition splitter.

Current buildbots produce a kernel size of about 2469 kiB, while
the partition is only 2048 kiB (0x200000). Therefore, increase it
to 0x300000 to provide enough room for this and, hopefully, the
next kernel.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoar71xx: drop target
Adrian Schmutzler [Fri, 7 Aug 2020 13:25:12 +0000 (15:25 +0200)]
ar71xx: drop target

This target has been mostly replaced by ath79 and won't be included
in the upcoming release anymore. Finally put it to rest.

This also removes all references in packages, tools, etc. as well as
the uboot-ar71xx and vsc73x5-ucode packages.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agowireguard-tools: add tunlink option for hostroute
Aaron Goodman [Thu, 27 Aug 2020 01:27:40 +0000 (21:27 -0400)]
wireguard-tools: add tunlink option for hostroute

In a multi-wan setup, netifd may need guidance on which wan device to
use to create the route to the remote peer.

This commit adds a 'tunlink' option similar to other tunneling interfaces
such as 6in4, 6rd, gre, etc.

Signed-off-by: Aaron Goodman <aaronjg@stanford.edu>
3 years agokernel: bump 5.4 to 5.4.61
John Audia [Wed, 26 Aug 2020 10:29:39 +0000 (06:29 -0400)]
kernel: bump 5.4 to 5.4.61

Manually merged:
  backport-5.4
     011-kbuild-export-SUBARCH.patch
  layerscape
    701-net-0262-net-dsa-ocelot-add-tagger-for-Ocelot-Felix-switches.patch

All other modifications made by update_kernel.sh

Build-tested: x86/64, lantiq/xrx200, ramips/mt7621
Run-tested: ipq806x (R7800), lantiq/xrx200, x86/64, ramips (RT-AC57U)

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[minor commit message adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
3 years agoapm821xx: fix typos in .dts files
Christian Lamparter [Thu, 13 Aug 2020 15:47:07 +0000 (17:47 +0200)]
apm821xx: fix typos in .dts files

This patch fixes various typos or tab-vs-space issues in
the APM821XX device targets Device-Tree source files.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: use SPDX-License-identifiers
Christian Lamparter [Thu, 13 Aug 2020 15:39:10 +0000 (17:39 +0200)]
apm821xx: use SPDX-License-identifiers

Please note that the DTS are based on really old .DTS from vendors
themselves.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: apm821xx.dtsi fix comment styles
Christian Lamparter [Wed, 12 Aug 2020 20:08:42 +0000 (22:08 +0200)]
apm821xx: apm821xx.dtsi fix comment styles

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: MX60W: enumerate PCIe in device-tree
Christian Lamparter [Wed, 12 Aug 2020 20:03:27 +0000 (22:03 +0200)]
apm821xx: MX60W: enumerate PCIe in device-tree

This patch adds the pcie-switch and bridge configuration for
the Meraki MX60W.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: WNDR4700: delete wndr4700 board file
Christian Lamparter [Wed, 12 Aug 2020 17:52:08 +0000 (19:52 +0200)]
apm821xx: WNDR4700: delete wndr4700 board file

Thanks to the PCIE OF enumeration patch, this is technically
no longer needed.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: MR24: enumerate PCIe in device-tree
Christian Lamparter [Wed, 12 Aug 2020 16:26:43 +0000 (18:26 +0200)]
apm821xx: MR24: enumerate PCIe in device-tree

This patch adds the pcie-switch and bridge configuration for
the Meraki MR24.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: add missing cells-values for IIC1
Christian Lamparter [Wed, 12 Aug 2020 16:23:10 +0000 (18:23 +0200)]
apm821xx: add missing cells-values for IIC1

These are copied over from the IIC0.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: DTB: fix warnings related to sata-port warnings
Christian Lamparter [Wed, 12 Aug 2020 16:13:47 +0000 (18:13 +0200)]
apm821xx: DTB: fix warnings related to sata-port warnings

This patch silences the following warnings:
>netgear-wndr4700.dts:168.3-13:Warning (reg_format): /plb/sata@bffd1800/sata-port@0:reg:property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #address-cells value
>netgear-wndr4700.dts:167.26-170.4: Warning (avoid_default_addr_size):/plb/sata@bffd1800/sata-port@0: Relying on default #size-cells value

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: WNDAP6x0: enumerate PCIe in device-tree
Christian Lamparter [Wed, 12 Aug 2020 16:05:06 +0000 (18:05 +0200)]
apm821xx: WNDAP6x0: enumerate PCIe in device-tree

This patch adds the pcie-switch and bridge configuration of the
WNDAP620 and WNDAP660.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agoapm821xx: WNDR4700: enumerate PCIe in device-tree
Christian Lamparter [Tue, 11 Aug 2020 23:21:13 +0000 (01:21 +0200)]
apm821xx: WNDR4700: enumerate PCIe in device-tree

This patch adds the pcie-switch and bridge configuration of the
WNDR4700.

This allows to get rid of the legacy firmware monikers and drop
the usbport LED declaration.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
3 years agooxnas: kd20: revert accedintally commited change
Daniel Golle [Sat, 29 Aug 2020 00:13:56 +0000 (01:13 +0100)]
oxnas: kd20: revert accedintally commited change

Changing the factory image of KD20 was used during testing and wasn't
intended to be included in the commit fixing a SATA bug on oxnas.
Revert that part of the commit.

Fixes: 5793112f75 ("oxnas: reduce size of ATA DMA descriptor space")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agomvebu: LS421DE: add linkstation poweroff driver
Daniel González Cabanelas [Fri, 28 Aug 2020 09:20:46 +0000 (11:20 +0200)]
mvebu: LS421DE: add linkstation poweroff driver

Compile the Linkstation poweroff module for the Buffalo LS421DE.
Without this driver the device remains forever halted if a power off
command is executed.

The driver will also allow to use the WoL feature, which wasn't availabe
in the stock firmware.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
3 years agomvebu: backport linkstation-poweroff upstream driver
Daniel González Cabanelas [Fri, 28 Aug 2020 09:20:36 +0000 (11:20 +0200)]
mvebu: backport linkstation-poweroff upstream driver

Backport the Linkstation poweroff driver from the kernel upstream (commit
a7f79f99541ef)

This driver is required by the Buffalo LinkStation LS421DE for a correct
power off operation. It also allows to use the WoL feature.

Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com>
3 years agoramips: rt3883: use lzma-loader for DIR-645
Perry Melange [Wed, 26 Aug 2020 11:46:23 +0000 (13:46 +0200)]
ramips: rt3883: use lzma-loader for DIR-645

The DIR-645 fails to boot if the kernel is large.
Enabling lzma-loader resolves the issue.

Run-tested on D-Link DIR-645.

Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>