Commit Graph

20823 Commits

Author SHA1 Message Date
Tianling Shen
96aba78876 uboot-mediatek: enable rootwait for jdcloud re-cp-03
Sometimes the mmc deivce may come up later than kernel attempts to
mount rootfs, resulting kernel panic. Enable rootwait to fix it.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a0645675d4)
2024-09-19 10:34:28 +00:00
Daniel Golle
3c0c3d07fd uboot-mediatek: fix patch order
Make sure patch sequence number is unique by moving patch
440-add-jdcloud_re-cp-03.patch -> 441-add-jdcloud_re-cp-03.patch

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 2302a7c5ad)
(cherry picked from commit 9f739daf05)
2024-09-19 10:34:27 +00:00
Jo-Philipp Wich
104ad073c2 ucode: update to Git 1a8a0bcf725520820802ad433db22d8f64fbed6c (2024-07-11)
96f74b5be829 ubus: make ubus_context first in uc_ubus_connection_t
7e5830edfb38 nl80211: fix datatype of NL80211_BAND_IFTYPE_ATTR_HE_CAP_{MAC,PHY} attrs
5c8fd34bac42 nl80211: fix parsing of NL80211_BAND_ATTR_VHT_MCS_SET attribute
e8d4e4fe967d nl80211: fix decoding of NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET attribute
30a3f7ad0433 rtnl: store callback in listener registry only on success
9cbe8294909f rtnl: optimize reception of rtnl events
534417132e18 rtnl: increase event socket rx buffer size limit to 1 MiB
3f9811d2f7b7 compiler: close upvalues on loop control statements
ee4af9b55cb4 vm: rework object iteration
a275399dd8e2 uci: refactor uci.changes() to match documentation
1220992631d5 ubus: automatically clear error information
d6fd94014eea uci: automatically clear error information
99837f280b61 uloop: automatically clear error information
ba3855ae3775 lib: fix documentation typo for `pop()` function
be767ae197ba vm: rework `in` operator semantics
4ade84e8fb81 ubus: add explicit support for deferring incoming requests
cfe137be068a uci: remove incorrectly documentated reorder() parameter
e8d78a26da0c lib: introduce socket library
a0ad1d127ae6 build: fix symbol and library detection
674f65ee551d jsdoc: disable default module titles
a33d16a86493 socket: rework error handling
e2b81d869222 uloop: add documentation
953f36c96e8a socket: make socket.send() accept non-string data
f211d5ac666f ubus: fix uc_ubus_have_uloop for eloop+uloop combination
0662de64bd1f socket: add AF_PACKET socket type support
b594ff8a2841 socket: remove leftover debug code
0d823e702bfe socket: fix addrinfo() with omitted service argument
8cf816d615fd socket: fix potential memory leak in connect()
8f5f231d66cd socket: optimize poll() argument handling
36f106056069 socket: remove wrong documentation fragment
525fca224012 socket: uv_to_sockaddr(): fix length calculation for AF_UNIX addresses
3938645ad9e3 socket: support IPv6 addresses in struct conversion routines
3a586dc7ddbe socket: improve uc_socket_connect() behavior
7b269f1cd3d2 socket: improve uc_socket_listen() behavior
fc6f2b89febf socket: handle further socket option value types
d6f25797dad1 socket: add IPv6 socket options
7611487b9a05 socket: implement recvmsg(), sendmsg() and cmsg support
d2e44bfa8b54 core-lib: improved documentation
e0bab40c8578 fs: add truncate() file method
5d305cfb2ab7 fs: add lock() file method
8b0318f7fabe lib: introduce zlib library
73644a036f5a nl80211: move access to tb array out of uc_nl_convert_attr and below
6e3cf83a77a7 nl80211: add support for multi-attribute arrays
6ff24d5488a9 nl80211: update nl80211.h to latest wireless-next
abc2aef28641 nl80211: add wiphy multi-radio support

Fixes: https://github.com/jow-/ucode/issues/186
Fixes: https://github.com/jow-/ucode/issues/187
Fixes: https://github.com/jow-/ucode/issues/188
Fixes: https://github.com/jow-/ucode/issues/193
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit 553a7a3265)
2024-09-19 10:34:24 +00:00
Matthias FRANCK
54d2266b88 odhcp6c: fix wrong retransmission of DHCPv6 Solicit
When the DHCPv6 client sends a DHCPv6 Solicit with both IA_NA and IA_PD
options, and if the server replies with a status code = NoAddrsAvailable
in the IA_NA option, then currently the DHCPv6 client sends a new
Solicit with only the IA_PD option despite the fact that a prefix was
sent by the server in the previous Advertise.

This behavior is described in
https://datatracker.ietf.org/doc/html/rfc7550#section-4.2

The client must handle the case of a server that does not offer both
valid IA_NA and IA_PD options when both are requested, according to RFC
7550. It should not send a new Solicit, but a Request. The client should
however ignore the Advertise message if none of the IA_NA and IA_PD
options are offered by the server.

References: PCF-1390
Signed-off-by: Matthias FRANCK <matthias.franck@softathome.com>
2024-09-12 20:23:40 +00:00
Matthias FRANCK
8075f088d2 netifd: disable netifd
Netifd is not longer responsible for configuring the gateway. The TR181 components took over this task.

Signed-off-by: Matthias FRANCK <matthias.franck@softathome.com>
2024-09-12 19:59:32 +00:00
Yüce Kürüm
c0692ac199 profiles: prpl: logrotate configuration is moved to tr181-syslog
- Remove syslog-ng config option that creates a logrotate conf. This
option was causing a duplicate config error in syslog.
- Remove the script from base-files that adds logrotate cron job.
- Add logrotate package. It was selected by the removed config options
before.
- Adapt logrotate test to include separated logs

Signed-off-by: Yüce Kürüm <yuce.kurum@mind.be>
Signed-off-by: Yüce Kürüm <yuce.kurum_ext@softathome.com>
(cherry picked from commit c13ed76075)
2024-09-12 19:58:48 +00:00
Christian Marangi
d9414bdb0f kernel: modules: adapt for kernel 6.1
[ this is partial backport of upstream commit
  a511887644]

Adapt kernel modules to support kernel 6.1.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
(cherry-picked from commit a511887644)
(cherry picked from commit 5c0e64398d)
2024-09-12 19:58:30 +00:00
Matthias FRANCK
83ac2ba22d PROVISORY: packages: lua: Add symlink from /usr/lib/liblua.so.5.1.5 to /usr/lib/liblua5.1.so
The lua-amx package links with /usr/lib/liblua5.1.so

References: PCF-1412
Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-09-12 19:57:18 +00:00
Matthias FRANCK
91c3558c62 PROVISORY: packages: lua: Add symlink from /usr/include to /usr/include/lua5.1
lua-amx looks for lua5.1 header files under /usr/include/lua5.1
e29c9cd1bc/include_priv/lamx_lua5.1.h (L69-71)

References: PCF-1412
Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-09-12 19:52:40 +00:00
Petr Štetiar
e39930a519 prplOS: dnsmasq: refresh 300-ubus-expose-lease-data.patch after v2.90 bump
Refresh patch automatically so it applies cleanly after dnsmasq bump to
version v2.90.

Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-07-11 06:05:41 +00:00
Alexandre Fiset
525bc7d1c2 prplOS: dnsmasq: 300-ubus-expose-lease-data.patch: fix segfault when NAK is send
A segfault could arise when a NAK is send to a client that requested an
address in an old range. Here we check that the variable have valid
memory to be allocated.

References: PCF-557, !144
Signed-off-by: Alexandre Fiset <alexandre.fiset_ext@softathome.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 84c467fc9b)
2024-07-11 06:05:40 +00:00
Petr Štetiar
b1ed5d6036 prplOS: dnsmasq: refresh 300-ubus-expose-lease-data.patch after v2.87 bump
Refresh patch automatically so it applies cleanly after dnsmasq bump to
version v2.87.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 5fd6832a63)
2024-07-11 06:05:39 +00:00
Eduardo Aguilar
59e1c0d30c prplOS: dnsmasq: expose more lease data over ubus
For the complete functionality of ambiorix dhcpv4-manager plugin, we
would need this patch included in prplOS. This patch exposes the
requested options of the client, expands the information in the
broadcasted events in ubus, and introduces a method in dnsmasq ubus
object called leases().

* Add dnsmasq networkid to the events.
* Expose DHCPREQUEST options.
* 'leases' ubus method to retrieve the list of leases.

The purpose of the patch is to be able to synchronize with leases
from dnsmasq using ubus only. The ubus 'leases' method can be called
once and then subscribe to the events based on the dhcp packets
received.

The ubus events remain as they were, just add the parameter of the
networkid to identify the pool to which they belong in the config,
and the requested dhcp options from the client.

The patch is included temporarily, upstreaming process is being tracked
via JIRA ticket PCF-557.

References: !144
References: PCF-557
Signed-off-by: Eduardo Aguilar <eduardo.aguilar_ext@softathome.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [commit description]
(cherry picked from commit 953282dc48)
Signed-off-by: Petr Štetiar <ynezz@true.cz> [rebased onto dnsmasq v2.86]
(cherry picked from commit c0b3fa868d)
2024-07-11 06:05:38 +00:00
Petr Štetiar
1cf352c4d9 prplOS: procd: LCM: rebase patches
We've 3 downstream patches for procd which were cherry-picked from 22.03
release and this commit rebases them onto the procd from OpenWrt 23.05.

Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-07-11 06:05:37 +00:00
Matthias FRANCK
ca46537163 prplOS: procd: LCM: Add patch to fix systemd virtual cgroup controller label on boot
Mount systemd cgroup virtual controller at boot, so they can be used to
run systemd based containers.

Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
(cherry picked from commit 69ec728452918e6679b1de74a954c00df0d7c96e)
2024-07-11 06:05:36 +00:00
Matthias FRANCK
f8953e7bc2 prplOS: procd: LCM: Add patch to fix cpuset clone_children
Set clone_children flag in cpuset, so it inherits the configured defaults of the parent.

Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
(cherry picked from commit 58da6b91b3208438d561638618abb2703c230d0b)
2024-07-11 06:05:35 +00:00
Matthias FRANCK
77a908ae2b prplOS: procd: LCM: Add patch to fix cgroups mount
Properly mount cgroups in a root tmpfs where every controller is mounted
in a seperate subdirectory, recommended by the kernel documentation of
cgroupsv1.

Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
(cherry picked from commit af84ad24a6acd355ec39c8355eccb02e47b3bec6)
2024-07-11 06:05:35 +00:00
Petr Štetiar
143a9e8d51 umdns: rebase 0001-add-host-to-the-browse-entry-of-umdns.patch
Rebase patch due to new umdns version in OpenWrt 23.05

References: PCF-952, PCF-1011
Signed-off-by: Petr Štetiar <petr.stetiar@prplfoundation.org>
2024-07-11 06:05:33 +00:00
Petr Štetiar
00e5faf18a mac80211: fix default SSIDs back to prplOS and prplOS-guest
In commit f0a6969d3d ("prplOS: mac80211: backport 6.1.24 version") the
default prplOS/prplOS-guest SSIDs introduced in commit 23dd4f0dcc
("mac80211: rename default SSID to prplOS and add prplOS-guest SSID")
got broken, so lets fix it.

Fixes: f0a6969d3d ("prplOS: mac80211: backport 6.1.24 version")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 991147c863)
2024-07-11 06:05:26 +00:00
Petr Štetiar
d99696d2d4 build,base-files: propagate prplOS version into build artifacts
We've now prplOS version available, so lets make it available in build
artifacts as well.

References: PCF-691
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8cf5efccf9)
2024-07-11 06:05:25 +00:00
Petr Štetiar
00ae50eb53 base-files: banner: adjust for new versioning scheme
Content of /etc/banner before this change:

                   _  ___  ____
  _ __  _ __ _ __ | |/ _ \/ ___|
 | '_ \| '__| '_ \| | | | \___ \
 | |_) | |  | |_) | | |_| |___) |
 | .__/|_|  | .__/|_|\___/|____/
 |_|        |_| based on OpenWrt
 -------------------------------------------
 prplOS 3.0.0-01987c12, r20432+4-e7c486548c65
 -------------------------------------------

and after this change:

                   _  ___  ____
  _ __  _ __ _ __ | |/ _ \/ ___|
 | '_ \| '__| '_ \| | | | \___ \
 | |_) | |  | |_) | | |_| |___) |
 | .__/|_|  | .__/|_|\___/|____/
 |_|        |_| based on OpenWrt
 --------------------------------
      prplOS 3.0.0-01987c12
 --------------------------------

References: PCF-691
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit faef91016c)
2024-07-11 06:05:24 +00:00
Matthias FRANCK
5e5c191c46 package: odhcp6c: Add patch to prevent sending of router sollicitations
According to TR181, setting the RSEnable parameter to false should result in no router solicitation messages to be sent from the interface. This seems not the case, the messages are always seen regardless of the parameter value.
To solve this patch odhcp6c to not automatically sends Router Sollicitations as well.

This patch should be properly reworked to make it upstreamable. This progress is tracked in PCF-950

(cherry picked from commit 0f87c3f5a3)
2024-07-11 06:05:21 +00:00
Matthias FRANCK
e6e036b8ab PROVISORY: dropbear: backport bind to interface patch
Dropbear currently only supports binding on IP addresses and not on
interface bounding.  Problem with the IPv4 address binding is that
dropbear needs to restart each time you get a new IP address, breaking
current connections.

Upstream-Status: Merged [https://github.com/mkj/dropbear/pull/229]
Signed-off-by: Diederik De Coninck <diederik.deconinck_ext@softathome.com>
Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [patch refresh]
(cherry picked from commit cf92a90cc7)
2024-07-11 06:05:20 +00:00
Matthias FRANCK
5b47645e49 PROVISORY: odhcpd: Add patch to fix odhcpd can't find physical interface of 'lan'
To translate the logical interface name (e.g. lan) to the physical name (e.g. br-lan)
 - first odhcpd will look in /etc/config/dhcp for dhcp.lan.ifname or dhcp.lan.networkid
 - then, if compiled with WITH_UBUS, odhcpd will look at /etc/config/network and the interface name is overruled even if not found

This patch should be upstreamed. This is tracked in PCF-951.

Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
(cherry picked from commit be95bc06b6)
2024-07-11 06:05:19 +00:00
Matthias FRANCK
0646c7332e PROVISORY: umdns: Add patch to allow host in services call
For now services and hosts are not linked, umdns need to be modified to allow that link witch is required by tr181

This patch should be upstreamed, this progress is tracked in PCF-952.

Signed-off-by: Matthias FRANCK <matthias.franck_ext@softathome.com>
(cherry picked from commit 637e7e319d)
2024-07-11 06:05:18 +00:00
Petr Štetiar
d36b196b23 base-files: sysctl.d: fix ipv6_app_114 and ipv6_app_124 CDRouter tests
Currently two IPv6 related tests ipv6_app_114 (FTP) and ipv6_app_124
(TFTP) fails due to disabled automatic conntrack helper, so fix it by
enabling it explicitly.

Fixes: PCF-840
References: PCF-671
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 4b76442e50)
(cherry picked from commit 1d6070b9ac)
2024-07-11 06:05:17 +00:00
Petr Štetiar
2854198e82 base-files: board.d: fix broken network config on targets using defaults
I've just discovered broken networking on x86/64 QEMU target due to
changes introduced in commit 484946872e ("base-files: board.d: add
guest bridge to default network config"), where guest bridge touches
network configuration and thanks to that x86/64 QEMU is not getting
default network configuration applied, which creates incomplete network
configuration. So fix it by moving guest bridge configuration past
default network configuration.

Fixes: 484946872e ("base-files: board.d: add guest bridge to default network config")
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit f8d96184e8)
(cherry picked from commit 8e6657045d)
2024-07-11 06:05:16 +00:00
Petr Štetiar
5ac55e0733 base-files: uci-defaults: enable log rotation every 10 minutes
Backport cron job setup from commit fb0a7d7bcc ("profiles: prpl: fix
various issues in syslog-ng and tr069-manager").

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 2a93b42897)
2024-07-11 06:05:15 +00:00
Petr Štetiar
fde74fd722 base-files: set kernel serial console log level to warning
With the recent addition of several kernel module dependencies needed by
tr181-qos manager we've started experiencing issues with command prompt
detection in labgrid's shelldriver component.

It's likely related to longer kernel module loading times, which is then
having impact on delayed and longer kernel messages output on serial
console, thus interleaving labgrid command markers with kernel messages
and causing command prompt detection unreliable.

Current serial console loglevel is set to debug log level (KERN_DEBUG=7)
which makes kernel output very verbose and in some corner cases it's
causing interleaving of messages on serial console which makes currently
controlling of the DUT via labgrid framework very unreliable.

Fixing this properly via PCF-617 upstream in the labgrid framework is
going to take some time, so as a temporary workaround we're going to
decrease default kernel log level to warning (KERN_WARNING=4) which
limits kernel log output to the serial console a lot. Those kernel log
messages are not lost, they're still available in syslog's messages log
file.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c57924854a)
(cherry picked from commit fdf99433f1)
2024-07-11 06:05:14 +00:00
Petr Štetiar
f615dc54fc base-files: set hostname to prplOS
It was decided to rename project name from prplWrt to prplOS, so change
default hostname to prplOS as well.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit c7f349bb00)
(cherry picked from commit d26279279e)
2024-07-11 06:05:13 +00:00
Olaf Wachendorf
e4a02c76be base-files: update banner from prplWrt to prplOS
Project was renamed in 8/2021 so let's update the welcome banner as well.

Closes PCF-639
Signed-off-by: Olaf Wachendorf <olaf.wachendorf@maxlinear.com>
(cherry picked from commit a03b397f68)
(cherry picked from commit 24a271688f)
2024-07-11 06:05:12 +00:00
Petr Štetiar
71688495fa base-files: board.d: add guest bridge to default network config
It was decided, that prplOS should ship with guest bridge in default
config.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 484946872e)
(cherry picked from commit 9c3661be64)
2024-07-11 06:05:11 +00:00
Petr Štetiar
e2863169f6 dnsmasq: fix failing CDRouter dns_120 test
This test verifies large DNS responses using EDNS0 option, where the
test prepares DNS entry with 200 IPv4 matching records that requires a
UDP response slightly less (3274) than EDNS maximum payload size of 4096
octets. This packet is ignored as current maximum payload size is set to
1232 octets, so fix this by increasing the value to maximum payload size.

References: PCF-548
References: https://tools.ietf.org/html/rfc6891
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b6d1adce51)
(cherry picked from commit b34446900f)
2024-07-11 06:05:10 +00:00
Petr Štetiar
6aac544940 base-files: sysctl.d: fix failing cdrouter_firewall_508 test
cdrouter_firewall_508: Verify outbound packets are not forwarded if the
                 source address is not a prefix of the interior network

This test ensures that the random martian address assigned to the LAN
client in step 2 is outside of lanIp/lanMask, does not match any static
routes configured with staticRouteLanNetwork and is not within any of
the following reserved IP ranges: 0.0.0.0/8,
127.0.0.0/8, 169.254.0.0/16, 192.88.99.0/24, 224.0.0.0/4,
240.0.0.0/4, 255.255.255.255/32.

Make the test pass by setting `rp_filter` to strict mode. Strict mode as
defined in RFC3704 Strict Reverse Path Each incoming packet is tested
against the FIB and if the interface is not the best reverse path the
packet check will fail.  By default failed packets are discarded.

Current recommended practice in RFC3704 is to enable strict mode to
prevent IP spoofing from DDos attacks. If using asymmetric routing or
other complicated routing, then loose mode is recommended.

References: PCF-548
References: https://tools.ietf.org/html/rfc3704
References: https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit b9ad7cbf75)
(cherry picked from commit 4a593e72e3)
2024-07-11 06:05:09 +00:00
Hauke Mehrtens
0cdbbd8868 wireless-regdb: Update to version 2024.07.04
Changes:
  2a768c4 wireless-regdb: Update regulatory rules for Mongolia (MN) on 6GHz
  04875d9 wireless-regdb: Update regulatory rules for Saudi Arabia (SA) on 6GHz
  b7bced8 wireless-regdb: Update regulatory rules for South Africa (ZA) on 6GHz
  7bc8615 wireless-regdb: Update regulatory info for Thailand (TH) on 6GHz
  f901fa9 wireless-regdb: Update regulatory info for Malaysia (MY) for 2022
  d72d288 wireless-regdb: Update regulatory info for Morocco (MA) on 6GHz
  414face wireless-regdb: Update regulatory info for Chile (CL) on 6GHz
  1156a08 wireless-regdb: Update regulatory info for Mexico (MX) on 6GHz
  cc6cf7c wireless-regdb: Update regulatory info for Iceland (IS) on 6GHz
  ce03cc0 wireless-regdb: Update regulatory info for Mauritius(MU) on 6GHz
  7e37778 wireless-regdb: Update regulatory info for Argentina (AR) on 6GHz
  56f3a43 wireless-regdb: Update regulatory info for United Arab Emirates (AE) on 6GHz
  3cb8b91 wireless-regdb: Update regulatory info for Colombia (CO) on 6GHz
  3682ce5 wireless-regdb: Update regulatory info for Costa Rica (CR) for 2021
  dd4ffe7 wireless-regdb: Update regulatory info for Dominican Republic (DO) on 6GHz
  f8ef7da wireless-regdb: Update regulatory info for Liechtenstein (LI) on 6GHz
  a9ecabe wireless-regdb: Update regulatory info for Jordan (JO) for 2022
  5a9fdad wireless-regdb: Update regulatory info for Kenya (KE) for 2022
  19326c3 wireless-regdb: Update regulatory info for Macao (MO) for 2024
  4838054 wireless-regdb: update regulatory database based on preceding changes

Link: https://github.com/openwrt/openwrt/pull/15921
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 0a24fd9155)
2024-07-11 00:23:36 +02:00
Felix Fietkau
2b1ed7b33d mac80211: fix mesh id corruption on 32 bit systems
increase size of ifmsh->mbss_changed

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 20bd3502d3)
Link: https://github.com/openwrt/openwrt/pull/15836
[Moved the patch to the end of the patch queue]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:36:36 +02:00
Florian Eckert
130aa67675 linux-firmware: add missing LICENSE_FILES info
Where it is clear which lincense the firmware package has, the missing
information are added.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(cherry picked from commit 535d487c41)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
437d1988b1 linux-firmware: add LICENSE_FILES and LICENSE file handling
The firmware blobs have all different licenses from the different
manufacturers of the binary blobs. This information is contained in the
upstream 'linux-firmware' repositroy.

This commit extends the package handling so that this information can be
added as an additional argument during packages generation.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 5c14de1d7e)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
6f72d62a53 kernel: update deprecated license information
Update the deprecated license information from GPL-2.0 to GPL-2.0-only
as written in the COPYING file of the linux source tree.

Also add the 'COPYING' file to the PKG_LICENSE_FILES variable.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 879826154f)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
f5d64e36fb mac80211: add missing license information
The lincense information for the packages mac80211 are missing.
This commit adds the missing information.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [backport]
(cherry picked from commit 3128157ec7)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
9b12d41476 ca-certificates: add missing license information
The package has no licence information. So let's fix it.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 0da116f25b)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Florian Eckert
42dada5713 wireless-regdb: add missing license information
Add the missing license information PKG_LICENSE and PKG_LICENSE_FILES.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
(cherry picked from commit 7a3deadf91)
Link: https://github.com/openwrt/openwrt/pull/15918
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-10 23:07:36 +02:00
Wenli Looi
29280638e8 ramips: add support for Netgear EAX12 series
Netgear EAX12, EAX11v2, EAX15v2 are wall-plug 802.11ax (Wi-Fi 6)
extenders that share the SoC, WiFi chip, and image format with the
WAX202.

Specifications:
* MT7621, 256 MiB RAM, 128 MiB NAND
* MT7915: 2.4/5 GHz 2x2 802.11ax (DBDC)
* Ethernet: 1 port 10/100/1000
* UART: 115200 baud (labeled on board)

All LEDs and buttons appear to work without state_default.

Installation:
* Flash the factory image through the stock web interface, or TFTP to
  the bootloader. NMRP can be used to TFTP without opening the case.

Revert to stock firmware:
* Flash the stock firmware to the bootloader using TFTP/NMRP.

References in GPL source:
https://www.downloads.netgear.com/files/GPL/EAX12_EAX11v2_EAX15v2_GPL_V1.0.3.34_src.tar.gz

* target/linux/ramips/dts/mt7621-rfb-ax-nand.dts
  DTS file for this device.

Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
(cherry picked from commit 32ea8a9a7e)
2024-07-09 09:33:37 +02:00
Alexey Bartenev
e573b6b557 ramips: add support for D-Link DIR-806A B1 router
General specification:
SoC Type: MediaTek MT7620A (580MHz)
ROM: 8 MB SPI-NOR (MX25L6406E)
RAM: 64 MB DDR (W9751G6KB-25)
Switch: MediaTek MT7530
Ethernet: 5 ports - 5×100MbE (WAN, LAN1-4)
Wireless: 2.4 GHz (MediaTek RT5390): b/g/n
Wireless: 5 GHz (MediaTek MT7610EN): ac/n
Buttons: 2 button (POWER, WPS/RESET)
Bootloader: U-Boot 1.1.3
Power: 12 VDC, 0.5 A

MACs:
| LAN	| [Factory + 0x04] - 2		|
| WLAN 2.4g	| [Factory + 0x04] - 1		|
| WLAN 5g	| [Factory + 0x8004] - 3	|
| WAN	| [Factory + 0x04] - 2		|

OEM easy installation:

1. Use a PC to browse to http://192.168.0.1.
2. Go to the System section and open the Firmware Update section.
3. Under the Local Update at the right, click on the CHOOSE FILE...
4. When a modal window appears, choose the firmware file and click on
 the Open.
5. Next click on the UPDATE FIRMWARE button and upload the firmware image.
Wait for the router to flash and reboot.

OEM installation using the TFTP method (need level converter):

1. Download the latest firmware image.
2. Set up a Tftp server on a PC (e.g. Tftpd32) and place the firmware
 image to the root directory of the server.
3. Power off the router and use a twisted pair cable to connect the PC
 to any of the router's LAN ports.
4. Configure the network adapter of the PC to use IP address 192.168.0.180
 and subnet mask 255.255.255.0.
5. Connect serial port (57600 8N1) and turn on the router.
6. Then interrupt "U-Boot Boot Menu" by hitting 2 key (select "2: Load
 system code then write to Flash via TFTP.").
7. Press Y key when show "Warning!! Erase Linux in Flash then burn new
 one. Are you sure? (Y/N)"
Input device IP (192.168.0.1) ==:192.168.0.1
Input server IP (192.168.0.180) ==:192.168.0.180
Input Linux Kernel filename () ==:firmware_name
The router should download the firmware via TFTP and complete flashing in
 a few minutes.
After flashing is complete, use the PC to browse to http://192.168.1.1 or
 ssh to proceed with the configuration.

Signed-off-by: Alexey Bartenev <41exey@proton.me>
(cherry picked from commit ce998cb6e1)
2024-07-09 08:54:41 +02:00
Roland Reinl
6e51ff88b0 filogic: Add support for D-Link AQUILA PRO AI M30
Specification:
 - MT7981 CPU using 2.4GHz and 5GHz WiFi (both AX)
 - MT7531 switch
 - 512MB RAM
 - 128MB NAND flash with two UBI partitions with identical size
 - 1 multi color LED (red, green, blue, white) connected via GCA230718
 - 3 buttons (WPS, reset, LED on/off)
 - 1 1Gbit WAN port
 - 4 1Gbit LAN ports

Disassembly:
 - There are four screws at the bottom: 2 under the rubber feets, 2 under the label.
 - After removing the screws, the white plastic part can be shifted out of the blue part.
 - Be careful because the antennas are mounted on the side and the top of the white part.

Serial Interface
 - The serial interface can be connected to the 4 pin holes on the side of the board.
 - Pins (from front to rear):
   - 3.3V
   - RX
   - TX
   - GND
 - Settings: 115200, 8N1

MAC addresses:
 - WAN MAC is stored in partition "Odm" at offset 0x81
 - LAN (as printed on the device) is WAN MAC + 1
 - WLAN MAC (2.4 GHz) is WAN MAC + 2
 - WLAN MAC (5GHz) is WAN MAC + 3

Flashing via Recovery Web Interface:
 - The recovery web interface always flashes to the currently active partition.
 - If OpenWrt is flahsed to the second partition, it will not boot.
 - Ensure that you have an OEM image available (encrypted and decrypted version). Decryption is described in the end.
 - Set your IP address to 192.168.200.10, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Download openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-recovery.bin
 - The recovery web interface always reports successful flashing, even if it fails
 - After flashing, the recovery web interface will try to forward the browser to 192.168.0.1 (can be ignored)
 - If OpenWrt was flashed to the first partition, OpenWrt will boot (The status LED will start blinking white and stay white in the end). In this case you're done and can use OpenWrt.
 - If OpenWrt was flashed to the second partition, OpenWrt won't boot (The status LED will stay red forever). In this case, the following steps are reuqired:
   - Start the web recovery interface again and flash the **decrypted OEM image**. This will be flashed to the second partition as well. The OEM firmware web interface is afterwards accessible via http://192.168.200.1.
   - Now flash the **encrypted OEM image** via OEM firmware web interface. In this case, the new firmware is flashed to the first partition. After flashing and the following reboot, the OEM firmware web interface should still be accessible via http://192.168.200.1.
   - Start the web recovery interface again and flash the OpenWrt recovery image. Now it will be flashed to the first partition, OpenWrt will boot correctly afterwards and is accessible via 192.168.1.1.

Flashing via U-Boot:
 - Open the case, connect to the UART console
 - Set your IP address to 192.168.200.2, subnet mask 255.255.255.0. Connect to one of the LAN interfaces of the router
 - Run a tftp server which provides openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-initramfs-kernel.bin.
 - Power on the device and select "7. Load image" in the U-Boot menu
 - Enter image file, tftp server IP and device IP (if they differ from the default).
 - TFTP download to RAM will start. After a few seconds OpenWrt initramfs should start
 - The initramfs is accessible via 192.168.1.1, change your IP address accordingly (or use multiple IP addresses on your interface)
 - Perform a sysupgrade using openwrt-mediatek-filogic-dlink_aquila-pro-ai-m30-a1-squashfs-sysupgrade.bin
 - Reboot the device. OpenWrt should start from flash now

Revert back to stock using the Recovery Web Interface:
 - Set your IP address to 192.168.200.2, subnetmask 255.255.255.0
 - Press the reset button while powering on the device
 - Keep the reset button pressed until the LED blinks red
 - Open a Chromium based and goto http://192.168.200.1 (recovery web interface)
 - Flash a decrypted firmware image from D-Link. Decrypting an firmware image is described below.

Decrypting a D-Link firmware image:
 - Download https://github.com/RolandoMagico/firmware-utils/blob/M32/src/m32-firmware-util.c
 - Compile a binary from the downloaded file, e.g. gcc m32-firmware-util.c -lcrypto -o m32-firmware-util
 - Run ./m32-firmware-util M30 --DecryptFactoryImage <OriginalFirmware> <OutputFile>
 - Example for firmware M30A1_FW101B05: ./m32-firmware-util M30 --DecryptFactoryImage M30A1_FW101B05\(0725091522\).bin M30A1_FW101B05\(0725091522\)_decrypted.bin

Flashing via OEM web interface is not possible, as it will change the active partition and OpenWrt is only running on the first UBI partition.

Controlling the LEDs:
 - The LEDs are controlled by a chip called "GCA230718" which is connected to the main CPU via I2C (address 0x40)
 - I didn't find any documentation or driver for it, so the information below is purely based on my investigations
 - If there is already I driver for it, please tell me. Maybe I didn't search enough
 - I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
 - The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
 - The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
 - Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
 - Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
   - A reset command (0x81 0xE4) written to register 0x00
   - A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
 - The reset command is always the same
 - In the control command
   - byte 0 is always the same
   - byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
   - byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
   - byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
   - byte 7 defines the toggling frequency (if toggling enabled)
   - byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
   - byte 12 is constant 0x87

Comparison to M32/R32:
 - The algorithms for decrypting the OEM firmware are the same for M30/M32/R32, only the keys differ
 - The keys are available in the GPL sources for the M32
 - The M32/R32 contained raw data in the firmware images (kernel, rootfs), the R30 uses a sysupgrade tar instead
 - Creation of the recovery image is quite similar, only the header start string changes. So mostly takeover from M32/R32 for that.
 - Turned out that the bytes at offset 0x0E and 0x0F in the recovery image header are the checksum over the data area
 - This checksum was not checked in the recovery web interface of M32/R32 devices, but is now active in R30
 - I adapted the recovery image creation to also calculate the checksum over the data area
 - The recovery image header for M30 contains addresses which don't match the memory layout in the DTS. The same addresses are also present in the OEM images
 - The recovery web interface either calculates the correct addresses from it or has it's own logic to determine where which information must be written

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 29cca6cfee)
2024-07-08 23:06:38 +02:00
Roland Reinl
c439003497 filogic: Add LED driver for GCA230718
Add basic support for the LED driver for GCA230718.

 - I didn't find any documentation or driver for it, so the information below is purely based on my investigations
 - If there is already I driver for it, please tell me. Maybe I didn't search enough
 - I implemented a kernel module (leds-gca230718) to access the LEDs via DTS
 - The LED controller supports PWM for brightness control and ramp control for smooth blinking. This is not implemented in the driver
 - The LED controller supports toggling (on -> off -> on -> off) where the brightness of the LEDs can be set individually for each on cycle
 - Until now, only simple active/inactive control is implemented (like when the LEDs would have been connected via GPIO)
 - Controlling the LEDs requires three sequences sent to the chip. Each sequence consists of
   - A reset command (0x81 0xE4) written to register 0x00
   - A control command (for example 0x0C 0x02 0x01 0x00 0x00 0x00 0xFF 0x01 0x00 0x00 0x00 0xFF 0x87 written to register 0x03)
 - The reset command is always the same
 - In the control command
   - byte 0 is always the same
   - byte 1 (0x02 in the example above) must be changed in every sequence: 0x02 -> 0x01 -> 0x03)
   - byte 2 is set to 0x01 which disables toggling. 0x02 would be LED toggling without ramp control, 0x03 would be toggling with ramp control
   - byte 3 to 6 define the brightness values for the LEDs (R,G,B,W) for the first on cycle when toggling
   - byte 7 defines the toggling frequency (if toggling enabled)
   - byte 8 to 11 define the brightness values for the LEDs (R,G,B,W) for the second on cycle when toggling
   - byte 12 is constant 0x87

Signed-off-by: Roland Reinl <reinlroland+github@gmail.com>
(cherry picked from commit 0682974aa8)
2024-07-08 22:51:11 +02:00
Petr Štetiar
242f193f34 linux-firmware: package Intel AX201 firmware
Alexander reported following:

 iwlwifi 0000:00:14.3: Detected crf-id 0x3617, cnv-id 0x20000302 wfpm id 0x80000000
 iwlwifi 0000:00:14.3: PCI dev a0f0/0074, rev=0x351, rfid=0x10a100
 iwlwifi 0000:00:14.3: Direct firmware load for iwlwifi-QuZ-a0-hr-b0-77.ucode failed with error -2

It seems, that as of the current date, the highest firmware API version
supported by Linux 6.8-rc7 is still 77.

Closes: #14771
Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8db83d4cc0)
[Reduce to API version 72 for older mac80211]
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:27 +02:00
Felix Fietkau
7d135dc038 libxml2: add host build dependency on libiconv-full
Fixes build on macOS

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 4ef13c4a49)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Felix Fietkau
d0c7b19db8 hostapd: fix a crash corner case
On some setup failures, iface->bss can be NULL

Signed-off-by: Felix Fietkau <nbd@nbd.name>
(cherry picked from commit 1ee5b7e506)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00
Hauke Mehrtens
dee4309bdf mbedtls: Update to 2.28.8
This contains a fix for:
CVE-2024-28960: An issue was discovered in Mbed TLS 2.18.0 through 2.28.x
before 2.28.8 and 3.x before 3.6.0, and Mbed Crypto. The PSA Crypto
API mishandles shared memory.

(cherry picked from commit 360ac07eb9)
Link: https://github.com/openwrt/openwrt/pull/15898
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-07-08 21:13:26 +02:00