openwrt/staging/blogic.git
4 years agohostapd: remove hostapd-hs20 variant
Daniel Golle [Thu, 29 Oct 2020 12:50:47 +0000 (12:50 +0000)]
hostapd: remove hostapd-hs20 variant

Hotspot 2.0 AP features have been made available in the -full variants
of hostapd and wpad. Hence we no longer need a seperate package for
that.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agohostapd: add {hostapd,wpad}-basic-openssl variants
Rui Salvaterra [Thu, 29 Oct 2020 18:58:37 +0000 (18:58 +0000)]
hostapd: add {hostapd,wpad}-basic-openssl variants

Add OpenSSL-linked basic variants (which provides WPA-PSK only, 802.11r and
802.11w) of both hostapd and wpad. For people who don't need the full hostapd
but are stuck with libopenssl for other reasons, this saves space by avoiding
the need of an additional library (or a larger hostapd with built-in crypto).

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
4 years agoopkg: bump to git HEAD
Daniel Golle [Fri, 30 Oct 2020 00:19:29 +0000 (00:19 +0000)]
opkg: bump to git HEAD

 8769c75 pkg_hash: don't suggest incompatible packages

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: mikrotik: use vmlinuz (zBoot ELF)
John Thomson [Thu, 15 Oct 2020 09:27:55 +0000 (19:27 +1000)]
ath79: mikrotik: use vmlinuz (zBoot ELF)

- minimal built initramfs: 10MB vmlinux ELF -> 6MB vmlinuz
- ~5 seconds for kernel decompression, which was equivalent to the
  additional time to load the uncompressed ELF from SPI NOR.
- Removes requirement for lzma-loader, which may have been causing some
  image builds to fail to boot on Mikrotik mt7621.

Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
4 years agomt7621: mikrotik: use vmlinuz (zBoot ELF)
John Thomson [Thu, 15 Oct 2020 09:27:55 +0000 (19:27 +1000)]
mt7621: mikrotik: use vmlinuz (zBoot ELF)

- minimal built initramfs: 11MB vmlinux ELF -> 4.5MB vmlinuz
- ~5 seconds for kernel decompression, which was equivalent to the
  additional time to load the uncompressed ELF from SPI NOR.
- Removes requirement for lzma-loader, which may have been causing some
  image builds to fail to boot on Mikrotik mt7621.

Fixes: FS#3354
Suggested-by: Thibaut VARÈNE <hacks@slashdirt.org>
Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
4 years agobuild: image: add append-dtb-elf helper
John Thomson [Thu, 15 Oct 2020 09:06:41 +0000 (19:06 +1000)]
build: image: add append-dtb-elf helper

The mips kernel vmlinux image supports adding an empty ELF section
for DTB to be later inserted into with MIPS_ELF_APPENDED_DTB.

This ELF + inserted DTB image can then be directly booted on some
devices.

Example usage:
image/subtarget.mk:
KERNEL_NAME := vmlinux.elf
KERNEL_INITRAMFS_NAME := vmlinux-initramfs.elf
KERNEL := kernel-bin | append-dtb-elf

On mt7621 memory size needed to be manually specified.

Signed-off-by: John Thomson <git@johnthomson.fastmail.com.au>
4 years agokernel: mips: zboot: put appended dtb into a section
Chuanhong Guo [Thu, 29 Oct 2020 13:22:57 +0000 (21:22 +0800)]
kernel: mips: zboot: put appended dtb into a section

This will make a separated section for dtb appear in ELF, and we can
then use objcopy to patch a dtb into vmlinuz when RAW_APPENDED_DTB
is set in kernel config.

command to patch a dtb:
objcopy --set-section-flags=.appended_dtb=alloc,contents \
        --update-section=.appended_dtb=<target>.dtb vmlinuz vmlinuz-dtb

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agoramips: add linux zboot support
Chuanhong Guo [Wed, 14 Oct 2020 13:17:56 +0000 (21:17 +0800)]
ramips: add linux zboot support

linux-mips has zboot code which can create a self-extracting kernel
image.
This allows enabling kernel zboot support for ramips targets.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agohostapd: wpas: add missing config symbols
David Bauer [Wed, 28 Oct 2020 02:17:11 +0000 (03:17 +0100)]
hostapd: wpas: add missing config symbols

This adds missing config symbols for interworking as well as Hotspot 2.0
to the wpa_supplicant-full configuration.

These symbols were added to the hostapd-full configuration prior to this
commit. Without adding them to the wpa_supplicant configuration,
building of wpad-full fails.

Thanks to Rene for reaching out on IRC.

Fixes: commit be9694aaa297 ("hostapd: add UCI support for Hotspot 2.0")
Fixes: commit 838b412cb527 ("hostapd: add interworking support")
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agodnsmasq: install /etc/hotplug.d/ntp/25-dnsmasqsec world-readable
Daniel Golle [Wed, 28 Oct 2020 01:56:16 +0000 (01:56 +0000)]
dnsmasq: install /etc/hotplug.d/ntp/25-dnsmasqsec world-readable

/etc/hotplug.d/ntp/25-dnsmasqsec is being sourced by /sbin/hotplug-call
running as ntpd user. For that to work the file needs to be readable by
that user.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agomac80211: Fix wpa_supplicant config removal ubus call
Sven Eckelmann [Thu, 22 Oct 2020 08:52:08 +0000 (10:52 +0200)]
mac80211: Fix wpa_supplicant config removal ubus call

If mac80211_setup_supplicant() is called with enabled=0 then it should just
destroy the interface and remove the configuration from wpa_supplicant. But
the ubus method call always returned

  Command failed: Method not found

because the actual name of the method is "config_remove".

Fixes: b5516603dd90 ("mac80211: more wifi reconf related fixes")
Signed-off-by: Sven Eckelmann <sven@narfation.org>
[bump PKG_RELEASE]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agohostapd: bump PKG_RELEASE
David Bauer [Tue, 27 Oct 2020 23:09:34 +0000 (00:09 +0100)]
hostapd: bump PKG_RELEASE

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agohostapd: add interworking support
David Bauer [Mon, 19 Oct 2020 00:29:47 +0000 (02:29 +0200)]
hostapd: add interworking support

This adds configuration options to enable interworking for hostapd.
All options require iw_enabled to be set to 1 for a given VAP.

All IEEE802.11u related settings are supported with exception of the
venue information which will be added as separate UCI sections at a
later point.

The options use the same name as the ones from the hostapd.conf file
with a "iw_" prefix added.

All UCI configuration options are passed without further modifications
to hostapd with exceptions of the following options, whose elements can
be provided using UCI lis elements:

 - iw_roaming_consortium
 - iw_anqp_elem
 - iw_nai_realm
 - iw_domain_name
 - iw_anqp_3gpp_cell_net

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agohostapd: add FTM responder support
David Bauer [Sun, 18 Oct 2020 21:09:09 +0000 (23:09 +0200)]
hostapd: add FTM responder support

This adds support for enabling the FTM responder flag for the APs
extended capabilities. On supported hardware, enabling the ftm_responder
config key for a given AP will enable the FTM responder bit.

FTM support itself is unconditionally implemented in the devices
firmware (ath10k 2nd generation with 3.2.1.1 firmware). There's
currently no softmac implementation.

Also allow to configure LCI and civic location information which can be
transmitted to a FTM initiator.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agomac80211: pass phy name to hostapd_set_bss_options
David Bauer [Mon, 19 Oct 2020 17:36:56 +0000 (19:36 +0200)]
mac80211: pass phy name to hostapd_set_bss_options

hostapd_set_bss_options expects the PHY as second and the VIF as third
argument. However, only the VIF was passed as second argument without a
third argument at all.

This was never a problem, as both PHY and VIF were never accessed.
However, with FTM support the PHY is needed to determine the HW support
when configuring the BSS.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agohostapd: remove ieee80211v option
David Bauer [Sun, 18 Oct 2020 23:21:23 +0000 (01:21 +0200)]
hostapd: remove ieee80211v option

Remove the ieee80211v option. It previously was required to be enabled
in order to use time_advertisement, time_zone, wnm_sleep_mode and
bss_transition, however it didn't enable any of these options by default.

Remove it, as configuring these options independently is enough.

This change does not influence the behavior of any already configured
setting.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agohostapd: make rrm report independent of ieee80211k setting
David Bauer [Sun, 18 Oct 2020 20:35:31 +0000 (22:35 +0200)]
hostapd: make rrm report independent of ieee80211k setting

Allow to configure both RRM beacon as well as neighbor reports
independently and only enable them by default in case the ieee80211k
config option is set.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agouci: fix package mirror hash
Petr Štetiar [Tue, 27 Oct 2020 21:56:35 +0000 (22:56 +0100)]
uci: fix package mirror hash

I've forget to update PKG_MIRROR_HASH in my previous package version
bump.

Fixes: 095cc2b7454a ("uci: update to version 2020-10-06")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoumdns: update to version 2020-10-26
Petr Štetiar [Mon, 26 Oct 2020 07:35:01 +0000 (08:35 +0100)]
umdns: update to version 2020-10-26

59e4fc98162d cache: cache_answer: fix off by one
4cece9cc7db4 cache: cache_record_find: fix buffer overflow
be687257ee0b cmake: tests: provide umdns-san binary
bf01f2dd0089 tests: add dns_handle_packet_file tool
134afc728846 tests: add libFuzzer based fuzzing
de08a2c71ca8 cmake: create static library
cdc18fbb3ea8 interface: fix possible null pointer dereference
1fa034c65cb6 interface: fix value stored to 'fd' is never read
3a67ebe3fc66 Add initial GitLab CI support
50caea125517 cmake: fix include dirs and libs lookup

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agouci: update to version 2020-10-06
Petr Štetiar [Tue, 6 Oct 2020 07:34:24 +0000 (09:34 +0200)]
uci: update to version 2020-10-06

52bbc99f69ea Replace malloc() + memset() with calloc()
3fbd6c923434 ucimap: Check return of malloc()
eae126f66663 file: Check buffer size after strtok()
7f574273180a file: use size_t for position and pointer
19770b6949b9 file: use dynamic memory allocation for tempfile name
aa46546794ac file: uci_file_commit: fix memory leak
671c7554bfde uci: silence UBSAN error by using offsetof macro from compiler
ea5bbd57d0e1 tests: cram: add uci import testing on fuzzer corpus
31f78bfbf75f cmake: add uci-san cli built with clang sanitizers
a3e650911f5e file: uci_parse_package: fix heap use after free
9bd361ca3236 tests: add libFuzzer based fuzzing

Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoramips: add support for Wavlink WL-WN530HG4
Nuno Goncalves [Thu, 13 Aug 2020 22:26:13 +0000 (23:26 +0100)]
ramips: add support for Wavlink WL-WN530HG4

Same hardware as Phicomm K2G but different flash layout.

Specification:
- SoC: MediaTek MT7620A
- Flash: 8 MB
- RAM: 64 MB
- Ethernet: 4 FE ports and 1 GE port (RTL8211F on port 5)
- Wireless radio: MT7620 for 2.4G and MT7612E for 5G, both equipped
  with external PA.
- UART: 1 x UART on PCB - 57600 8N1

Flash instruction:
To avoid requiring UART for TFTP a dual flash procedure is suggested
to install the squashfs image:
1. Rename openwrt-ramips-mt7620-wavlink_wl-wn530hg4-initramfs-kernel.bin
   to WN530HG4-WAVLINK.
2. Flash this file with the factory web interface.
3. With OpenWRT now running use standard sysupgrade to install the
   squashfs image.

Signed-off-by: Nuno Goncalves <nunojpg@gmail.com>
[remove dts-v1, remove model from LED labels, wrap commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agomalta: relocate CPU_TYPE setting to subtarget makefiles
Tony Ambardar [Sun, 16 Aug 2020 20:07:30 +0000 (13:07 -0700)]
malta: relocate CPU_TYPE setting to subtarget makefiles

Move CPU_TYPE:=24kc (32-bit) from the top-level target makefile to the
be/le subtarget makefiles, which is consistent with the 64-bit subtargets.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
4 years agolantiq: add support for AVM FRITZ!Box 7430
Leon Maurice Adam [Sun, 3 May 2020 10:44:24 +0000 (12:44 +0200)]
lantiq: add support for AVM FRITZ!Box 7430

Hardware:
- SoC: Lantiq VRX 220
- CPU: 2x MIPS 34Kc 500 MHz
- RAM: 128 MiB 250 MHz
- Flash: 128 MiB NAND
- Ethernet: Built-in Fast Ethernet switch, 4 ports used
- Wifi: Atheros AR9381-AL1A b/g/n with 2 pcb/internal and 1 external antennas
- USB: 1x USB 2.0
- DSL: Built-in A/VDSL2 modem
- DECT: Dialog SC14441
- LEDs: 1 two-color, 4 one-color
- Buttons: 1x DECT, 1x WIFI
- Telephone connectors: 1 FXS port via TAE or RJ11 connector

With the exception of FXS/DECT everything works
(there are no drivers for AVM's FXS or DECT implementation),
DSL is yet untested.

Installation:
Boot up the device and wait a few seconds. Run the eva_ramboot.py script
in scripts/flashing/ to load the initramfs image on the device:
$ ./scripts/flashing/eva_ramboot.py 192.168.178.1 <path to your initramfs image>
If the script fails to reach the device, maybe try 169.254.120.1.

Wait until booting is complete. You should now be able to reach your device
under the default ip address 192.168.1.1.

Before flashing, check if linux_fs_start is not set to 1 in the tffs partition:
$ fritz_tffs_nand -d /dev/mtd1 -n linux_fs_start
If linux_fs_start is 1, you will need to reset it to 0, either by FTP,
upgrading FritzOS or doing a recovery.

Now you should be able to flash the device using sysupgrade.

Signed-off-by: Leon Maurice Adam <leon.adam@aol.de>
Acked-by: Aleksander Jan Bajkowski <A.Bajkowski@stud.elka.pw.edu.pl>
[drop BOARD_NAME, use wpad-basic-wolfssl, drop 4.19, drop dts-v1,
remove model prefix from LED names]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolantiq: fix indent in vr9_avm_fritz7412.dts
Adrian Schmutzler [Tue, 27 Oct 2020 12:33:21 +0000 (13:33 +0100)]
lantiq: fix indent in vr9_avm_fritz7412.dts

Indent should be tabs.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobcm63xx: reorganize board patches into fewer files
Adrian Schmutzler [Sun, 4 Oct 2020 16:00:28 +0000 (18:00 +0200)]
bcm63xx: reorganize board patches into fewer files

At the moment, bcm63xx creates one patch for each board to add to
board_bcm963xx.c. While this is not really helpful to get an overview
in the first place, it is particularly painful if you want to change
something for an early file and have to refresh all the later patches
accordingly.

Since it does not look like these board patches are upstreamed either,
this commit consolidates all board additions into one patch per "board".
By this, both adding and editing boards should become much simpler,
and we drop about 1300 lines of "code" from patches as well.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: enable upgrade from ar71xx for Qxwlan devices
Adrian Schmutzler [Sat, 17 Oct 2020 12:00:54 +0000 (14:00 +0200)]
ath79: enable upgrade from ar71xx for Qxwlan devices

This supports upgrade from ar71xx for the recently added Qxwlan
devices E1700AC v2, E558 v2, E750A v4 and E750G v8.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoocteon: use dedicated function to move config backup
Roman Kuzmitskii [Thu, 22 Oct 2020 18:31:07 +0000 (18:31 +0000)]
octeon: use dedicated function to move config backup

All octeon devices use the same or a very similar way to backup
and restore configuration.

We expect to have more devices added and in order to stop
repeating ourselves move the logic to a separate function.

While at it, add a few checks.

Signed-off-by: Roman Kuzmitskii <damex.pp@icloud.com>
[commit message facelift]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agodnsmasq: include IPv6 local nameserver entry
Joel Johnson [Fri, 21 Aug 2020 14:32:00 +0000 (08:32 -0600)]
dnsmasq: include IPv6 local nameserver entry

For IPv6 native connections when using IPv6 DNS lookups, there is no
valid default resolver if ignoring WAN DHCP provided nameservers.

This uses a runtime check to determine if IPv6 is supported on the host.

Signed-off-by: Joel Johnson <mrjoel@lixil.net>
4 years agosdk: keep the linux package in the same subdir as in the main build system
Felix Fietkau [Mon, 19 Oct 2020 09:28:29 +0000 (11:28 +0200)]
sdk: keep the linux package in the same subdir as in the main build system

Fixes: 953435795d17 ("build: always build package/kernel/linux")
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoath79: fix block protection clearing
Nick Hainke [Sat, 24 Oct 2020 22:52:47 +0000 (00:52 +0200)]
ath79: fix block protection clearing

The block protection bits of macronix do not match the implementation.
The chip has 3 BP bits. Bit 5 is actually the third BP but here the
5th bit is SR_TB. Therefore the patch adds SR_TB to the mask. In the
4.19er kernel the whole register was simply set to 0.

The wrong implementation did not remove the block protection. This led
to jffs2 errors in the form of:
"jffs2: Newly-erased block contained word 0x19852003 at offset 0x..."
This caused inconsistent memory and other errors.

Suggested-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Nick Hainke <vincent@systemli.org>
4 years agolayerscape: several kernel fix-ups from NXP linux factory
Yangbo Lu [Thu, 15 Oct 2020 08:56:10 +0000 (16:56 +0800)]
layerscape: several kernel fix-ups from NXP linux factory

NXP linux factory unifies one linux kernel for i.MX, Layerscape and
S32 platforms. It provides a common code base for their SDKs.

Add several kernel patches for bug fix from linux factory last release.

Git: https://source.codeaurora.org/external/qoriq/qoriq-components/linux
Tag: LTS-5.4.47-20200828

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years agolayerscape: update tfa to LSDK-20.04-update-290520
Biwen Li [Thu, 6 Aug 2020 07:41:39 +0000 (07:41 +0000)]
layerscape: update tfa to LSDK-20.04-update-290520

Update tfa to LSDK-20.04-update-290520.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[fix PKG_RELEASE bump]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: update u-boot to LSDK-20.04-update-290520
Biwen Li [Thu, 6 Aug 2020 07:37:05 +0000 (07:37 +0000)]
layerscape: update u-boot to LSDK-20.04-update-290520

Update u-boot to LSDK-20.04-update-290520.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[fix PKG_RELEASE bump]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: update ls-rcw to LSDK-20.04-update-290520
Biwen Li [Thu, 6 Aug 2020 07:14:15 +0000 (07:14 +0000)]
layerscape: update ls-rcw to LSDK-20.04-update-290520

Update ls-rcw to LSDK-20.04-update-290520.

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
[rebase, fix PKG_RELEASE change]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: update kernel to LSDK-20.04-V5.4-update-290520
Biwen Li [Thu, 6 Aug 2020 06:49:00 +0000 (06:49 +0000)]
layerscape: update kernel to LSDK-20.04-V5.4-update-290520

Update kernel from LSDK-20.04-V5.4 to LSDK-20.04-V5.4-update-290520.
Only two patches added for Layerscape.

LSDK kernel link
https://source.codeaurora.org/external/qoriq/qoriq-components/linux/

Signed-off-by: Biwen Li <biwen.li@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
4 years agolayerscape: harmonize wrapping for IMAGE/* definitions
Adrian Schmutzler [Sun, 25 Oct 2020 16:58:49 +0000 (17:58 +0100)]
layerscape: harmonize wrapping for IMAGE/* definitions

Always keep the first line empty for multi-line IMAGE/* definitions.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: create shared definitions for sdboot devices
Adrian Schmutzler [Sun, 25 Oct 2020 16:53:53 +0000 (17:53 +0100)]
layerscape: create shared definitions for sdboot devices

This moves a few shared variables for SD-Boot devices into common
definitions in order to reduce duplicate code.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: Change to combined rootfs on sd images
Pawel Dembicki [Mon, 24 Aug 2020 12:29:32 +0000 (14:29 +0200)]
layerscape: Change to combined rootfs on sd images

At this moment layerscape images are ext4 only. It causes problem with
save changes durring sysupgrade and make "firstboot" and failsafe mode
useless.

This patch changes sd-card images to squashfs + f2fs combined images.
To make place, for saving config, kernel space ar now ext4 partition
with fit kernel.

This method of image generation is similar to rest of OpenWrt sd-card
targets.

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[reword README, reword DEVICE_COMPAT_MESSAGE, keep original indent]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: fix platform_copy_config function
Pawel Dembicki [Mon, 24 Aug 2020 10:21:19 +0000 (12:21 +0200)]
layerscape: fix platform_copy_config function

At this moment platform_copy_config function is used for every device
and function "export_partdevice" without "export_bootdevice" causes
multiple errors like that:
"sh: 1: unknown operand"

This patch fix usage of export_partdevice and split platform_copy_config
for sd-card images.

Fixes: 0841b68c91d3 ("layerscape: support sysupgrade for SD card ext4
rootfs")

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years agolayerscape: add dtb to sysupgrade
Pawel Dembicki [Wed, 19 Aug 2020 10:13:26 +0000 (12:13 +0200)]
layerscape: add dtb to sysupgrade

At this moment sysupgrade replaces only kernel and rootfs.

This patch add dtb part to sysupgrade images to avoid situation
when old dtb make system broken.

Is possible to sysupgrade older images for NOR devices:
1. Firmware partition in bootargs need to be updated to:
   "49m@0xf00000(firmware)". Env should be saved after changes.
2. After step one, "sysupgrade -F" will work.

Run tested: LS1046A-RDB

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[bump PKG_RELEASE for uboot-layerscape]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agolayerscape: fix sd-card sysupgrade
Pawel Dembicki [Thu, 20 Aug 2020 07:28:01 +0000 (09:28 +0200)]
layerscape: fix sd-card sysupgrade

So far, kernel has not been written correctly to SD card during
sysupgrade, as both target path and offset were wrong.

This patch fixes it, and adds some descriptive output on the way.

Fixes: 0841b68c91d3 ("layerscape: support sysupgrade for SD card ext4
rootfs")

Reviewed-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
[alter/extend commit message]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoubus: bump to git HEAD
Daniel Golle [Sun, 25 Oct 2020 18:07:19 +0000 (18:07 +0000)]
ubus: bump to git HEAD

 ad0cd11 ubusd_acl: add support for wildcard in methods

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agobusybox: make username consistent
Daniel Golle [Sun, 25 Oct 2020 17:24:03 +0000 (17:24 +0000)]
busybox: make username consistent

ntpd in packages feed had already a user 'ntp' with UID 123 declared.
Rename the username of busybox-ntpd to be 'ntp' instead of 'ntpd' so
it doesn't clash.

Reported-by: Etienne Champetier <champetier.etienne@gmail.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: define 2.4GHz radio for litebeam ac gen2
Nick Hainke [Sun, 25 Oct 2020 11:58:30 +0000 (12:58 +0100)]
ath79: define 2.4GHz radio for litebeam ac gen2

The litebeam ac gen2 has a 2.4GHz management radio.

Signed-off-by: Nick Hainke <vincent@systemli.org>
4 years agoath79: define 2.4GHz radio for nanostation ac loco
Nick Hainke [Sun, 25 Oct 2020 13:41:31 +0000 (14:41 +0100)]
ath79: define 2.4GHz radio for nanostation ac loco

The nanostation ac loco has a 2.4GHz management radio.

Signed-off-by: Nick Hainke <vincent@systemli.org>
4 years agoath79: fix nanostation ac loco ethernet interface
Nick Hainke [Sun, 25 Oct 2020 13:34:40 +0000 (14:34 +0100)]
ath79: fix nanostation ac loco ethernet interface

In 4.14 the delays were not cleared, so setting "rgmii" as phy-mode
did not affect delays set by the bootloader. With 5.4 kernel the
situation changed and the ethernet interface stopped working.

Just taking the ethernetpart from the litebeam ac gen2 will fix
the issue.

Explained-by: David Bauer <mail@david-bauer.net>
Signed-off-by: Nick Hainke <vincent@systemli.org>
4 years agoramips: mt7621: use lzma-loader for U7621-06
Jianhui Zhao [Fri, 23 Oct 2020 01:42:03 +0000 (09:42 +0800)]
ramips: mt7621: use lzma-loader for U7621-06

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

Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
4 years agoramips: add support for TOTOLINK X5000R
Chuanhong Guo [Wed, 21 Oct 2020 05:11:35 +0000 (13:11 +0800)]
ramips: add support for TOTOLINK X5000R

Specifications:
- SoC: MT7621AT
- RAM: 256MB
- Flash: 16MB (EN25QH128A)
- Ethernet: 5xGbE
- WiFi: MT7915 2x2 2.4G 573.5Mbps + 2x2 5G 1201Mbps

Known issue:
MT7915 DBDC variant isn't supported yet.

Flash instruction:
Upload the sysupgrade firmware to the firmware upgrade page in
vendor fw.

Other info:
MT7915 seems to have two PCIEs connected to MT7621. Card detected on
PCIE0 has an ID of 14c3:7916 and the other one on PCIE1 has 14c3:7915.

Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4 years agodnsmasq: adapt to non-root ntpd
Daniel Golle [Sun, 25 Oct 2020 12:44:50 +0000 (12:44 +0000)]
dnsmasq: adapt to non-root ntpd

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agobusybox: allow ntpd to run as non-root ntpd user
Daniel Golle [Mon, 19 Oct 2020 20:22:30 +0000 (21:22 +0100)]
busybox: allow ntpd to run as non-root ntpd user

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoprocd: ujail fixes
Daniel Golle [Fri, 23 Oct 2020 02:07:09 +0000 (03:07 +0100)]
procd: ujail fixes

ec461ff jail: mount more stuff read-only
33b799b ujail: elf: work around GCC bug on MIPS64

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoubox: run logd non-root as user logd
Daniel Golle [Mon, 19 Oct 2020 20:37:38 +0000 (21:37 +0100)]
ubox: run logd non-root as user logd

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agonetfilter.mk: remove now obsolete kmod nf_nat_redirect
Yousong Zhou [Tue, 20 Oct 2020 01:41:07 +0000 (09:41 +0800)]
netfilter.mk: remove now obsolete kmod nf_nat_redirect

Now that the minimal kernel version maintained here is 4.19

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: add version conditional around nf_nat_redirect mod
Yousong Zhou [Fri, 9 Oct 2020 08:34:16 +0000 (16:34 +0800)]
netfilter.mk: add version conditional around nf_nat_redirect mod

Kernel commit 1ac89d20150e ("netfilter: nat: merge nf_nat_redirect into
nf_nat") made the redirect module part of the nat core and changed the
CONFIG_NF_NAT_REDIRECT option to a boolean, without prompt, affecting
kernel 4.18 onwards.  CONFIG_NF_NAT_REDIRECT now can only be selected by
CONFIG_NFT_REDIR or NETFILTER_XT_TARGET_REDIRECT

Fixes: FS#2476
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2476

Fixes: FS#2990 (partial)
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2990

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
[note that the option has no prompt and can only be selected by other
kconfig options]
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: add version conditional around CONFIG_NF_NAT_PROTO_GRE
Yousong Zhou [Fri, 9 Oct 2020 09:22:04 +0000 (17:22 +0800)]
netfilter.mk: add version conditional around CONFIG_NF_NAT_PROTO_GRE

It was removed in upstream linux commit faec18db ("netfilter: nat:
remove l4proto->manip_pkt").  This happened since linux 5.0

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: add version conditional for CONFIG_NF_CT_PROTO_GRE
Tony Ambardar [Mon, 27 Jul 2020 07:24:23 +0000 (00:24 -0700)]
netfilter.mk: add version conditional for CONFIG_NF_CT_PROTO_GRE

Kernel commit 22fc4c4c9fd6 ("netfilter: conntrack: gre: switch module to
be built-in") moved the CT GRE code into the core nf_conntrack.ko module
and changed the CONFIG_NF_CT_PROTO_GRE option to boolean for kernel 5.1
and onwards.

CONFIG_NF_CT_PROTO_GRE at the moment has no prompt and can only be
selected by NF_CONNTRACK_PPTP

Fixes: FS#2990 (partial)
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2990

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
[note that the option now can not be enabled on its own]
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agogeneric: 5.4: make nf nat masquerade in unset state by default
Yousong Zhou [Fri, 25 Sep 2020 15:02:05 +0000 (23:02 +0800)]
generic: 5.4: make nf nat masquerade in unset state by default

Upstream linux 5.1 commit d1aca8ab ("netfilter: nat: merge ipv4 and ipv6
masquerade functionality") replaces the following 2 options

 - CONFIG_NF_NAT_MASQUERADE_IPV4
 - CONFIG_NF_NAT_MASQUERADE_IPV6

with CONFIG_NF_NAT_MASQUERADE.  The new option is one without prompt and
will be selected by CONFIG_NETFILTER_XT_TARGET_MASQUERADE introduced
still later in 5.2.

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: add version conditional for nf_nat_ipv4,6
Yousong Zhou [Fri, 25 Sep 2020 14:37:43 +0000 (22:37 +0800)]
netfilter.mk: add version conditional for nf_nat_ipv4,6

The upstream linux commit is 3bf195ae ("netfilter: nat: merge
nf_nat_ipv4,6 into nat core").  It was included since linux 5.1

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: use CONFIG_NETFILTER_XT_TARGET_REDIRECT
Yousong Zhou [Fri, 9 Oct 2020 08:32:48 +0000 (16:32 +0800)]
netfilter.mk: use CONFIG_NETFILTER_XT_TARGET_REDIRECT

CONFIG_IP_NF_TARGET_REDIRECT is a compat option since upstream commit
2cbc78a2 ("netfilter: combine ipt_REDIRECT and ip6t_REDIRECT").  That
happened since linux 3.10

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetfilter.mk: use CONFIG_NETFILTER_XT_TARGET_MASQUERADE
Yousong Zhou [Fri, 25 Sep 2020 14:59:04 +0000 (22:59 +0800)]
netfilter.mk: use CONFIG_NETFILTER_XT_TARGET_MASQUERADE

CONFIG_IP_NF_TARGET_MASQUERADE and its counterpart
CONFIG_IP6_NF_TARGET_MASQUERADE are "backwards-compat option for the
user's convenience"

Related commit d22c1755 ("netfilter: fix NAT packaging with kernels
5.2+")

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agonetifd: bump to version 2020-10-22
Yousong Zhou [Sat, 24 Oct 2020 10:28:58 +0000 (18:28 +0800)]
netifd: bump to version 2020-10-22

Changelog follows

  ced0d535 build: find and use libnl header dirs
  5722218e proto: rework parse_addr to return struct device_addr
  3d7bf604 device_addr: record address index as in the blob
  24ce1eab interface: proto_ip: order by address index first

This bump mainly affects order of interface addresses in ubus output.  At the
moment dnsmasq uses first address of an interface for setting dhcp-range option
in its config

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
4 years agorpcd: adapt defaults for changed ubus.sock path
Daniel Golle [Thu, 22 Oct 2020 14:02:58 +0000 (15:02 +0100)]
rpcd: adapt defaults for changed ubus.sock path

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agouhttpd: adapt defaults for changes ubus.sock path
Daniel Golle [Thu, 22 Oct 2020 14:02:42 +0000 (15:02 +0100)]
uhttpd: adapt defaults for changes ubus.sock path

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agobase-files: merge /etc/passwd et al at sysupgrade config restore
Daniel Golle [Thu, 22 Oct 2020 12:13:39 +0000 (13:13 +0100)]
base-files: merge /etc/passwd et al at sysupgrade config restore

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoRevert "target: select procd-{ujail,seccomp} if !SMALL_FLASH"
Petr Štetiar [Thu, 22 Oct 2020 09:49:07 +0000 (11:49 +0200)]
Revert "target: select procd-{ujail,seccomp} if !SMALL_FLASH"

This reverts commit 6a56a6eb30799fcec9eecc3ee860dc4d8a5d952a as several
users have reported unbootable systems.

Ref: https://lists.openwrt.org/pipermail/openwrt-devel/2020-October/031838.html
Suggested-by: Roman Kuzmitskii <damex.pp@icloud.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agotarget: select procd-{ujail,seccomp} if !SMALL_FLASH
Daniel Golle [Wed, 21 Oct 2020 14:04:17 +0000 (15:04 +0100)]
target: select procd-{ujail,seccomp} if !SMALL_FLASH

Add procd-ujail and procd-seccomp to DEFAULT_PACKAGES if not building
for space-constraint (FEATURES:=small_flash) targets.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoprocd: jail: clean up capability handling and non-root ubusd
Daniel Golle [Mon, 19 Oct 2020 20:39:17 +0000 (21:39 +0100)]
procd: jail: clean up capability handling and non-root ubusd

Unify capability handling to only use OCI spec parsers even for ujail
slim containers which previously supposedly used their own format.

 80c9516 cgroups: restrict allowed keys in 'unified' section
 5ade567 cgroups: memory controller fixes
 3121467 early: run ubusd non-root as user ubus, group ubus
 12a5b97 jail: adapt to new ubus socket path
 788d144 instance: actually wire up capabilities filename
 ebc5a7f jail: nuke old capabilities code in favour of reusing OCI code
 6c5233a jail: capabilities: apply in two phases

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoubus: prepare to run ubusd as non-root user
Daniel Golle [Mon, 19 Oct 2020 20:38:17 +0000 (21:38 +0100)]
ubus: prepare to run ubusd as non-root user

Move /var/run/ubus.sock to /var/run/ubus/ubus.sock in preparation for
having ubusd run as non-root user.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agotarget: include selinux-variants if CONFIG_SELINUX is set
Daniel Golle [Mon, 19 Oct 2020 15:55:39 +0000 (16:55 +0100)]
target: include selinux-variants if CONFIG_SELINUX is set

Rather than unconditionally adding busybox and procd to the set of
default packages, add busybox-selinux and procd-selinux in case
CONFIG_SELINUX is set.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agomac80211: rt2x00: save survey for every channel visited
Markov Mikhail [Mon, 12 Oct 2020 09:46:43 +0000 (14:46 +0500)]
mac80211: rt2x00: save survey for every channel visited

rt2800 olny gives you survey for current channel.

Survey-based ACS algorithms are failing to perform their job when working
with rt2800.

Make rt2800 save survey for every channel visited and be able to give away
that information.

There is a bug registred https://dev.archive.openwrt.org/ticket/19081 and
this patch solves the issue.

Signed-off-by: Markov Mikhail <markov.mikhail@itmh.ru>
4 years agoglibc: update to latest 2.31 commit
Hans Dedecker [Tue, 20 Oct 2020 19:43:51 +0000 (21:43 +0200)]
glibc: update to latest 2.31 commit

4bc9918c99 AArch64: Use __memcpy_simd on Neoverse N2/V1
4722d1fb9d [AArch64] Improve integer memcpy
bea507a3f5 AArch64: Rename IS_ARES to IS_NEOVERSE_N1
d0a5b76902 AArch64: Improve backwards memmove performance
24a30c5959 AArch64: Add optimized Q-register memcpy
88db98fa6e AArch64: Align ENTRY to a cacheline

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
4 years agokernel: bump 5.4 to 5.4.72
John Audia [Sat, 17 Oct 2020 11:53:44 +0000 (07:53 -0400)]
kernel: bump 5.4 to 5.4.72

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711
Run-tested: ipq806x/R7800

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
4 years agoramips: add support for TP-Link RE200 v4
Richard Fröhning [Mon, 17 Aug 2020 11:14:39 +0000 (13:14 +0200)]
ramips: add support for TP-Link RE200 v4

TP-Link RE200 v4 is a wireless range extender with Ethernet and 2.4G and 5G
WiFi with internal antennas.
It's based on MediaTek MT7628AN+MT7610EN like the v2/v3.

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

- MediaTek MT7628AN (580 Mhz)
- 64 MB of RAM
- 8 MB of FLASH
- 2T2R 2.4 GHz and 1T1R 5 GHz
- 1x 10/100 Mbps Ethernet
- 8x LED (GPIO-controlled), 2x button
- UART connection holes on PCB (57600 8n1)

There are 2.4G and 5G LEDs in red and green which are controlled
separately.

MAC addresses
-------------

The MAC address assignment matches stock firmware, i.e.:

LAN : *:8E
2.4G: *:8D
5G  : *:8C

MAC address assignment has been done according to the RE200 v2.

The label MAC address matches the OpenWrt ethernet address.

Installation
------------

Web Interface
-------------

It is possible to upgrade to OpenWrt via the web interface. Simply flash
the -factory.bin from OEM. In contrast to a stock firmware, this will not
overwrite U-Boot.

Recovery
--------

Unfortunately, this devices does not offer a recovery mode or a tftp
installation method. If the web interface upgrade fails, you have to open
your device and attach serial console.

Instructions for serial console and recovery may be checked out in
commit 6d6f36ae787c ("ramips: add support for TP-Link RE200 v2") or on
the device's Wiki page.

Signed-off-by: Richard Fröhning <misanthropos@gmx.de>
[removed empty line, fix commit message formatting]
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agolantiq: remove support for kernel 4.19
Adrian Schmutzler [Mon, 19 Oct 2020 13:57:40 +0000 (15:57 +0200)]
lantiq: remove support for kernel 4.19

The target uses 5.4 as default kernel since 06/2020.

Kernel 4.19 support is not really maintained anymore, it does not
seem to be needed and upcoming changes (mainly DSA) will break
backward-compatibility anyway.

Thus, make maintaining of old stuff and reviewing of new stuff
easier by removing support for kernel 4.19.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoipq806x: fix pci broken on bootm command
Ansuel Smith [Tue, 1 Sep 2020 12:59:37 +0000 (14:59 +0200)]
ipq806x: fix pci broken on bootm command

Pci is broken when bootm is used instead of the custom bootipq. This
is caused by the lack of reset by the bootloader. Make the driver do
the reset to fix this specific problem.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
4 years agoipq806x: remove support for kernel 4.19
Adrian Schmutzler [Mon, 19 Oct 2020 13:37:54 +0000 (15:37 +0200)]
ipq806x: remove support for kernel 4.19

The target uses 5.4 as default kernel since 04/2020.

Kernel 4.19 support is not really maintained anymore, and there has
been a lot of changes between 4.19 and 5.4 on this target. Despite,
new devices are typically added for 5.4 only anyway.

Thus, make maintaining of old stuff and reviewing of new stuff
easier by removing support for kernel 4.19.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoipq40xx: remove support for kernel 4.19
Adrian Schmutzler [Mon, 19 Oct 2020 13:30:44 +0000 (15:30 +0200)]
ipq40xx: remove support for kernel 4.19

The target uses 5.4 as default kernel since 03/2020.

Kernel 4.19 support is not really maintained anymore, it does not
seem to be needed, and removing it will make upcoming driver
updates easier. Thus, remove it.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agortl838x: various fixes
John Crispin [Mon, 19 Oct 2020 12:47:45 +0000 (14:47 +0200)]
rtl838x: various fixes

* add d-link_dgs-1210-10p support
* make sure mips16 is disabled
* add a generic sub target
* add proper cflags

Signed-off-by: John Crispin <john@phrozen.org>
4 years agosunxi: Adapt U-Boot config to board rename
Hauke Mehrtens [Sun, 18 Oct 2020 12:26:55 +0000 (14:26 +0200)]
sunxi: Adapt U-Boot config to board rename

The board was renamed without changing the BUILD_DEVICES in the U-Boot
Makefile, this broken the build.

Fixes: 0830ae3a2fdf ("sunxi: Correct manufacturer name to Sinovoip")
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
4 years agosunxi: add support for FriendlyARM NanoPi R1
Jayantajit Gogoi [Mon, 12 Oct 2020 18:51:34 +0000 (18:51 +0000)]
sunxi: add support for FriendlyARM NanoPi R1

Specification:

- CPU: Allwinner H3, Quad-core Cortex-A7 Up to 1.2GHz
- DDR3 RAM: 512MB/1GB
- Network:
    10/100/1000M Ethernet x 1,
    10/100M Ethernet x 1
- WiFi: 802.11b/g/n, with SMA antenna interface
- USB Host: Type-A x2
- MicroSD Slot x 1
- MicroUSB: for OTG and power input
- Debug Serial Port: 3Pin 2.54mm pitch pin-header
- LED:
    nanopi:red:status
    nanopi:green:wan
    nanopi:green:lan
- KEY:
    reset
- Power Supply: DC 5V/2A

Installation:

- Write the image to SD Card with dd
- Boot NanoPi from the SD Card

Signed-off-by: Jayantajit Gogoi <jayanta.gogoi525@gmail.com>
4 years agoath79: add support for Qxwlan E1700AC v2
张鹏 [Fri, 16 Oct 2020 10:53:51 +0000 (12:53 +0200)]
ath79: add support for Qxwlan E1700AC v2

E1700AC v2 based on Qualcomm/Atheros QCA9563 + QCA9880.

Specification:

 - 750/400/250 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 3T3R 2.4 GHz
 - 3T3R 5 GHz
 - 2 x 10/1000M Mbps Ethernet (RJ45)
 - 1 x MiniPCI-e
 - 1 x SIM (3G/4G)
 - 1 x USB 2.0 Port
 - 5 x LED , 2 x Button(S8-Reset Buttun), 1 x power input
 - UART (J5) header on PCB (115200 8N1)

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace fixes]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for Qxwlan E558 v2
张鹏 [Fri, 16 Oct 2020 10:42:15 +0000 (12:42 +0200)]
ath79: add support for Qxwlan E558 v2

Qxwlan E558 v2 is based on Qualcomm QCA9558 + AR8327.

Specification:

 - 720/600/200 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4 GHz (QCA9558)
 - 3x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 4x miniPCIe slot (USB 2.0 bus only)
 - 1x microSIM slot
 - 5x LED (4 driven by GPIO)
 - 1x button (reset)
 - 1x 3-pos switch
 - 1x DC jack for main power input (9-48 V)
 - UART (JP5) and LEDs (J8) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig, whitespace adjustments]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agoath79: add support for Qxwlan E750G v8
张鹏 [Wed, 14 Oct 2020 07:47:35 +0000 (15:47 +0800)]
ath79: add support for Qxwlan E750G v8

Qxwlan E750G v8 is based on Qualcomm QCA9344 + QCA9334.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 2.4G GHz (AR9344)
 - 2x 10/100/1000 Mbps Ethernet (one port with PoE support)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: 张鹏 <sd20@qxwlan.com>
[cut out of bigger patch, keep swconfig]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobase-files: remove block2mtd checks from sysupgrade
Felix Fietkau [Sat, 17 Oct 2020 09:15:32 +0000 (11:15 +0200)]
base-files: remove block2mtd checks from sysupgrade

This hasn't been used in a long time

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agokernel: remove obsolete non-upstream block2mtd patches
Felix Fietkau [Sat, 17 Oct 2020 09:14:11 +0000 (11:14 +0200)]
kernel: remove obsolete non-upstream block2mtd patches

Since block2mtd is not used for firmware images anymore, these patches
are no longer needed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agomac80211: fix memory leak on filtered powersave frames
Felix Fietkau [Fri, 16 Oct 2020 19:42:11 +0000 (21:42 +0200)]
mac80211: fix memory leak on filtered powersave frames

After the status rework, ieee80211_tx_status_ext is leaking un-acknowledged
packets for stations in powersave mode.
To fix this, move the code handling those packets from __ieee80211_tx_status
into ieee80211_tx_status_ext

Reported-by: Tobias Waldvogel <tobias.waldvogel@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoRevert "build: process variable exports from toplevel.mk only once"
Adrian Schmutzler [Fri, 16 Oct 2020 20:58:44 +0000 (22:58 +0200)]
Revert "build: process variable exports from toplevel.mk only once"

This reverts commit ef7c34c1d1beac6bca4a683a3a161dd12a81f7e8.

The commit seems to break all buildbots with messages like:

/builder/shared-workdir/build/include/toplevel.mk:15:
  /builder/shared-workdir/build/include/toplevel-vars.mk: No such file or directory

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agobuild: prevent excessive re-evaluation of PKG_VERSION
Felix Fietkau [Tue, 6 Oct 2020 11:39:58 +0000 (13:39 +0200)]
build: prevent excessive re-evaluation of PKG_VERSION

version_abbrev uses $(shell) and the ?= is causing make to run the command
over and over again, causing a significant build slowdown

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agobuild: process variable exports from toplevel.mk only once
Felix Fietkau [Tue, 6 Oct 2020 10:37:51 +0000 (12:37 +0200)]
build: process variable exports from toplevel.mk only once

These run a lot of expensive shell calls, so redundant calls should be
avoided

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agomediatek: rewrite flow offload code
Felix Fietkau [Thu, 8 Oct 2020 11:44:33 +0000 (13:44 +0200)]
mediatek: rewrite flow offload code

The code is now much cleaner and works better than the old code.
Preparation for submitting it upstream (though with a different API)
Also add back MT7621 support and fix flow table coherence issues on
MT7622

Signed-off-by: Felix Fietkau <nbd@nbd.name>
4 years agoconfig: clean up SELinux options
Daniel Golle [Fri, 16 Oct 2020 13:27:34 +0000 (14:27 +0100)]
config: clean up SELinux options

In order to make it easier for users to build with SELinux, have a
single option in 'Global build settings' to enable all necessary
kernel features, userland packages and build-system hooks.
Also add better descriptions and help messages while at it.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoselinux-policy: update to git tag v0.3
Daniel Golle [Sun, 11 Oct 2020 02:27:28 +0000 (03:27 +0100)]
selinux-policy: update to git tag v0.3

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agofstools: update to git HEAD
Daniel Golle [Fri, 16 Oct 2020 00:51:13 +0000 (01:51 +0100)]
fstools: update to git HEAD

 8e0f29a mount: remove support for legacy overlayfs before v2.3
 0f8a443 mount: fix log format string and indentation
 46a56d3 overlay: use precompiler macros for reoccuring path names
 f25ab8a mount: apply SELinux labels before overlayfs mount

Total ipk size change (ipq40xx): +120b

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agopolicycoreutils: 'restorecon' is a 'setfiles' applet
Daniel Golle [Sun, 11 Oct 2020 02:18:28 +0000 (03:18 +0100)]
policycoreutils: 'restorecon' is a 'setfiles' applet

Instead of duplicating the '/sbin/setfiles' binary, have
'/sbin/restorecon' as yet another alias for
'/sbin/policycoreutils-setfiles'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agohostapd: ubus: add handler for wps_status and guard WPS calls
Daniel Golle [Sat, 10 Oct 2020 22:04:13 +0000 (23:04 +0100)]
hostapd: ubus: add handler for wps_status and guard WPS calls

Expose WPS ubus API only if compiled with WPS support and add new
handler for wps_status call.
Also add '-v wps' option to check whether WPS support is present in
hostapd.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
4 years agoath79: add support for Qxwlan E750A v4
Peng Zhang [Wed, 14 Oct 2020 07:47:35 +0000 (15:47 +0800)]
ath79: add support for Qxwlan E750A v4

Qxwlan E750A v4 is based on Qualcomm QCA9344.

Specification:

 - 560/450/225 MHz (CPU/DDR/AHB)
 - 128 MB of RAM (DDR2)
 - 8/16 MB of FLASH (SPI NOR)
 - 2T2R 5G GHz (AR9344)
 - 2x 10/100 Mbps Ethernet (one port with PoE support)
 - 1x miniPCIe slot (USB 2.0 bus only)
 - 7x LED (6 driven by GPIO)
 - 1x button (reset)
 - 1x DC jack for main power input (9-48 V)
 - UART (J23) and LEDs (J2) headers on PCB

Flash instruction:

   1.Using tftp mode with UART connection and original LEDE image
      - Configure PC with static IP 192.168.1.10 and tftp server.
      - Rename "openwrt-ar71xx-generic-xxx-squashfs-sysupgrade.bin"
        to "firmware.bin" and place it in tftp server directory.
      - Connect PC with one of LAN ports, power up the router and press
        key "Enter" to access U-Boot CLI.
      - Use the following commands to update the device to LEDE:
        run lfw
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

   2.Using httpd mode with Web UI connection and original LEDE image
      - Configure PC with static IP 192.168.1.xxx(2-255) and tftp server.
      - Connect PC with one of LAN ports,press the reset button, power up
        the router and keep button pressed for around 6-7 seconds, until
        leds flashing.
      - Open your browser and enter 192.168.1.1,You will see the upgrade
        interface, select "openwrt-ar71xx-generic-xxx-squashfs-
        sysupgrade.bin" and click the upgrade button.
      - After that the device will reboot and boot to LEDE.
      - Wait until all LEDs stops flashing and use the router.

Signed-off-by: Peng Zhang <sd20@qxwlan.com>
[cut out of bigger patch, alter use of DEVICE_VARIANT, merge case
in 01_leds, use lower case for v4]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agortl838x: remove model name from LED labels
Adrian Schmutzler [Thu, 15 Oct 2020 15:54:31 +0000 (17:54 +0200)]
rtl838x: remove model name from LED labels

Like in the previous patches for various targets, this removes
the "devicename" from LED labels in rtl838x, as it's useless and
only creates complexity.

Since the target is fresh and so far only system LEDs were added,
this does not add a migration script.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agortl838x: move dts-v1 to DTSI
Adrian Schmutzler [Thu, 15 Oct 2020 15:51:42 +0000 (17:51 +0200)]
rtl838x: move dts-v1 to DTSI

The syntax of the shared SoC DTSI file determines the DTS version,
so no need to repeat the "/dts-v1/;" identifier in every file.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agosunxi: use wpad-basic-wolfssl for Sinovoip Banana Pi M2 Ultra
Adrian Schmutzler [Thu, 15 Oct 2020 15:42:54 +0000 (17:42 +0200)]
sunxi: use wpad-basic-wolfssl for Sinovoip Banana Pi M2 Ultra

The idea of commit a14f5bb4bd26 was to use wpad-basic-wolfssl
consistently throughout the whole trunk, so use it here as well.

Fixes: 50fdddae05f1 ("BPi-M2U kernel modules for onboard WiFi")
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
4 years agokernel: bump 5.4 to 5.4.71
John Audia [Wed, 14 Oct 2020 11:54:05 +0000 (07:54 -0400)]
kernel: bump 5.4 to 5.4.71

All modifications made by update_kernel.sh

Build system: x86_64
Build-tested: ipq806x/R7800, ath79/generic, bcm27xx/bcm2711,
              lantiq/Easybox 904 xDSL
Run-tested:   ipq806x/R7800, lantiq/Easybox 904 xDSL

No dmesg regressions, everything functional

Signed-off-by: John Audia <graysky@archlinux.us>
[add lantiq test reports]
Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>