openwrt/openwrt.git
2 years agomac80211: improve rate control performance
Felix Fietkau [Sun, 6 Jun 2021 18:57:39 +0000 (20:57 +0200)]
mac80211: improve rate control performance

Call rate control handler after intermediate queueuing
Includes follow-up fixes

Signed-off-by: Felix Fietkau <nbd@nbd.name>
cherry-picked from commits:
7dd8829ef915f1c5fc728be8f8360c61ddaadf1b
a603e82dd342680d584c4eb5f1b222e056379890
8bb4437c01ca35a5ac67e391630a1b24cb52dbb7

2 years agobusybox: sysntpd: add trigger to reload server
Alexey Dobrovolsky [Sat, 5 Jun 2021 23:25:02 +0000 (02:25 +0300)]
busybox: sysntpd: add trigger to reload server

sysntpd server becomes unavailable if the index of the bound
interface changes. So let's add an interface trigger to reload sysntpd.

This patch also adds the ability for the sysntpd script to handle
uci interface name from configuration.

Fixes: 4da60500ebd2 ("busybox: sysntpd: option to bind server to iface")
Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
Reviewed-by: Philip Prindeville <philipp@redfish-solutions.com>
(cherry picked from commit 88114f617ae7bffe13d19d7b9575659a3d3cd9b6)

2 years agobusybox: sysntpd: option to bind server to iface
Alexey Dobrovolsky [Tue, 23 Feb 2021 14:43:02 +0000 (17:43 +0300)]
busybox: sysntpd: option to bind server to iface

NTPD in busybox has option -I to bind server to IFACE.
However, capabilities of the busybox are limited, the -I option cannot be
repeated and only one interface can be effectively specified in it.
This option is currently not configurable via UCI.
The patch adds an interface option to the system config, ntp section.
Also sort options for uci_load_validate alphabetically.

Signed-off-by: Alexey Dobrovolsky <dobrovolskiy.alexey@gmail.com>
(cherry picked from commit e12fcf0fe5597467f7cc21144e5f4da60500ebd2)

2 years agoiwinfo: update to latest Git HEAD
David Bauer [Sat, 1 May 2021 22:22:56 +0000 (00:22 +0200)]
iwinfo: update to latest Git HEAD

c45f0b5 iwinfo: add 802.11ax HE rate information

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 5515c29029ce7c63b48d1af0cbb3fbdc14ca033b)

2 years agoiwinfo: update to latest Git HEAD
David Bauer [Mon, 12 Apr 2021 22:13:33 +0000 (00:13 +0200)]
iwinfo: update to latest Git HEAD

50b64a6 iwinfo: add basic IEEE 802.11ax support
70d2136 iwinfo: nl80211: perform split wiphy dump
cd23727 iwinfo: cli: fix hwmode formatting

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 6f77ce77248d6458414efafd64c72d653fc70bb8)

2 years agokernel: bump 5.4 to 5.4.128
Hauke Mehrtens [Sat, 26 Jun 2021 19:08:19 +0000 (21:08 +0200)]
kernel: bump 5.4 to 5.4.128

Manually rebased
  bcm27xx/patches-5.4/950-0089-cgroup-Disable-cgroup-memory-by-default.patch
    Replaced with patch from Raspberry Pi kernel 5.10 patches
  mvebu/patches-5.4/002-PCI-aardvark-Don-t-rely-on-jiffies-while-holding-spi.patch
    Applied upstream

All others updated automatically.

Compile-tested on: ath79/generic, lantiq/xrx200, brcm27xx
Runtime-tested on: ath79/generic, lantiq/xrx200

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agolibusb: Fix parsing of descriptors for multi-configuration devices
Georgi Valkov [Wed, 3 Feb 2021 07:41:54 +0000 (09:41 +0200)]
libusb: Fix parsing of descriptors for multi-configuration devices

Prerequisite patch:
Correct a typo in the Changelog and clean up a stray file

Fix changes in libusb which introduced a regression:
Commit e2be556bd2 ("linux_usbfs: Parse config descriptors during device
initialization") introduced a regression for devices with multiple
configurations. The logic that verifies the reported length of the
configuration descriptors failed to count the length of the
configuration descriptor itself and would truncate the actual length by
9 bytes, leading to a parsing error for subsequent descriptors.

Signed-off-by: Georgi Valkov <gvalkov@abv.bg>
(cherry picked from commit 4b37e3bc2b2a079c996b6d97b8d3dbbd4ba6eb62)

2 years agobase-files: fix /tmp/TZ when zoneinfo not installed
Paul Spooren [Thu, 24 Jun 2021 17:42:53 +0000 (07:42 -1000)]
base-files: fix /tmp/TZ when zoneinfo not installed

The zoneinfo packages are not installed per default so neither
/tmp/localtime nor /tmp/TZ is generated.

This patch mostly reverts the previous fix and instead incooperates a
solution suggested by Jo.

Fixes "base-files: fix zoneinfo support " 8af62ed

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 56bdb6bb9781f8a0bbec5fc3075b9d2b8d12f9a8)

2 years agobase-files: fix zoneinfo support
Rosen Penev [Sat, 10 Apr 2021 00:22:48 +0000 (17:22 -0700)]
base-files: fix zoneinfo support

The system init script currently sets /tmp/localinfo when zoneinfo is
populated. However, zoneinfo has spaces in it whereas the actual files
have _ instead of spaces. This made the if condition never return true.

Example failure when removing the if condition:

/tmp/localtime -> /usr/share/zoneinfo/America/Los Angeles

This file does not exist. America/Los_Angeles does.

Ran through shfmt -w -ci -bn -sr -s

Signed-off-by: Rosen Penev <rosenp@gmail.com>
(cherry picked from commit 8af62ede189aa504135db05474d34c9f8a1ed35d)

2 years agoexfat: update to 5.12.3
Rosen Penev [Sun, 13 Jun 2021 04:26:17 +0000 (21:26 -0700)]
exfat: update to 5.12.3

Major changes are:
    Avoid page allocation failure from upcase table allocation.
    Add support for FITRIM.
    Improve write perofmrance on dirsync mount.
    Improve lookup perofmrance.
    Fix a bug on discard mount.

Switch to AUTORELEASE to avoid having to bump it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years agorealtek: Fix failsafe mode
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:21 +0000 (00:45 +0200)]
realtek: Fix failsafe mode

The RTL8380-RTL9300 switches only forward packets when VLAN ID 1 is
configured. Do not use the standard failsafe configuration for DSA
accessing the default port directly, but configure a switch on the lan1
interface instead.

This will add the VLAN ID 1 configuration to the switch:
$ bridge vlan show
port              vlan-id
lan1              1 PVID Egress Untagged
switch            1 PVID Egress Untagged

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit b7ee0786b56d1088c195fe7c1cdb1ad7d20c9245)

2 years agobase-files: failsafe: Remove the VLAN modifier from interface name
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:20 +0000 (00:45 +0200)]
base-files: failsafe: Remove the VLAN modifier from interface name

Some interfaces have a VLAN modifier like :t in lan1:t, this modifier
should be removed from the interface before calling preinit_ip_config().

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 790561d5109ef81537fdb8ceb8eb183c0cab077c)

2 years agobase-files: failsafe: Fix IP configuration
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:19 +0000 (00:45 +0200)]
base-files: failsafe: Fix IP configuration

Adapt the preinit_config_board() to the board.json network changes. It
now looks for the device and the ports variables to configure the LAN
network.

This works with swconfig configurations.

Fixes: FS#3866
Fixes: d42640e389a8 ("base-files: use "ports" array in board.json network for bridges")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 467cd378db3359814866ec4121fdb4417783241e)

2 years agokernel: Backport patch to automatically bring up DSA master when opening user port
Hauke Mehrtens [Mon, 21 Jun 2021 22:45:18 +0000 (00:45 +0200)]
kernel: Backport patch to automatically bring up DSA master when opening user port

Without this patch we have to manually bring up the CPU interface in
failsafe mode.

This was backported from kernel 5.12.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 2e17c710954bd3506467d700dee23757b138fedd)

2 years agokernel-5.4: backport latest patches for wireguard
Jason A. Donenfeld [Sun, 6 Jun 2021 10:37:53 +0000 (12:37 +0200)]
kernel-5.4: backport latest patches for wireguard

These are the latest patches that just landed upstream for 5.13, will be
backported by Greg into 5.10 (because of stable@), and are now in the
5.4 backport branch of wireguard: https://git.zx2c4.com/wireguard-linux/log/?h=backport-5.4.y

Cc: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Tested-by: Stijn Segers <foss@volatilesystems.org>
(cherry picked from commit 2a3b2f59fec10d7c08f90f019b310db418e775bf)

2 years agohostapd: fix handling of the channel utilization options
Timo Sigurdsson [Tue, 15 Jun 2021 21:12:08 +0000 (23:12 +0200)]
hostapd: fix handling of the channel utilization options

Commit 0a7657c ("hostapd: add channel utilization as config option") added the
two new uci options bss_load_update_period and chan_util_avg_period. However,
the corresponding "config_add_int" calls for these options weren't added, so
attempting to actually use these options and change their values is bound to
fail - they always stay at their defaults. Add the missing code to actually
make these options work.

Fixes: 0a7657c ("hostapd: add channel utilization as config option")
Signed-off-by: Timo Sigurdsson <public_timo.s@silentcreek.de>
(cherry picked from commit 85ce590705072be78c3ef7dc6b64e3b1facc892b)

2 years agobcm4908: fix Ethernet broken state after interface restart
Rafał Miłecki [Tue, 22 Jun 2021 05:47:18 +0000 (07:47 +0200)]
bcm4908: fix Ethernet broken state after interface restart

This fixes traffic stalls after ifdown & ifup.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit f8d5bd20b31842ef7fdb740d27c70294f21c6124)

2 years agobcm4908: add kmod-gpio-button-hotplug
Rafał Miłecki [Mon, 21 Jun 2021 06:49:03 +0000 (08:49 +0200)]
bcm4908: add kmod-gpio-button-hotplug

All bcm4908 devices are expected to have GPIO buttons to make relevant
package selected by default.
This "fixes" triggering failsafe mode.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit fcfa60408c37a129b143e4928b6d86e383c2c8f6)

2 years agobase-files: fix typo in config_generate MAC check
Rafał Miłecki [Mon, 14 Jun 2021 20:29:49 +0000 (22:29 +0200)]
base-files: fix typo in config_generate MAC check

Fixes: 125deb4d783e ("base-files: set MAC for bridge ports (devices) instead of bridge itself")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 946019637ec9192450c685a61c589a9cbef7637b)

2 years agobase-files: set MAC for bridge ports (devices) instead of bridge itself
Rafał Miłecki [Mon, 14 Jun 2021 18:18:14 +0000 (20:18 +0200)]
base-files: set MAC for bridge ports (devices) instead of bridge itself

This restores the original config_generate behaviour. With MAC set for
bridged devices the bridge automatically gets its MAC adjusted (it picks
the lowest MAC of bridged devices).

This fixes confusing interfaces setup (bridge ports not having custom
MAC assigned).

Reported-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
Fixes: c2139eef279e ("base-files: simplify setting device MAC")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit c8d8eb9d13fc6fc8b394a620c27995ee71d29c4d)

2 years agohostapd: wolfssl: add RNG to EC key
David Bauer [Wed, 5 May 2021 23:53:49 +0000 (01:53 +0200)]
hostapd: wolfssl: add RNG to EC key

Since upstream commit 6467de5a8840 ("Randomize z ordinates in
scalar mult when timing resistant") WolfSSL requires a RNG for
the EC key when built hardened which is the default.

Set the RNG for the EC key to fix connections for OWE clients.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit ddcb970274c011d3db611ec39350ee4704ff0e02)

2 years agowolfssl: always export wc_ecc_set_rng
David Bauer [Wed, 5 May 2021 23:48:04 +0000 (01:48 +0200)]
wolfssl: always export wc_ecc_set_rng

Since commit 6467de5a8840 ("Randomize z ordinates in scalar
mult when timing resistant") wolfssl requires a RNG for an EC
key when the hardened built option is selected.

wc_ecc_set_rng is only available when built hardened, so there
is no safe way to install the RNG to the key regardless whether
or not wolfssl is compiled hardened.

Always export wc_ecc_set_rng so tools such as hostapd can install
RNG regardless of the built settings for wolfssl.

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit ef9b103107aebd1a54f4360af3d9cf28d0544f13)

2 years agoath79: don't autodetect AR8033 PHY capabilities
David Bauer [Sun, 13 Jun 2021 10:00:41 +0000 (12:00 +0200)]
ath79: don't autodetect AR8033 PHY capabilities

PHY capabilities are currently read from the fiber status page, thus
Linux won't advertise 10 / 100 Base-T operation modes, effectively
limiting operation to 1000 Base-T.

Statically set the PHYs capabilities, avoiding autodetection.

The issue itself is properly fixed kernel upstream, however backporting
efforts to OpenWrt master resulted in breaking the fiber operation for
another target.

This is currently only known to be necessary for the Ubiquiti
UniFi AC series, so enabling it in the ath79 target should not
break somewhere else.

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agobuild,json: fix generation with empty profiles
Paul Spooren [Mon, 21 Jun 2021 06:23:45 +0000 (20:23 -1000)]
build,json: fix generation with empty profiles

If the image generation doesn't add any profiles to the output the
*profile merge* will fail. To avoid that set an empty profile as
fallback.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit fd0d9909bf50f114d5e7f7cedf53e542de878a2c)

2 years agobuild: preserve profiles.json between builds
Moritz Warning [Sun, 21 Feb 2021 23:18:10 +0000 (00:18 +0100)]
build: preserve profiles.json between builds

Keep other profiles.json content if the data belongs to the current
build version.

Also useful for the ImageBuilder, which builds for a single model each
time. Without this commit the profiles.json would only contain the
latest build profile information.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
[improve commit message]
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit a463b96241fbc2d142982387eaed9989e201ac7a)

2 years agoqos-scripts: add ifbN device before setting the link up
Perry Melange [Mon, 19 Apr 2021 09:17:10 +0000 (11:17 +0200)]
qos-scripts: add ifbN device before setting the link up

commit 50413e1ec83dedaea44558d5f37af5454156a46a replaced ifconfig
with ip.  In order to set a link state to up, the interface needs
to be added first.

Fixes: FS#3754
Signed-off-by: Perry Melange <isprotejesvalkata@gmail.com>
[Add Fixes tag]
Signed-off-by: Baptiste Jonglez <git@bitsofnetworks.org>
(cherry picked from commit 23c3bab9209f984692f8206c0d97758ee223a26f)

2 years agomac80211: fix an issue with wds links on 802.11ax devices
Felix Fietkau [Sat, 19 Jun 2021 10:16:49 +0000 (12:16 +0200)]
mac80211: fix an issue with wds links on 802.11ax devices

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 89c9ccc3b241d8f07c22a1c271211322c4703f7b)

2 years agoath79: use dynamic partitioning for TP-Link CPE series
Michael Pratt [Wed, 5 May 2021 03:32:00 +0000 (23:32 -0400)]
ath79: use dynamic partitioning for TP-Link CPE series

CPExxx and WBSxxx boards with AR9344 SOC
use the OKLI lzma kernel loader
with the offset of 3 blocks of length 4k (0x3000)
in order to have a fake "kernel" that cannot grow larger
than how it is defined in the now static OEM partition table.

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

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

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

Tested-by: Andrew Cameron <apcameron@softhome.net> [CPE510 v2]
Tested-by: Bernhard Geier <freifunk@geierb.de> [WBS210 v2]
Tested-by: Petrov <d7c48mWsPKx67w2@gmail.com> [CPE210 v1]
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 7b9a0c264cb9dc2c5a946a0aa9a290427a5e559c)

2 years agomac80211: fix minstrel sample time check
Felix Fietkau [Thu, 17 Jun 2021 10:40:15 +0000 (12:40 +0200)]
mac80211: fix minstrel sample time check

We need to skip sampling if the next sample time is after jiffies, not before.
This patch fixes an issue where in some cases only very little sampling (or none
at all) is performed, leading to really bad data rates

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2 years agoiw: update to 8fab0c9e
Andre Heider [Tue, 18 May 2021 05:13:50 +0000 (07:13 +0200)]
iw: update to 8fab0c9e

This fixes `iw dev wlan0-mesh station dump`.

8fab0c9 iw: fix ftm_request missing arguments segfault
e816fbc iw: fix mgmt dump missing arguments segfault
5d9d1b8 iw: Fix timestamp output on 32-bit architectures
4b25ae3 iw: fix pointer arithmetic in __print_he_capa
c3df363 iw: add option to print human readable event time
cd64525 iw: print ctrl port tx status event
0ba98b9 iw: use correct type in policy check for mesh
9e38dee iw: scan: fixup HE caps whitespace
17e8564 iw: scan: parse HE capabilities
5735e58 iw: util: factor out HE capability parser
6d8d507 iw: scan: add extension tag parsing
b4e1ec4 man: update wikipage URL, reformat SEE ALSO section
c56036a iw: enable 80MHz support for 6GHz band 11s mesh
fa72728 iw: handle positive error codes gracefully
7ba9093 iw: scan: add flag for scanning colocated ap
5ec60ed iw: Add 'coloc' and 'flush' options to sched_scan
f8ade75 iw: update wikipage URL
b6f2dac iw: Add support for specifying the 160MHz bandwidth when setting the channel/frequency

Signed-off-by: Andre Heider <a.heider@gmail.com>
(cherry-picked from commit b5420dd710aaad703f6f7a900840609d4d1176a1)

2 years agomt76: update to the latest version
Felix Fietkau [Wed, 2 Jun 2021 06:49:19 +0000 (08:49 +0200)]
mt76: update to the latest version

bddc1db76d0f mt76: mt7915: drop the use of repeater entries for station interfaces
3c90f35dddac mt76: mt7915: add thermal sensor device support
afab0e8202ff mt76: mt7915: add thermal cooling device support
41cf02184699 mt76: mt7615: add thermal sensor device support
2ac6b8762565 mt76: connac: update BA win size in Rx direction
ddb301127291 mt76: mt7921: fix reset under the deep sleep is enabled
e4cbefd1d69a mt76: mt7921: avoid unnecessary consecutive WiFi resets
393eea2034d7 mt76: mt7921: fix invalid register access in wake_work
a15d46407ffa mt76: mt7921: fix OMAC idx usage
e4d267d8e900 mt76: mt7921: enable runtime pm by default
50fd8ce2412a mt76: connac: add bss color support for sta mode
e29058c3c860 mt76: mt7921: return proper error value in mt7921_mac_init
c89c8c347b1e mt76: mt7921: do not schedule hw reset if the device is not running
9f7bb428e587 mt76: mt7921: reset wfsys during hw probe
22ea365913b5 mt76: mt7915: add .offset_tsf callback
ad91f8e8e494 mt76: mt7615: add .offset_tsf callback
6f871f35e3c1 mt76: mt7915: use mt7915_mcu_get_txpower_sku() to get per-rate txpower
597b68b7daa3 mt76: mt7615: remove useless if condition in mt7615_add_interface()
3945264468eb mt76: testmode: fix memory leak in mt76_testmode_alloc_skb
bdcc57a11606 mt76: testmode: remove unnecessary function calls in mt76_testmode_free_skb
a9763452601d mt76: testmode: remove undefined behaviour in mt76_testmode_alloc_skb
4aef2a2be464 mt76: mt7615: fix potential overflow on large shift
d9dd7635b055 mt76: mt7915: use mt7915_mcu_get_mib_info() to get survey data
d740e921758a mt76: mt7921: introduce mac tx done handling
259ddfc7cb73 mt76: mt7921: update statistic in active mode only
757b93f4b179 mt76: mt7921: remove leftover 80+80 HE capability
1fcff599b2e1 mt76: allow hw driver code to overwrite wiphy interface_modes
c55c22e39b7d mt7915: update firmware to 2020110522
10548aef1f45 mt76: mt7915: improve error recovery reliability
ed6b0c79820c mt76: mt7921: set MT76_RESET during mac reset
321443258bea mt76: move mt76_rates in mt76 module
d1652e8af9e1 Revert "mt76: connac: do not schedule wake_work if the runtime-pm is disabled"
4f4cab39ed9f mt76: mt7915: read all eeprom fields from fw in efuse mode
71450535f164 mt76: mt7921: enable hw offloading for wep keys
833d577e430c mt76: mt7921: remove mt7921_get_wtbl_info routine
67b7a22d2b99 mt76: mt7921: enable random mac address during sched_scan
cf1ff7bf4f1b mt76: mt7915: setup drr group for peers
ef2f7aa8745f mt76: mt7615: update radar parameters
b9f09f530223 mt76: mt7915: fix MT_EE_CAL_GROUP_SIZE
22b690334c0f mt76: mt7915: do not fail if the cooling device could not be registered

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 3c46ba053d899df65dc07e373c64d1925d30f88e)

2 years agomac80211: sync nl80211.h with upstream and backport a WPA3 related commit
Felix Fietkau [Wed, 26 May 2021 18:00:14 +0000 (20:00 +0200)]
mac80211: sync nl80211.h with upstream and backport a WPA3 related commit

Fixes compatibility issues with the latest hostapd update

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry-picked from commit 91abeebd3bd29a98de516e49260d61165096009a)

2 years agougps: start also in case device is absent
Daniel Golle [Thu, 27 May 2021 10:34:38 +0000 (12:34 +0200)]
ugps: start also in case device is absent

Don't bail out from init script in case the GPS device is missing.
Some modems take time to come up, and some people may use things like
'kplex' to feed ugpsd. Hence it is better to always start ugpsd
unconditionally and let procd's respawn take care of retrying.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 3d026d24257a0e2f3170538d8a54d520315699a1)

2 years agougps: update to git HEAD
Daniel Golle [Mon, 7 Jun 2021 22:13:18 +0000 (23:13 +0100)]
ugps: update to git HEAD

 86ee86e nmea: parse $GPZDA sentences for date/time
 8e12414 nmea: parse $GPGLL sentences for position
 5e88403 ubus: display only available information

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 3a8b75b56927d679dbf1a86827ceffef35207281)

2 years agoOpenWrt v21.02.0-rc3: revert to branch defaults
Hauke Mehrtens [Mon, 14 Jun 2021 18:33:17 +0000 (20:33 +0200)]
OpenWrt v21.02.0-rc3: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v21.02.0-rc3: adjust config defaults v21.02.0-rc3
Hauke Mehrtens [Mon, 14 Jun 2021 18:33:04 +0000 (20:33 +0200)]
OpenWrt v21.02.0-rc3: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoopkg: update to git HEAD
Hauke Mehrtens [Sun, 13 Jun 2021 21:43:36 +0000 (23:43 +0200)]
opkg: update to git HEAD

 1bf042d libopkg: pkg_hash: print unresolved dependencies

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit da86064611db657bce8c3c96b2e58eca8551c3d0)

2 years agotreewide: mark selected packages nonshared
Hannu Nyman [Sun, 6 Jun 2021 15:15:08 +0000 (18:15 +0300)]
treewide: mark selected packages nonshared

Mark uci, ubus, libubox, lua, libnl-tiny and libjson-c
as nonshared packages. This helps to keep coherent dependencies
if these ABI versioned packages are later updated.

Before this commit it is possible to get missing dependencies
in target-specific nonshared packages (like iwinfo) that depend
on these shared ABI versioned packages. If these are later updated
and rebuilt, only the new ABI version will be available for download,
while the target-specific packages in releases continue to depend on
the old ABI version.

After this commit the packages are built along the other nonshared
packages by the phase1 images buildbot and will be available at the
target/ download directories instead of packages/base dir. That will
help to keep a coherent set available.

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
(cherry picked from commit 72cc44958ef4e0df1a152178514c92899d6a957a)

2 years agoREADME: switch from freenode to oftc
Paul Spooren [Sat, 12 Jun 2021 22:38:30 +0000 (12:38 -1000)]
README: switch from freenode to oftc

We recently switched from freenode.net to oftc.net, reflect that in the
README and update the links.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 5a66165cb1863693ce7901d153f5e41c91a130e1)

2 years agoREADME: update routing.git URL
Paul Spooren [Sat, 12 Jun 2021 18:27:16 +0000 (08:27 -1000)]
README: update routing.git URL

The routing packages feed moved from `openwrt-routing/packages` to
`openwrt/routing`, reflect that in the README.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 0371f401933e8b24ba6add2689098474774d04d6)

2 years agoramips: mt7620: add kernel size for Jboot devices
Pawel Dembicki [Wed, 9 Jun 2021 10:22:39 +0000 (12:22 +0200)]
ramips: mt7620: add kernel size for Jboot devices

Since few months multiple users reported problems with various JBoot
devices. [0][1][2][3] All of them was bricked.

On my Lava LR-25G001 it freezes with current snapshot:

CDW57CAM_003 Jboot B695
Giga Switch AR8327 init
AR8327/AR8337 id   ==> 0x1302
JRecovery Version R1.2 2014/04/01 18:25
SPI FLASH: MX25l12805d 16M
.
.
(freeze)

The kernel size is >2048k.

I built current master with minimal config and it boots well:

CDW57CAM_003 Jboot B695
Giga Switch AR8327 init
AR8327/AR8337 id   ==> 0x1302
JRecovery Version R1.2 2014/04/01 18:25
SPI FLASH: MX25l12805d 16M
.
...........................
Starting kernel @80000000...
[    0.000000] Linux version 5.4.124

Kernel size is <2048k.

Jboot bootloader isn't open source, so it's impossible to find
solution in code. It looks, that some buffer for kernel have 2MB size.

To avoid bricked devices, this commit introduces 2048k limit kernel
size for all jboot routers.

[0] https://bugs.openwrt.org/index.php?do=details&task_id=3539
[1] https://eko.one.pl/forum/viewtopic.php?pid=254344
[2] https://eko.one.pl/forum/viewtopic.php?id=20930
[3] https://eko.one.pl/forum/viewtopic.php?pid=241376#p241376

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[remove Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit e1d8a14cd0a9f8844f9ebb8ca220780b0ce5d6db)

2 years agoramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro
Adam Elyas [Tue, 8 Jun 2021 00:09:18 +0000 (08:09 +0800)]
ramips: fix LAN LED trigger assignment for Xiaomi Router 3 Pro

The default trigger for the amber lights on lan1 and lan3 were
mistakenly swapped after the device's migration to DSA. This
caused activity on one port to trigger the amber light on the
other port. Swapping their default trigger in the DTS file
fixes that.

Signed-off-by: Adam Elyas <adamelyas@outlook.com>
[minor commit title adjustment, wrap commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit edaf432bf411767f3e8a9e5effc3a416bcac46c7)

2 years agoramips: fix Ethernet random MAC address for HILINK HLK-7628N
Liu Yu [Tue, 8 Jun 2021 01:50:02 +0000 (09:50 +0800)]
ramips: fix Ethernet random MAC address for HILINK HLK-7628N

Set the ethernet address from flash.

MAC addresses as verified by OEM firmware:

  use   interface  source
  2g    wlan0      factory 0x04 (label)
  LAN   eth0.1     factory 0x28 (label+1)
  WAN   eth0.2     factory 0x2e (label+2)

Fixes: 671c9d16e382 ("ramips: add support for HILINK HLK-7628N")
Signed-off-by: Liu Yu <f78fk@live.com>
[drop old MAC address setup from 02_network, cut out state_default
changes, face-lift commit message, add Fixes:]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit ae9c5cd37bf5c08452f314b54afa963a00bdde30)

2 years agoath79: fix eth0 PLL registers on WD My Net Wi-Fi Range Extender
Jonathan A. Kollasch [Fri, 11 Sep 2020 19:33:39 +0000 (14:33 -0500)]
ath79: fix eth0 PLL registers on WD My Net Wi-Fi Range Extender

This replaces the register bits for RGMII delay on the MAC side in favor
of having the RGMII delay on the PHY side by setting the phy-mode
property to rgmii-id (RGMII internal delay), which is supported by the
at803x driver.  Speed 1000 is fixed as a result, so now all ethernet
speeds function.

Signed-off-by: Jonathan A. Kollasch <jakllsch@kollasch.net>
Reviewed-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit f36990eae77c3a22842a2c418378c5dd40dec366)

2 years agoRevert "ci: build test ath79/generic"
Petr Štetiar [Fri, 11 Jun 2021 07:04:59 +0000 (09:04 +0200)]
Revert "ci: build test ath79/generic"

This reverts commit 16d6288c6337dc30ed03e3566aa593225945f4e7 which was
accidentally commited.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agoci: build test ath79/generic
Petr Štetiar [Tue, 8 Jun 2021 06:33:04 +0000 (08:33 +0200)]
ci: build test ath79/generic

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2 years agoath79: set lzma-loader variables to null by default
Michael Pratt [Sat, 8 May 2021 21:34:30 +0000 (17:34 -0400)]
ath79: set lzma-loader variables to null by default

This fixes a small regression where the lzma-loader variable values
are being shared between boards that require different configurations.

If not set to "" globally, a device without these settings will just take
the last values another device has set before in the queue.

Fixes: 1b8bd17c2d07 ("ath79: lzma-loader: allow setting custom kernel magic")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
[add detailed explanation to the commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit bf8c16dfa2cddd529f889510ca5fa5160606c325)

2 years agoath79: move pcie node to DTSI for qca955x Senao APs
Michael Pratt [Sat, 27 Feb 2021 19:18:42 +0000 (14:18 -0500)]
ath79: move pcie node to DTSI for qca955x Senao APs

pcie0 is the same for this generation of Senao APs
while eth0, eth1, and wmac can differ

the qca,no-eeprom property has no effect
for the ath10k drivers

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 15c599c9dfa9cf5459bcc15b773e39891ca14340)

2 years agoath79: cleanup DTS for ALLNET ALL-WAP02860AC
Michael Pratt [Mon, 15 Feb 2021 20:37:06 +0000 (15:37 -0500)]
ath79: cleanup DTS for ALLNET ALL-WAP02860AC

use qca955x_senao_loader.dtsi
because it is the same hardware / partitioning
and some cleanup

Effects:

nodes to match similar boards
 - keys
 - eth0
 - pcie0

bumps SPI frequency to 40 MHz

removes &pll node:
the property is defined in qca955x.dtsi

removes qca,no-eeprom:
has no effect with mtd-cal-data property
(also spelling)

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit e800da9d5c87d276806284cf2183994ea7fe083e)

2 years agoath79: add factory.bin for ALLNET ALL-WAP02860AC
Michael Pratt [Fri, 12 Feb 2021 23:58:00 +0000 (18:58 -0500)]
ath79: add factory.bin for ALLNET ALL-WAP02860AC

This device is a Senao-based product
using hardware and software from Senao
with the tar-gz platform for factory.bin
and checksum verification at boot time
using variables stored in uboot environment
and a 'failsafe' image when it fails.

Extremely similar hardware/software to Engenius EAP1200H
and other Engenius APs with qca955x

Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 37ea5d9a658a15783b0ac68583db9e67a43e960d)

2 years agoath79: add Senao 'failsafe' sysupgrade procedure
Michael Pratt [Fri, 12 Feb 2021 23:19:10 +0000 (18:19 -0500)]
ath79: add Senao 'failsafe' sysupgrade procedure

Use a similar upgrade method for sysupgrade.bin, like factory.bin,
for Senao boards with the tar.gz OEM upgrade platform,
and 'failsafe' image which is loaded on checksum failure.

This is inspired by the OEM upgrade script /etc/fwupgrade.sh
and the existing platforms for dual-boot Senao boards.

Previously, if the real kernel was damaged or missing
the only way to recover was with UART serial console,
because the OKLI lzma-loader is programmed to halt.

uboot did not detect cases where kernel or rootfs is damaged
and boots OKLI instead of the failsafe image,
because the checksums stored in uboot environment
did not include the real kernel and rootfs space.

Now, the stored checksums include the space for both
the lzma-loader, kernel, and rootfs.
Therefore, these boards are now practically unbrickable.

Also, the factory.bin and sysupgrade.bin are now the same,
except for image metadata.
This allows for flashing OEM image directly from openwrt
as well as flashing openwrt image directly from OEM.

Make 'loader' partition writable so that it can be updated
during a sysupgrade.

tested with
ENS202EXT v1
EAP1200H
EAP350 v1
EAP600
ECB350 v1
ECB600
ENH202 v1

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit d5035f0d2694cb9c5a93ed72e3b6d2dd1770741e)

2 years agoath79: adjust ath79/tiny Senao APs to 4k blocksize
Michael Pratt [Sun, 21 Feb 2021 22:41:30 +0000 (17:41 -0500)]
ath79: adjust ath79/tiny Senao APs to 4k blocksize

ath79/tiny kernel config has
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS=y
from commit
05d35403b211ccb9bf20e2b3c0b7a30c82c6d6a2

Because of this, these changes are required for 2 reasons:

1.

Senao devices in ath79/tiny
with a 'failsafe' partition and the tar.gz sysupgrade platform
and a flash chip that supports 4k sectors
will fail to reboot to openwrt after a sysupgrade.

the stored checksum is made with the 64k blocksize length
of the image to be flashed,
and the actual checksum changes after flashing due to JFFS2 space
being formatted within the length of the rootfs from the image

example:
0x440000 length of kernel + rootfs (from sysupgrade.bin)
0x439000 offset of rootfs_data (from kernel log)

2.

for boards with flash chips that support 4k sectors:
saving configuration over sysupgrade is not possible
because sysupgrade.tgz is appended at a 64k boundary
and the mtd parser starts JFFS2 at a 4k boundary.

for boards with flash chips that do not support 4k sectors:
partitioning with 4k boundaries causes a boot loop
from the mtd parser not finding kernel and rootfs.

Also:

Some of the Senao boards that belong in ath79/tiny,
for example ENH202,
have a flash chip that does not support 4k sectors
(no SECT_4K symbol in upstream source).

Because of this, partitioning must be different for these devices
depending on the flash chip model detected by the kernel.

Therefore:

this creates 2 DTSI files
to replace the single one with 64k partitioning
for 4k and 64k partitioning respectively.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit a58cb22bbe4bac17e7421a0ad6bf7929fcd56599)

2 years agoath79: remove 'fakeroot' for Senao devices
Michael Pratt [Thu, 25 Feb 2021 03:55:09 +0000 (22:55 -0500)]
ath79: remove 'fakeroot' for Senao devices

By using the same custom kernel header magic
in both OKLI lzma-loader, DTS, and makefile
this hack is not necessary anymore

However, "rootfs" size and checksum
must now be supplied by the factory.bin image
through a script that is accepted by the OEM upgrade script.

This is because Senao OEM scripts assume a squashfs header exists
at the offset for the original "rootfs" partition
which is actually the kernel + rootfs in this implementation,
and takes size value from the header that would be there with hexdump,
but this offset is now the uImage header instead.

This frees up 1 eraseblock
previously used by the "fakeroot" partition
for bypassing the OEM image verification.

Also, these Senao devices with a 'failsafe' partition
and the tar-gz factory.bin platform would otherwise require
flashing the new tar-gz sysupgrade.bin afterward.
So this also prevents having to flash both images
when starting from OEM or 'failsafe'

the OEM upgrade script verifies the header magic numbers,
but only the first two bytes.
Example:

    [ "${magic_word_kernel}" = "2705" ] &&
    [ "${magic_word_rootfs}" = "7371" -o "${magic_word_rootfs}" = "6873" ] &&
    errcode="0"

therefore picked the magic number
0x73714f4b
which is
'sqOK'

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 4a0cc5d4ef29a11914850c72158aca1e2a170fb0)

2 years agoath79: lzma-loader: allow setting custom kernel magic
Michael Pratt [Thu, 25 Feb 2021 03:35:37 +0000 (22:35 -0500)]
ath79: lzma-loader: allow setting custom kernel magic

...and max flash offset

The mtdsplit parser was recently refactored
to allow the kernel to have custom image header magic.

Let's also do this for the lzma-loader

For example:
When implemented together,
this allows the kernel to "appear" to be a rootfs
by OEM software in order to write an image
that is actually kernel + rootfs.

At the same time,
it would boot to openwrt normally
by setting the same magic in DTS.

Both of the variables
have a default value that is unchanged
when not defined in the makefiles

This has no effect on the size of the loader
when lzma compressed.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 1b8bd17c2d07c7397015a86941db9e114e1d349a)

2 years agoath79: create common DTSI for Senao qca955x APs
Adrian Schmutzler [Wed, 24 Feb 2021 12:14:12 +0000 (13:14 +0100)]
ath79: create common DTSI for Senao qca955x APs

This creates a shared DTSI for qca955x Senao/Engenius APs with
concatenated firmware partition/okli loader:

 - EAP1200H
 - EnstationAC v1

To make this usable for future boards with 32 MB flash as well,
split the partitions node already.

Suggested-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 9b37db5caacdb46710ce6bfc8d37ae2ad02b843b)

2 years agoath79: create common DTSI for Senao ar934x APs
Adrian Schmutzler [Mon, 15 Feb 2021 16:30:59 +0000 (17:30 +0100)]
ath79: create common DTSI for Senao ar934x APs

This creates a shared DTSI for ar934x Senao/Engenius APs:

 - EAP300 v2
 - ENS202EXT v1
 - EAP600
 - ECB600

Since ar9341/ar9344 have different configuration, this new file
mostly contains the partitioning.

Suggested-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit ce8b535ed3aea743f58d8445dfaa1c2ced375f94)

2 years agoath79: create common DTSI for Senao ar724x APs
Adrian Schmutzler [Mon, 15 Feb 2021 16:41:36 +0000 (17:41 +0100)]
ath79: create common DTSI for Senao ar724x APs

This creates a shared DTSI for ar724x Senao/Engenius APs:

 - ENH202 v1
 - EAP350 v1
 - ECB350 v1

Since ar7240/ar7242 have different configuration, this new file
mostly contains the partitioning.

Suggested-by: Michael Pratt <mcpratt@pm.me>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 4204d70d7a1123fdf11d3f5b1f46143639fa58a6)

2 years agoath79: rename 'engenius' Makefile definitions to 'senao'
Michael Pratt [Fri, 12 Feb 2021 18:24:32 +0000 (13:24 -0500)]
ath79: rename 'engenius' Makefile definitions to 'senao'

These recipes and definitions can apply
to devices from other vendors
with PCB boards or SDK produced by Senao
not only the brand Engenius

possible examples:
Extreme Networks, WatchGuard, OpenMesh,
Fortinet, ALLNET, OCEDO, Plasma Cloud, devolo, etc.

so rename all of these items
and move DEVICE_VENDOR from common to generic/tiny.mk

Signed-off-by: Michael Pratt <mcpratt@pm.me>
(cherry picked from commit 70bf4a979c24a5db6f29f6dd691e20eb2345b4d0)

2 years agoramips: Add support for SERCOMM NA502
Andreas Böhler [Sun, 14 Mar 2021 23:07:17 +0000 (00:07 +0100)]
ramips: Add support for SERCOMM NA502

The SERCOMM NA502 is a smart home gateway manufactured by SERCOMM and sold
under different brands (among others, A1 Telekom Austria SmartHome
Gateway). It has multi-protocol radio support in addition to LAN and WiFi.

Note: BLE is currently unsupported.

Specifications
--------------

  - MT7621ST 880MHz, Single-Core, Dual-Thread
  - MT7603EN 2.4GHz WiFi
  - MT7662EN 5GHz WiFi + BLE
  - 128MiB NAND
  - 256MiB DDR3 RAM
  - SD3503 ZWave Controller
  - EM357 Zigbee Coordinator

MAC address assignment
----------------------

LAN MAC is read from the config partition, WiFi 2.4GHz is LAN+2 and matches
the OEM firmware. WiFi 5GHz with LAN+1 is an educated guess since the
OEM firmware does not enable 5GHz WiFi.

Installation
------------
Attach serial console, then boot the initramfs image via TFTP.
Once inside OpenWrt, run sysupgrade -n with the sysupgrade file.

Attention: The device has a dual-firmware design. We overwrite kernel2,
since kernel1 contains an automatic recovery image.

If you get NAND ECC errors and are stuck with bad eraseblocks, try to
erase the mtd partition first with

mtd unlock ubi
mtd erase ubi

This should only be needed once.

Signed-off-by: Andreas Böhler <dev@aboehler.at>
[use kiB for IMAGE_SIZE]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit a3d8c1295ed9eeceabd78ab86e73b151ae2868a9)

2 years agoramips: add support for Linksys EA8100 v1
Tee Hao Wei [Mon, 17 May 2021 19:46:36 +0000 (03:46 +0800)]
ramips: add support for Linksys EA8100 v1

Specifications:
- SoC: MT7621AT
- RAM: 256MB
- Flash: 128MB NAND
- Ethernet: 5 Gigabit ports
- WiFi: 2.4G/5G MT7615N
- USB: 1 USB 3.0, 1 USB 2.0

This device is very similar to the EA7300 v1/v2 and EA7500 v2.

Installation:

Upload the generated factory image through the factory web interface.

(following part taken from EA7300 v2 commit message:)

This might fail due to the A/B nature of this device. When flashing, OEM
firmware writes over the non-booted partition. If booted from 'A',
flashing over 'B' won't work. To get around this, you should flash the
OEM image over itself. This will then boot the router from 'B' and
allow you to flash OpenWRT without problems.

Reverting to factory firmware:

Hard-reset the router three times to force it to boot from 'B.' This is
where the stock firmware resides. To remove any traces of OpenWRT from
your router simply flash the OEM image at this point.

With thanks to Leon Poon (@LeonPoon) for the initial bringup.

Signed-off-by: Tee Hao Wei <angelsl@in04.sg>
[add missing entry in 10_fix_wifi_mac]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit b232680f847f4ea8d058849a51dedebb8e398a01)

2 years agoramips: add support for Amped Wireless ALLY router and extender
Jonathan Sturges [Sat, 5 Jun 2021 12:17:42 +0000 (08:17 -0400)]
ramips: add support for Amped Wireless ALLY router and extender

Amped Wireless ALLY is a whole-home WiFi kit, with a router (model
ALLY-R1900K) and an Extender (model ALLY-00X19K).  Both are devices are
11ac and based on MediaTek MT7621AT and MT7615N chips.  The units are
nearly identical, except the Extender lacks a USB port and has a single
Ethernet port.

Specification:
- SoC: MediaTek MT7621AT (2C/4T) @ 880MHz
- RAM: 128MB DDR3 (Nanya NT5CC64M16GP-DI)
- FLASH: 128MB NAND (Winbond W29N01GVSIAA)
- WiFi: 2.4/5 GHz 4T4R
  - 2.4GHz MediaTek MT7615N bgn
  - 5GHz MediaTek MT7615N nac
- Switch: SoC integrated Gigabit Switch
- USB: 1x USB3 (Router only)
- BTN: Reset, WPS
- LED: single RGB
- UART:  through-hole on PCB.
   J1: pin1 (square pad, towards rear)=3.3V, pin2=RX,
   pin3=GND, pin4=TX.  Settings: 57600/8N1.

Note regarding dual system partitions
-------------------------------------

The vendor firmware and boot loader use a dual partition scheme.  The boot
partition is decided by the bootImage U-boot environment variable: 0 for
the 1st partition, 1 for the 2nd.

OpenWrt does not support this scheme and will always use the first OS
partition.  It will set bootImage to 0 during installation, making sure
the first partition is selected by the boot loader.

Also, because we can't be sure which partition is active to begin with, a
2-step flash process is used.  We first flash an initramfs image, then
follow with a regular sysupgrade.

Installation:

Router (ALLY-R1900K)
1) Install the flashable initramfs image via the OEM web-interface.
  (Alternatively, you can use the TFTP recovery method below.)
  You can use WiFi or Ethernet.
  The direct URL is:  http://192.168.3.1/07_06_00_firmware.html
  a. No login is needed, and you'll be in their setup wizard.
  b. You might get a warning about not being connected to the Internet.
  c. Towards the bottom of the page will be a section entitled "Or
  Manually Upgrade Firmware from a File:" where you can manually choose
  and upload a firmware file.
  d: Click "Choose File", select the OpenWRT "initramfs" image and click
  "Upload."
2) The Router will flash the OpenWrt initramfs image and reboot.  After
  booting, LuCI will be available on 192.168.1.1.
3) Log into LuCI as root; there is no password.
4) Optional (but recommended) is to backup the OEM firmware before
  continuing; see process below.
5) Complete the Installation by flashing a full OpenWRT image.  Note:
  you may use the sysupgrade command line tool in lieu of the UI if
  you prefer.
  a.  Choose System -> Backup/Flash Firmware.
  b.  Click "Flash Image..." under "Flash new firmware image"
  c.  Click "Browse..." and then select the sysupgrade file.
  d.  Click Upload to upload the sysupgrade file.
  e.  Important:  uncheck "Keep settings and retain the current
      configuration" for this initial installation.
  f.  Click "Continue" to flash the firmware.
  g.  The device will reboot and OpenWRT is installed.

Extender (ALLY-00X19K)
1) This device requires a TFTP recovery procedure to do an initial load
  of OpenWRT.  Start by configuring a computer as a TFTP client:
  a. Install a TFTP client (server not necessary)
  b. Configure an Ethernet interface to 192.168.1.x/24; don't use .1 or .6
  c. Connect the Ethernet to the sole Ethernet port on the X19K.
2) Put the ALLY Extender in TFTP recovery mode.
  a. Do this by pressing and holding the reset button on the bottom while
  connecting the power.
  b. As soon as the LED lights up green (roughly 2-3 seconds), release
  the button.
3) Start the TFTP transfer of the Initramfs image from your setup machine.
For example, from Linux:
tftp -v -m binary 192.168.1.6 69 -c put initramfs.bin
4) The Extender will flash the OpenWrt initramfs image and reboot.  After
booting, LuCI will be available on 192.168.1.1.
5) Log into LuCI as root; there is no password.
6) Optional (but recommended) is to backup the OEM firmware before
  continuing; see process below.
7) Complete the Installation by flashing a full OpenWRT image.  Note: you
may use the sysupgrade command line tool in lieu of the UI if you prefer.
  a.  Choose System -> Backup/Flash Firmware.
  b.  Click "Flash Image..." under "Flash new firmware image"
  c.  Click "Browse..." and then select the sysupgrade file.
  d.  Click Upload to upload the sysupgrade file.
  e.  Important:  uncheck "Keep settings and retain the current
      configuration" for this initial installation.
  f.  Click "Continue" to flash the firmware.
  g.  The device will reboot and OpenWRT is installed.

Backup the OEM Firmware:
-----------------------

There isn't any downloadable firmware for the ALLY devices on the Amped
Wireless web site. Reverting back to the OEM firmware is not possible
unless we have a backup of the original OEM firmware.

The OEM firmware may be stored on either /dev/mtd3 ("firmware") or
/dev/mtd6 ("oem").  We can't be sure which was overwritten with the
initramfs image, so backup both partitions to be safe.

  1) Once logged into LuCI, navigate to System -> Backup/Flash Firmware.
  2) Under "Save mtdblock contents," first select "firmware" and click
  "Save mtdblock" to download the image.
  3) Repeat the process, but select "oem" from the pull-down menu.

Revert to the OEM Firmware:
--------------------------
* U-boot TFTP:
  Follow the TFTP recovery steps for the Extender, and use the
  backup image.

* OpenWrt "Flash Firmware" interface:
  Upload the backup image and select "Force update"
  before continuing.

Signed-off-by: Jonathan Sturges <jsturges@redhat.com>
(cherry picked from commit 6d23e474ad9d0eba935696c66db4fb6e2037bb72)

2 years agoramips: add support for Linksys E5600
Aashish Kulkarni [Tue, 2 Mar 2021 05:10:14 +0000 (10:40 +0530)]
ramips: add support for Linksys E5600

This submission relied heavily on the work of Linksys EA7300 v1/ v2.

Specifications:

* SoC: MediaTek MT7621A (880 MHz 2c/4t)
* RAM: 128M DDR3-1600
* Flash: 128M NAND
* Eth: MediaTek MT7621A (10/100/1000 Mbps x5)
* Radio: MT7603E/MT7613BE (2.4 GHz & 5 GHz)
* Antennae: 2 internal fixed in the casing and 2 on the PCB
* LEDs: Blue (x4 Ethernet)
  Blue+Orange (x2 Power + WPS and Internet)
* Buttons: Reset (x1)
  WPS (x1)

Installation:

Flash factory image through GUI.

This device has 2 partitions for the firmware called firmware and
alt_firmware. To successfully flash and boot the device, the device
should have been running from alt_firmware partition. To get the device
booted through alt_firmware partition, download the OEM firmware from
Linksys website and upgrade the firmware from web GUI. Once this is done,
flash the OpenWrt Factory firmware from web GUI.

Reverting to factory firmware:

1. Boot to 'alt_firmware'(where stock firmware resides) by doing one of
   the following:
   Press the "wps" button as soon as power LED turns on when booting.
   (OR) Hard-reset the router consecutively three times to force it to
   boot from 'alt_firmware'.
2. To remove any traces of OpenWRT from your router simply flash the OEM
   image at this point.

Signed-off-by: Aashish Kulkarni <aashishkul@gmail.com>
[fix hanging indents and wrap to 74 characters per line,
 add kmod-mt7663-firmware-sta package for 5GHz STA mode to work,
 remove sysupgrade.bin and concatenate IMAGES instead in mt7621.mk,
 set default-state "on" for power LED]
Signed-off-by: Sannihith Kinnera <digislayer@protonmail.com>
[move check-size before append-metadata, remove trailing whitespace]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Tested-by: Sannihith Kinnera <digislayer@protonmail.com>
(cherry picked from commit 251c995cbb1ea5ad1de14775312c2bd19ed10439)

2 years agoramips: add support for JCG Q20
Chukun Pan [Sun, 16 May 2021 12:10:05 +0000 (20:10 +0800)]
ramips: add support for JCG Q20

JCG Q20 is an AX 1800M router.

Hardware specs:
  SoC: MediaTek MT7621AT
  Flash: Winbond W29N01HV 128 MiB
  RAM: Winbond W632GU6NB-11 256 MiB
  WiFi: MT7915 2.4/5 GHz 2T2R
  Ethernet: 10/100/1000 Mbps x3
  LED: Status (red / blue)
  Button: Reset, WPS
  Power: DC 12V,1A

Flash instructions:
  Upload factory.bin in stock firmware's upgrade page,
  do not preserve settings.

MAC addresses map:
  0x00004 *:3e wlan2g/wlan5g
  0x3fff4 *:3c lan/label
  0x3fffa *:3c wan

Signed-off-by: Chukun Pan <amadeus@jmu.edu.cn>
(cherry picked from commit 57cb387cfeee2a07902a2f1383ca471ef47265f3)

2 years agoramips: add support for cudy WR2100
Leon M. George [Thu, 24 Dec 2020 10:32:47 +0000 (11:32 +0100)]
ramips: add support for cudy WR2100

Specifications

  SoC:       MT7621
  CPU:       880 MHz
  Flash:     16 MiB
  RAM:       128 MiB
  WLAN:      2.4 GHz b/g/n, 5 GHz a/n/ac
             MT7603E / MT7615E
  Ethernet:  5x Gbit ports

Installation

There are two known options:
1) The Luci-based UI.
2) Press and hold the reset button during power up.
   The router will request 'recovery.bin' from a TFTP server at
   192.168.1.88.

Both options require a signed firmware binary.
The openwrt image supplied by cudy is signed and can be used to
install unsigned images.

R4 & R5 need to be shorted (0-100Ω) for the UART to work.

Signed-off-by: Leon M. George <leon@georgemail.eu>
[remove non-required switch-port node - remove trgmii phy-mode]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 3501db9b9b4a71ae52c539b46af817783c327866)

2 years agoramips: add support for TP-Link Archer C6U v1 (EU)
Georgi Vlaev [Fri, 31 Jul 2020 11:02:21 +0000 (14:02 +0300)]
ramips: add support for TP-Link Archer C6U v1 (EU)

This patch adds support for TP-Link Archer C6U v1 (EU).
The device is also known in some market as Archer C6 v3.
This patch supports only Archer C6U v1 (EU).

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Georgi Vlaev <georgi.vlaev@konsulko.com>
(cherry picked from commit a46ad596a3e076599f38a4132b5d6dfee8a3102a)

2 years agoramips: add support for TP-Link Archer A6 v3
Vinay Patil [Mon, 19 Apr 2021 01:22:51 +0000 (06:52 +0530)]
ramips: add support for TP-Link Archer A6 v3

The patch adds support for the TP-Link Archer A6 v3
The router is sold in US and India with FCC ID TE7A6V3

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

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

LEDs:         Power Wifi2G Wifi5G LAN WAN

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

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

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

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

Thanks to: Frankis for Randmon MAC address fix.

Signed-off-by: Vinay Patil <post2vinay@gmail.com>
[remove superfluous factory image definition, whitespacing]
Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit f8f8935adb2be1ebce46a8d7058c76a8d3a9bd89)

2 years agoramips: mt7621: Add support for ZyXEL NR7101
Bjørn Mork [Mon, 19 Apr 2021 11:00:56 +0000 (13:00 +0200)]
ramips: mt7621: Add support for ZyXEL NR7101

The ZyXEL NR7101 is an 802.3at PoE powered 5G outdoor (IP68) CPE
with integrated directional 5G/LTE antennas.

Specifications:

 - SoC: MediaTek MT7621AT
 - RAM: 256 MB
 - Flash: 128 MB MB NAND (MX30LF1G18AC)
 - WiFi: MediaTek MT7603E
 - Switch: 1 LAN port (Gigabiti)
 - 5G/LTE: Quectel RG502Q-EA connected by USB3 to SoC
 - SIM: 2 micro-SIM slots under transparent cover
 - Buttons: Reset, WLAN under same cover
 - LEDs: Multicolour green/red/yellow under same cover (visible)
 - Power: 802.3at PoE via LAN port

The device is built as an outdoor ethernet to 5G/LTE bridge or
router. The Wifi interface is intended for installation and/or
temporary management purposes only.

UART Serial:

57600N1
Located on populated 5 pin header J5:

 [o] GND
 [ ] key - no pin
 [o] RX
 [o] TX
 [o] 3.3V Vcc

Remove the SIM/button/LED cover, the WLAN button and 12 screws
holding the back plate and antenna cover together. The GPS antenna
is fixed to the cover, so be careful with the cable.  Remove 4
screws fixing the antenna board to the main board, again being
careful with the cables.

A bluetooth TTL adapter is recommended for permanent console
access, to keep the router water and dustproof. The 3.3V pin is
able to power such an adapter.

MAC addresses:

OpenWrt OEM   Address          Found as
lan     eth2  08:26:97:*:*:BC  Factory 0xe000 (hex), label
wlan0   ra0   08:26:97:*:*:BD  Factory 0x4 (hex)
wwan0   usb0  random

WARNING!!

ISP managed firmware might at any time update itself to a version
where all known workarounds have been disabled.  Never boot an ISP
managed firmware with a SIM in any of the slots if you intend to use
the router with OpenWrt. The bootloader lock can only be disabled with
root access to running firmware. The flash chip is physically
inaccessible without soldering.

Installation from OEM web GUI:

- Log in as "supervisor" on https://172.17.1.1/
- Upload OpenWrt initramfs-recovery.bin image on the
  Maintenance -> Firmware page
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- (optional) Copy OpenWrt to the recovery partition. See below
- Sysupgrade to the OpenWrt sysupgrade image and reboot

Installation from OEM ssh:

- Log in as "root" on 172.17.1.1 port 22022
- scp OpenWrt initramfs-recovery.bin image to 172.17.1.1:/tmp
- Prepare bootloader config by running:
    nvram setro uboot DebugFlag 0x1
    nvram setro uboot CheckBypass 0
    nvram commit
- Run "mtd_write -w write initramfs-recovery.bin Kernel" and reboot
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- (optional) Copy OpenWrt to the recovery partition. See below
- Sysupgrade to the OpenWrt sysupgrade image and reboot

Copying OpenWrt to the recovery partition:

- Verify that you are running a working OpenWrt recovery image
  from flash
- ssh to root@192.168.1.1 and run:
    fw_setenv CheckBypass 0
    mtd -r erase Kernel2
- Wait while the bootloader mirrors Image1 to Image2

NOTE: This should only be done after successfully booting the OpenWrt
  recovery image from the primary partition during installation.  Do
  not do this after having sysupgraded OpenWrt!  Reinstalling the
  recovery image on normal upgrades is not required or recommended.

Installation from Z-Loader:

- Halt boot by pressing Escape on console
- Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
  image at 10.10.10.3
- Type "ATNR 1,initramfs-recovery.bin" at the "ZLB>" prompt
- Wait for OpenWrt to boot and ssh to root@192.168.1.1
- Sysupgrade to the OpenWrt sysupgrade image

NOTE: ATNR will write the recovery image to both primary and recovery
  partitions in one go.

Booting from RAM:

- Halt boot by pressing Escape on console
- Type "ATGU" at the "ZLB>" prompt to enter the U-Boot menu
- Press "4" to select "4: Entr boot command line interface."
- Set up a tftp server to serve the OpenWrt initramfs-recovery.bin
  image at 10.10.10.3
- Load it using "tftpboot 0x88000000 initramfs-recovery.bin"
- Boot with "bootm  0x8800017C" to skip the 380 (0x17C) bytes ZyXEL
  header

This method can also be used to RAM boot OEM firmware. The warning
regarding OEM applies!  Never boot an unknown OEM firmware, or any OEM
firmware with a SIM in any slot.

NOTE: U-Boot configuration is incomplete (on some devices?). You may
  have to configure a working mac address before running tftp using
   "setenv eth0addr <mac>"

Unlocking the bootloader:

If you are unebale to halt boot, then the bootloader is locked.

The OEM firmware locks the bootloader on every boot by setting
DebugFlag to 0.  Setting it to 1 is therefore only temporary
when OEM firmware is installed.

- Run "nvram setro uboot DebugFlag 0x1; nvram commit" in OEM firmware
- Run "fw_setenv DebugFlag 0x1" in OpenWrt

  NOTE:
    OpenWrt does this automatically on first boot if necessary

  NOTE2:
    Setting the flag to 0x1 avoids the reset to 0 in known OEM
    versions, but this might change.

  WARNING:
    Writing anything to flash while the bootloader is locked is
    considered extremely risky. Errors might cause a permanent
    brick!

Enabling management access from LAN:

Temporary workaround to allow installing OpenWrt if OEM firmware
has disabled LAN management:

- Connect to console
- Log in as "root"
- Run "iptables -I INPUT -i br0 -j ACCEPT"

Notes on the OEM/bootloader dual partition scheme

The dual partition scheme on this device uses Image2 as a recovery
image only. The device will always boot from Image1, but the
bootloader might copy Image2 to Image1 under specific conditions. This
scheme prevents repurposing of the space occupied by Image2 in any
useful way.

Validation of primary and recovery images is controlled by the
variables CheckBypass, Image1Stable, and Image1Try.

The bootloader sets CheckBypass to 0 and reboots if Image1 fails
validation.

If CheckBypass is 0 and Image1 is invalid then Image2 is copied to
Image1.

If CheckBypass is 0 and Image2 is invalid, then Image1 is copied to
Image2.

If CheckBypass is 1 then all tests are skipped and Image1 is booted
unconditionally.  CheckBypass is set to 1 after each successful
validation of Image1.

Image1Try is incremented if Image1Stable is 0, and Image2 is copied to
Image1 if Image1Try is 3 or larger.  But the bootloader only tests
Image1Try if CheckBypass is 0, which is impossible unless the booted
image sets it to 0 before failing.

The system is therefore not resilient against runtime errors like
failure to mount the rootfs, unless the kernel image sets CheckBypass
to 0 before failing. This is not yet implemented in OpenWrt.

Setting Image1Stable to 1 prevents the bootloader from updating
Image1Try on every boot, saving unnecessary writes to the environment
partition.

Keeping an OpenWrt initramfs recovery as Image2 is recommended
primarily to avoid unwanted OEM firmware boots on failure. Ref the
warning above. It enables console-less recovery in case of some
failures to boot from Image1.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 2449a632084b29632605e5a79ce5d73028eb15dd)

2 years agofirmware-utils: fix coverity zytrx.c resource leak
Kevin Darbyshire-Bryant [Sun, 16 May 2021 10:46:32 +0000 (11:46 +0100)]
firmware-utils: fix coverity zytrx.c resource leak

fix coverity resource leak warning:

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

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
(cherry picked from commit baf2a50ef3cf34574e12d2ab1b23578310f0d527)

2 years agofirmware-utils: zytrx: Add util for ZyXEL specific header
Bjørn Mork [Mon, 19 Apr 2021 11:00:55 +0000 (13:00 +0200)]
firmware-utils: zytrx: Add util for ZyXEL specific header

The ZyXEL NR7101 prepend an additional header to U-Boot images. This
header use the TRX magic 0x30524448 (HDR0), but is incompatible with
TRX images.

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

Example bootloader validation output:

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

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

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

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

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

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

Signed-off-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Bjørn Mork <bjorn@mork.no>
(cherry picked from commit 48cad07a55246317d66fee4ced25cb62a2bae3d3)

2 years agotreewide: make AddDepends/usb-serial selective
Adrian Schmutzler [Thu, 25 Feb 2021 10:54:43 +0000 (11:54 +0100)]
treewide: make AddDepends/usb-serial selective

Make packages depending on usb-serial selective, so we do not have
to add kmod-usb-serial manually for every device.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 9397b22df1473f315552578b58322db7f7750361)

2 years agowireless-regdb: update to version 2021.04.21
Felix Fietkau [Fri, 21 May 2021 12:29:31 +0000 (14:29 +0200)]
wireless-regdb: update to version 2021.04.21

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit d76535c45e6e970b212744781431e152e90c1ce6)

2 years agoglibc: update to latest 2.33 HEAD (BZ #27892)
Hans Dedecker [Sun, 30 May 2021 17:38:45 +0000 (19:38 +0200)]
glibc: update to latest 2.33 HEAD (BZ #27892)

0ef0e6de7f powerpc: Fix handling of scv return error codes [BZ #27892]

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
(cherry picked from commit 507257778c733749816a8ca611f072d07916a918)

2 years agoumbim: fix return value of proto_mbim_setup()
Adrian Schmutzler [Sat, 5 Jun 2021 15:59:39 +0000 (17:59 +0200)]
umbim: fix return value of proto_mbim_setup()

The variable name appears to be mistyped.

Suggested-by: Howard Chu <hyc@symas.com>
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 6bc4c0ae3eb3dff6e410b5b012ab0bec267adb5a)

2 years agox86: kernel: enable Fusion-MPT SAS driver
Mark Carroll [Sat, 8 May 2021 11:42:50 +0000 (11:42 +0000)]
x86: kernel: enable Fusion-MPT SAS driver

Compile in MPT SAS driver required to mount rootfs on some VMWare
systems (e.g. required for 1&1 IONOS).

Signed-off-by: Mark Carroll <git@markcarroll.net>
(cherry picked from commit 8716dda0743454e3949b815613542a4d00fc2a09)

2 years agoipq40xx: add uboot-envtools to default packages
Tomasz Maciej Nowak [Tue, 25 May 2021 13:26:06 +0000 (15:26 +0200)]
ipq40xx: add uboot-envtools to default packages

When support for Luma WRTQ-329ACN was added, the instructions for
flashing this device include using tools from uboot-envtools package.
Unfortunately the OpenWrt buildroot system omits packages from
DEVICE_PACKAGES when CONFIG_TARGET_MULTI_PROFILE,
CONFIG_TARGET_PER_DEVICE_ROOTFS, CONFIG_TARGET_ALL_PROFILES are set. In
result the official images are without tools mentioned in the
instruction. The workoround for the fashing would be installing
uboot-envtools when booted with initramfs image, but not always the
access to internet is available. The other method would be to issue the
necesary command in U-Boot environment but some serial terminals default
configuration don't work well with pasting lines longer than 80 chars.
Therefore add uboot-envtools to default packages, which adds really
small flash footprint to rootfs, where increased size usually is not an
issue.

Signed-off-by: Tomasz Maciej Nowak <tmn505@gmail.com>
(cherry picked from commit 1984a6bbcaac95c439dd4a6eba2f78c54e9be215)

2 years agoipq806x: fix LAN and WAN port assignments on TP-Link AD7200
Alex Henrie [Fri, 4 Jun 2021 04:37:49 +0000 (22:37 -0600)]
ipq806x: fix LAN and WAN port assignments on TP-Link AD7200

LAN port 4 was swapped with the WAN port and the remaining three LAN
ports were numbered in reverse order from their labels on the case.

Fixes: 1a775a4fd033 ("ipq806x: add support for TP-Link Talon AD7200")
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
(cherry picked from commit 6fb27e8e6d05ed426f200242fdc1710f6f849127)

2 years agomac80211: Update to backports-5.10.42
Hauke Mehrtens [Sat, 5 Jun 2021 16:21:57 +0000 (18:21 +0200)]
mac80211: Update to backports-5.10.42

The removed patches were integrated upstream.

The brcmf_driver_work workqueue was removed in brcmfmac with kernel
5.10.42, the asynchronous call was covered to a synchronous call. There
is no need to wait any more.
This part was removed manually from this patch:
brcm/860-brcmfmac-register-wiphy-s-during-module_init.patch

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 04a260911ca0f10a0e37c487c220e1aae3623dda)

2 years agokernel: bump 5.4 to 5.4.124
Hauke Mehrtens [Fri, 4 Jun 2021 23:08:30 +0000 (01:08 +0200)]
kernel: bump 5.4 to 5.4.124

Manually rebased
  generic/hack-5.4/662-remove_pfifo_fast.patch
  ramips/patches-5.4/0048-asoc-add-mt7620-support.patch

All others updated automatically.

Compile-tested on: armvirt/64, x86/generic, ath79/generic, ramips/mt7621
Runtime-tested on: armvirt/64, x86/generic, ath79/generic

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoubus: update to version 2021-06-03
Petr Štetiar [Thu, 3 Jun 2021 07:49:58 +0000 (09:49 +0200)]
ubus: update to version 2021-06-03

This update contains following changes:

 * ubusd: protect against too-short messages
 * ubusd: add per-client tx queue limit
 * ubusd: convert tx_queue to linked list

Fixes: FS#1525
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4f2243d40a400aa1ce6ae5d06325f93b4d9463a5)

2 years agobuild/json: fix IMAGE_PREFIX and DEVICE_PACKAGES
Paul Spooren [Wed, 2 Jun 2021 20:13:28 +0000 (10:13 -1000)]
build/json: fix IMAGE_PREFIX and DEVICE_PACKAGES

These two variables were missing in the definition of
DEFAULT_DEVICE_VARS which caused them to contain wrong values, messing
up the resulting JSON files.

This patch adds the two variables IMAGE_PREFIX and DEVICE_PACKAGES to
DEFAULT_DEVICE_VARS.

Suggested-by: Baptiste Jonglez <git@bitsofnetworks.org>
Signed-off-by: Paul Spooren <mail@aparcar.org>
2 years agorampis: use lzma-loader for ZTE MF283+
Lech Perczak [Sun, 28 Feb 2021 02:24:19 +0000 (03:24 +0100)]
rampis: use lzma-loader for ZTE MF283+

Without that, after merging support to master, the device fails to boot
due to LZMA decompression error:

3: System Boot system code via Flash.
raspi_read: from:80000 len:40
.   Image Name:   MIPS OpenWrt Linux-5.4.99
   Created:      2021-02-25  23:35:00 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    1786664 Bytes =  1.7 MB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:80040 len:1b4328
............................   Verifying Checksum ... OK
   Uncompressing Kernel Image ... LZMA ERROR 1 - must RESET board to recover

Use lzma-loader to fix it.

Fixes: 59d065c9f81c ("ramips: add support for ZTE MF283+")
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
(cherry picked from commit 410fb05b445c89a147029d1471e184a5594602db)
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agoramips: add support for ZTE MF283+
Lech Perczak [Sat, 6 Feb 2021 12:56:46 +0000 (13:56 +0100)]
ramips: add support for ZTE MF283+

ZTE MF283+ is a dual-antenna LTE category 4 router, based on Ralink
RT3352 SoC, and built-in ZTE P685M PCIe MiniCard LTE modem.

Hardware highlighs:
- CPU: MIPS24KEc at 400MHz,
- RAM: 64MB DDR2,
- Flash: 16MB SPI,
- Ethernet: 4 10/100M port switch with VLAN support,
- Wireless: Dual-stream 802.11n (RT2860), with two internal antennas,
- WWAN: Built-in ZTE P685M modem, with two internal antennas and two
  switching SMA connectors for external antennas,
- FXS: Single ATA, with two connectors marked PHONE1 and PHONE2,
  internally wired in parallel by 0-Ohm resistors, handled entirely by
  internal WWAN modem.
- USB: internal miniPCIe slot for modem,
  unpopulated USB A connector on PCB.
- SIM slot for the WWAN modem.
- UART connector for the console (unpopulated) at 3.3V,
  pinout: 1: VCC, 2: TXD, 3: RXD, 4: GND,
  settings: 57600-8-N-1.
- LEDs: Power (fixed), WLAN, WWAN (RGB),
  phone (bicolor, controlled by modem), Signal,
  4 link/act LEDs for LAN1-4.
- Buttons: WPS, reset.

Installation:
As the modem is, for most of the time, provided by carriers, there is no
possibility to flash through web interface, only built-in FOTA update
and TFTP recovery are supported.

There are two installation methods:
(1) Using serial console and initramfs-kernel - recommended, as it
allows you to back up original firmware, or
(2) Using TFTP recovery - does not require disassembly.

(1) Using serial console:
To install OpenWrt, one needs to disassemble the
router and flash it via TFTP by using serial console:
- Locate unpopulated 4-pin header on the top of the board, near buttons.
- Connect UART adapter to the connector. Use 3.3V voltage level only,
  omit VCC connection. Pin 1 (VCC) is marked by square pad.
- Put your initramfs-kernel image in TFTP server directory.
- Power-up the device.
- Press "1" to load initramfs image to RAM.
- Enter IP address chosen for the device (defaults to 192.168.0.1).
- Enter TFTP server IP address (defaults to 192.168.0.22).
- Enter image filename as put inside TFTP server - something short,
  like firmware.bin is recommended.
- Hit enter to load the image. U-boot will store above values in
  persistent environment for next installation.
- If you ever might want to return to vendor firmware,
  BACK UP CONTENTS OF YOUR FLASH NOW.
  For this router, commonly used by mobile networks,
  plain vendor images are not officially available.
  To do so, copy contents of each /dev/mtd[0-3], "firmware" - mtd3 being the
  most important, and copy them over network to your PC. But in case
  anything goes wrong, PLEASE do back up ALL OF THEM.
- From under OpenWrt just booted, load the sysupgrade image to tmpfs,
  and execute sysupgrade.

(2) Using TFTP recovery
- Set your host IP to 192.168.0.22 - for example using:
sudo ip addr add 192.168.0.22/24 dev <interface>
- Set up a TFTP server on your machine
- Put the sysupgrade image in TFTP server root named as 'root_uImage'
  (no quotes), for example using tftpd:
  cp openwrt-ramips-rt305x-zte_mf283plus-squashfs-sysupgrade.bin /srv/tftp/root_uImage
- Power on the router holding BOTH Reset and WPS buttons held for around
  5 seconds, until after WWAN and Signal LEDs blink.
- Wait for OpenWrt to start booting up, this should take around a
  minute.

Return to original firmware:
Here, again there are two possibilities are possible, just like for
installation:
(1) Using initramfs-kernel image and serial console
(2) Using TFTP recovery

(1) Using initramfs-kernel image and serial console
- Boot OpenWrt initramfs-kernel image via TFTP the same as for
  installation.
- Copy over the backed up "firmware.bin" image of "mtd3" to /tmp/
- Use "mtd write /tmp/firmware.bin /dev/mtd3", where firmware.bin is
  your backup taken before OpenWrt installation, and /dev/mtd3 is the
  "firmware" partition.

(2) Using TFTP recovery
- Follow the same steps as for installation, but replacing 'root_uImage'
  with firmware backup you took during installation, or by vendor
  firmware obtained elsewhere.

A few quirks of the device, noted from my instance:
- Wired and wireless MAC addresses written in flash are the same,
  despite being in separate locations.
- Power LED is hardwired to 3.3V, so there is no status LED per se, and
  WLAN LED is controlled by WLAN driver, so I had to hijack 3G/4G LED
  for status - original firmware also does this in bootup.
- FXS subsystem and its LED is controlled by the
  modem, so it work independently of OpenWrt.
  Tested to work even before OpenWrt booted.
  I managed to open up modem's shell via ADB,
  and found from its kernel logs, that FXS and its LED is indeed controlled
  by modem.
- While finding LEDs, I had no GPL source drop from ZTE, so I had to probe for
  each and every one of them manually, so this might not be complete -
  it looks like bicolor LED is used for FXS, possibly to support
  dual-ported variant in other device sharing the PCB.
- Flash performance is very low, despite enabling 50MHz clock and fast
  read command, due to using 4k sectors throughout the target. I decided
  to keep it at the moment, to avoid breaking existing devices - I
  identified one potentially affected, should this be limited to under
  4MB of Flash. The difference between sysupgrade durations is whopping
  3min vs 8min, so this is worth pursuing.

In vendor firmware, WWAN LED behaviour is as follows, citing the manual:
- red - no registration,
- green - 3G,
- blue - 4G.
Blinking indicates activity, so netdev trigger mapped from wwan0 to blue:wwan
looks reasonable at the moment, for full replacement, a script similar to
"rssileds" would need to be developed.

Behaviour of "Signal LED" in vendor firmware is as follows:
- Off - no signal,
- Blinking - poor coverage
- Solid - good coverage.

A few more details on the built-in LTE modem:
Modem is not fully supported upstream in Linux - only two CDC ports
(DIAG and one for QMI) probe. I sent patches upstream to add required device
IDs for full support.
The mapping of USB functions is as follows:
- CDC (QCDM) - dedicated to comunicating with proprietary Qualcomm tools.
- CDC (PCUI) - not supported by upstream 'option' driver yet. Patch
  submitted upstream.
- CDC (Modem) - Exactly the same as above
- QMI - A patch is sent upstream to add device ID, with that in place,
  uqmi did connect successfully, once I selected correct PDP context
  type for my SIM (IPv4-only, not default IPv4v6).
- ADB - self-explanatory, one can access the ADB shell with a device ID
  added to 51-android.rules like so:

SUBSYSTEM!="usb", GOTO="android_usb_rules_end"
LABEL="android_usb_rules_begin"
SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", ATTR{idProduct}=="1275", ENV{adb_user}="yes"
ENV{adb_user}=="yes", MODE="0660", GROUP="plugdev", TAG+="uaccess"
LABEL="android_usb_rules_end"

While not really needed in OpenWrt, it might come useful if one decides to
move the modem to their PC to hack it further, insides seem to be pretty
interesting. ADB also works well from within OpenWrt without that. O
course it isn't needed for normal operation, so I left it out of
DEVICE_PACKAGES.

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
[remove kmod-usb-ledtrig-usbport, take merged upstream patches]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
(cherry picked from commit 59d065c9f81c4d1a89464d071134a50529449f34)
[Manually remove no longer needed patches for modem]
Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2 years agokernel: bump 5.4 to 5.4.123
Kuan-Yi Li [Sun, 30 May 2021 01:58:26 +0000 (09:58 +0800)]
kernel: bump 5.4 to 5.4.123

Removed because in upstream
  generic/pending-5.4/770-02-net-ethernet-mtk_eth_soc-fix-rx-vlan-offload.patch

All others updated automatically.

Runtime-tested on bcm27xx/bcm2711.

Fixes: FS#3085
Signed-off-by: Kuan-Yi Li <kyli@abysm.org>
2 years agobuild: kernel2minor: work around path length limit
François Chavant [Fri, 7 May 2021 15:58:11 +0000 (17:58 +0200)]
build: kernel2minor: work around path length limit

When building for MikroTik devices the kernel2minor tool will sometimes
fail with:

  Can't get lstat from kernel file!: No such file or directory.

This is because kernel2minor expects paths no longer than 250 chars.
To work around this the include/image-commands.mk has been modified
to copy the kernel to a temporary file (/tmp/tmp.XXXXXXXXXX) before
calling kernel2minor.

Signed-off-by: François Chavant <francois@chavant.info>
(cherry picked from commit 5a9608102b3c444d0c963255f9d016a1d5469d5d)

2 years agoOpenWrt v21.02.0-rc2: revert to branch defaults
Hauke Mehrtens [Sat, 29 May 2021 18:02:03 +0000 (20:02 +0200)]
OpenWrt v21.02.0-rc2: revert to branch defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agoOpenWrt v21.02.0-rc2: adjust config defaults v21.02.0-rc2
Hauke Mehrtens [Sat, 29 May 2021 18:01:58 +0000 (20:01 +0200)]
OpenWrt v21.02.0-rc2: adjust config defaults

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agobase-files: simplify setting device MAC
Rafał Miłecki [Fri, 28 May 2021 06:18:08 +0000 (08:18 +0200)]
base-files: simplify setting device MAC

1. Move code above interface generation
   It results in more logical order. Device gets its config section
   above interface section.
2. Drop the loop
   We have separated code handling bridges now so $device should be
   guaranteed to contain a single device name.
3. Drop section name
   It's not required by netifd or LuCI & it's not needed by this script
   as $device contains a single device name now.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit e002179a6d2eea8640e262160030336bea54ec26)

2 years agoubox: fix init script validation of log_ip option
Jo-Philipp Wich [Fri, 28 May 2021 13:23:14 +0000 (15:23 +0200)]
ubox: fix init script validation of log_ip option

The underlying logread process uses usock() to handle remote connections
which is able to handle both hostnames and IP addresses.

Ref: https://github.com/openwrt/luci/issues/5077
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit ec83fb9ced138b7945135adffb9ff0ba63b695ec)

2 years agobase-files: generate network config with "device" options
Rafał Miłecki [Mon, 24 May 2021 14:45:06 +0000 (16:45 +0200)]
base-files: generate network config with "device" options

Replace "ifname" with "device" as netifd has been recently patches to
used the later one. It's more clear and accurate.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 4b9a67362d70c544b85078b8d5c661f43f7472d9)

2 years agobase-files: fix configuration generation of network if "bridge" exists
INAGAKI Hiroshi [Sun, 23 May 2021 11:30:58 +0000 (20:30 +0900)]
base-files: fix configuration generation of network if "bridge" exists

After the commit 43fc720657c6e3b30c6ed89d7227ee6e646c158b
("base-files: generate "device UCI type section for bridge"), the wrong
network configuration is generated for the devices that already have the
bridge device section for VLAN, such as the devices in realtek target.

As a result, the bridge device by additional "device" section is
specified to the "ports" option in the "bridge-vlan" section and netifd
shuts down the switch and the ethernet when the network service started.

Fixes: 43fc720657 ("base-files: generate "device" UCI type section for bridge")
Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
[rmilecki: use $ports for generate_bridge_vlan argument]
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 8cc4e87a2f81df02dbe481759ae6c36cf056c13b)

2 years agobase-files: support setting bridge MAC address
Rafał Miłecki [Mon, 24 May 2021 05:46:12 +0000 (07:46 +0200)]
base-files: support setting bridge MAC address

Fixes: 43fc720657c6 ("base-files: generate "device" UCI type section for bridge")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 7a90ad3c431031191afe51b163bf97d3ec820d54)

2 years agobase-files: generate bridge device sections with br- name prefix
Rafał Miłecki [Thu, 20 May 2021 08:32:18 +0000 (10:32 +0200)]
base-files: generate bridge device sections with br- name prefix

Missing br- prefix could result in name conflict between DSA port
interface and bridge interface. Some devices with just one LAN port use
"lan" interface name for DSA port. Trying to create bridge with the same
"lan" name was failing.

Reported-by: David Bauer <mail@david-bauer.net>
Fixes: 43fc720657c6 ("base-files: generate "device" UCI type section for bridge")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 0e459668c5b3b158991803204f628b1b7dce9034)

2 years agobase-files: generate "device" UCI type section for bridge
Rafał Miłecki [Sat, 15 May 2021 19:06:27 +0000 (21:06 +0200)]
base-files: generate "device" UCI type section for bridge

This switches from the old way of defining bridges in an "interface" UCI
section type (that should be used for layer 3 only). From now a defualt
board switch will have its own "device" UCI section type. It's a new &
preferred way of defining L2 devices.

Before:

config interface 'lan'
        option type 'bridge'
        option ifname 'lan1 lan2 lan3 lan4'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

After:

config device
        option name 'lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option ifname 'lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 43fc720657c6e3b30c6ed89d7227ee6e646c158b)

2 years agobusybox: show reproducible timestamp
Paul Spooren [Thu, 13 May 2021 21:57:45 +0000 (23:57 +0200)]
busybox: show reproducible timestamp

On login busybox shows a timestamp per default contianing the build
date. Since the build date isn't reproducible per default this behaviour
was disabled by default via 34df4d40 "busybox: disable timestamp in
version".

This commit modifies busybox so that the printed timestamp reproducible
using SOURCE_DATE_EPOCH and therefore shouldn't be disabled anymore.

Before:

    BusyBox v1.33.1 () built-in shell (ash)

After:

    BusyBox v1.33.1 (2021-05-13 09:34:34 UTC) built-in shell (ash)

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit a725382978515abfb2eb7be3bafef735dca97dbd)

2 years agobusybox: use $(AUTORELEASE) and SPDX
Paul Spooren [Tue, 18 May 2021 13:36:10 +0000 (15:36 +0200)]
busybox: use $(AUTORELEASE) and SPDX

use AUTORELEASE since BusyBox is often updaten and PKG_RELEASE is not
consistently bumped. Also use SPDX license headers to be machine
readable and bump the copyright year to 2021.

Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit 25fdb42249aef7b5eb53675f82f0091c532bf90c)

2 years agoipq806x: improve system latency
Ansuel Smith [Sun, 28 Mar 2021 01:29:59 +0000 (03:29 +0200)]
ipq806x: improve system latency

Various report and data show that the freq 384000 is too low and cause some
extra latency to the entire system. OEM qsdk code also set the min frequency
for this target to 800 mhz.
Also some user notice some instability with this idle frequency, solved by
setting the min frequency to 600mhz. Fix all these kind of problem by
introducing a boot init.d script that set the min frequency to 600mhz and set
the ondemand governor to be more aggressive. The script set these value only if
the ondemand governor is detected. 384 mhz freq is still available and user can
decide to restore the old behavior by disabling this script.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
(cherry picked from commit 861b82d36ae43efec8d16e61b82482e38996af92)

2 years agoarchs38: set device vendor and model variables
Moritz Warning [Mon, 8 Mar 2021 15:34:25 +0000 (16:34 +0100)]
archs38: set device vendor and model variables

This fixes the profiles.json output.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit cc54f65daa6101721c068cd00fdead1815db0bbf)

2 years agoarc770: set device vendor and model variables
Moritz Warning [Mon, 8 Mar 2021 13:12:53 +0000 (14:12 +0100)]
arc770: set device vendor and model variables

This fixes the profiles.json output.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
(cherry picked from commit d00bbd9de0719eededc7ee6a7cb2d8f4de6e4540)

2 years agobuild: avoid generating JSON info on missing image
David Bauer [Wed, 24 Feb 2021 20:38:15 +0000 (21:38 +0100)]
build: avoid generating JSON info on missing image

Previously, build would fail for targets containing devices with not
initramfs image (such as mpc85xx-p1010). Only generate the JSON image
info for the initramfs image when we have one to avoid breaking the
builds.

Fixes commit d3140d052964 ("build/json: generate json file for initramfs")

Signed-off-by: David Bauer <mail@david-bauer.net>
(cherry picked from commit 512229ce4967814a09ce202855e6b632d2e97a3c)

2 years agobuild/json: generate json file for initramfs
Moritz Warning [Fri, 8 Jan 2021 23:02:57 +0000 (00:02 +0100)]
build/json: generate json file for initramfs

The initramfs images are missing from the profiles.json files.

Signed-off-by: Moritz Warning <moritzwarning@web.de>
[fix code by exporting device variables]
Signed-off-by: Paul Spooren <mail@aparcar.org>
(cherry picked from commit d3140d05296461deddaaa8ca2ce4a4a97a320eff)