Some packages with variants did not specify the default among the alternatives, so were left without any apk 'provider_priority' for that package. This caused the apk solver to select the wrong variant, silently changing the requested package list.
Notable among these were busybox, procd and the hostapd/wpad suite. This behavior presented in the imagebuilders when creating the image as follows, silently replacing packages even when explicitly requested:
We add 'DEFAULT_VARIANT:=1' to the packages that were missing one, providing apk with sufficient information to choose the correct package.
See link below for further examples and discussion.
Link: https://github.com/openwrt/openwrt/pull/21288#issuecomment-3704101422 Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21358 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: f4fdb99)
package: ethtool: specify just one default variant
Inadvertently defining 'DEFAULT_VARIANT' on both ethool and ethtool-full variants resulted in
$ make defconfig tmp/.config-package.in:121615:error: recursive dependency detected! tmp/.config-package.in:121615: symbol PACKAGE_ethtool-full is selected by PACKAGE_ethtool tmp/.config-package.in:121605: symbol PACKAGE_ethtool depends on PACKAGE_ethtool-full
Fix this by simply undefining 'DEFAULT_VARIANT' on the ethtool-full variant, which is ugly, but expedient.
Fixes: https://github.com/openwrt/openwrt/commit/f4fdb996 Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21363 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7a78dc4)
Until now is_uimage() is only a crc check and the caller still needs to check other bits of the uimage header. Make this function what it is meant to be.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21332 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 8f66b33)
Until now search_image() is used for searching a uImage on flash (or the memory mapped equivalent). In a future commit this will be reused to search for a piggy-backed uimage. Make this function generic by
- replacing "flash" with "image" in variables - Search bytewise and do not rely on 4 byte alignment - remove 2 obsolete variables - move console output to caller
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21332 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 2e74ef5)
The loading function searches the image on flash (or its memory copy). Rename it to make clearer what the function does. Adapt comments accordingly.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21332 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 4491f1d)
Until now rt-loader expects a piggy-backed lzma compressed data stream. Be more flexible and allow a piggy-backed uimage as well.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21332 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: cd13ed6)
The rtl9300,smi-address property was first developed for the RTL930x targets. So it got a device specific prefix. Nowadays it is used for RTL931x targets too. Convert it to our gerneric realtek prefix.
find ./realtek -type f -exec sed -i 's/rtl9300,smi-address/realtek,smi-address/g' {} +
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21343 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 7bfa1fa)
Hardware -------- Marvell Armada 385 (MV88F6820) 1GB RAM 256MB NAND 1x 1Gbit 2x USB 3.0 2x SATA-III UART: 115200 8N1 3.3V RTC Weltrend MCU WT6703F connected via UART1 for Power LED / PWM Fan / hw reset / WoL
Use USB2.0 FAT32 pendrive with openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin 1. stop boot by pressing 1 2. usb start 3. fatload usb 0:1 0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin;bootm 0x02000000 - 4. do backup mtd1 mtd3 5. use sysupgrade
Or tftp 1. stop boot by pressing 1 2. setenv ethact egiga2;setenv serverip 192.168.11.114;setenv ipaddr 192.168.11.113 3. tftpboot 0x02000000 openwrt-mvebu-cortexa9-wd_cloud-ex2-ultra-initramfs-kernel.bin; bootm 0x02000000 - 4. do backup mtd1 mtd3 5. use sysupgrade
or Evgeny Kolesnikov <evgenyz@gmail.com> method from his failed PR 2040
- Using original firmware's network settings obtain SSH access to the device. - Put *-image-cfs-factory.bin and *-uImage-factory.bin images into device's /tmp directory. - Write kernel (uImage) image 'flash_eraseall /dev/mtd1 && nandwrite --markbad -p /dev/mtd1 /tmp/*-uImage-factory.bin'. - Write rootfs (image-cfs) image 'ubiformat /dev/mtd3 -f /tmp/*-image.cfs-factory.bin -y'. - Reboot the device.
Installation (upgrade):
Use *-sysupgrade.bin in a usual way. Weltrend MCU control is done via uart1 19200 install coreutils-stty stty -F /dev/ttyS1 raw speed 19200 stty -F /dev/ttyS1 raw speed 19200
Power LED Control Blue echo -n -e '\xfa\x26\x00\x11\x00\x01\xfb' > /dev/ttyS1 Red echo -n -e '\xfa\x26\x00\x14\x00\x01\xfb' > /dev/ttyS1 Orange echo -n -e '\xfa\x26\x00\x12\x00\x01\xfb' > /dev/ttyS1
more here: https://github.com/c-MM/mcm-daemon/blob/master/mcm.h
realtek: rtl838x: fix lan9 and lan10 on Netgear GS110TUP
The GS110TUP's lan9 port is connected via a QSGMII PHY to SERDES 2, and therefore should use the SWITCH_PORT_SDS macro instead of SWITCH_PORT. This was missed in e956adfe because the GS110TUP is not particularly well documented and the old code was confusing.
lan10 is an SFP and doesn't have an onboard PHY, so also remove its associated PHY references and update it to match other devices' SFP ports.
Fixes: https://github.com/openwrt/openwrt/issues/21324 Signed-off-by: Jacob Potter <jacob@j4cbo.com> Link: https://github.com/openwrt/openwrt/pull/21346 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: b2c0182)
The MAC can get PHY abilities, link status, etc. via different ways. In RTL931x, the corresponding register needs to be setup properly. By default, all ports use out-of-band MDIO polling to retrieve that information. Thus, PHY-backed ports usually work with the default setting.
For SFP ports, there is no MDIO polling available. Instead, the SerDes ability bus needs to be used to retrieve the link information.
So far, the bootloader (e.g. U-boot) had to properly initialize that setting. Instead of relying on that, do that properly during MAC setup.
Installation ------------ 1. Update stock firmware via the web interface (don't keep settings).
Update U-Boot (optional) ------------------------ After installing OpenWrt, you may want to install opensource U-Boot. 1. Install kmod-mtd-rw: apk update && apk add kmod-mtd-rw 2. Unlock bootloader: insmod mtd-rw i_want_a_brick=1 mtd unlock BL2 mtd unlock FIP 3. Download and write open-source BL2 and FIP: cd /tmp wget https://.../openwrt-mediatek-filogic-routerich_be7200-preloader.bin wget https://.../openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-preloader.bin BL2 mtd write /tmp/openwrt-mediatek-filogic-routerich_be7200-bl31-uboot.fip FIP 4. Reboot the router.
Return to stock --------------- 1. Update OpenWrt wirh the vendor's firmware (don't keep settings).
Recovery (original U-Boot) ----------------------------- 1. Press Reset button and power on the router. After ~10 sec release the button; 2. Upload and flash squashfs-sysupgrade.itb image via the web interface.
Recovery (open-source U-Boot) ----------------------------- 1. Place OpenWrt 'openwrt-mediatek-filogic-routerich_be7200-initramfs-recovery.itb' image on the tftp server (IP: 192.168.1.254) 2. Press Reset button and power on the router. After ~10 sec release the button. 3. Use OpenWrt initramfs system for recovery
Recovery (full disaster) ------------------------ Use UART and mtk_uartboot tool. Link: https://github.com/981213/mtk_uartboot
USB power control ----------------- Disable: echo disabled > /sys/devices/platform/usb-power/state Enable: echo enabled > /sys/devices/platform/usb-power/state
UART ---- UART pins are silkscreened on the PCB. Don't connect Vcc. Serial connection parameters: 115200, 8n1, 3.3V
MAC addresses ------------- +---------+-------------------+-----------+ | | MAC | Algorithm | +---------+-------------------+-----------+ | WAN | 24:0f:5e:xx:xx:30 | label | | LAN | 24:0f:5e:xx:xx:31 | label+1 | | WLAN 2g | 24:0f:5e:xx:xx:32 | label+2 | | WLAN 5g | 24:0f:5e:xx:xx:33 | label+3 | +---------+-------------------+-----------+ The WLAN 2g MAC was found in 'Factory', 0x4
The stock firmware is a customized variant of OpenWrt, which implements a signature check that only allows flashing official firmware. Cudy offers intermediate OpenWrt firmware images on their website [1][2] which do not implement the signature check. After flashing the intermediate image the upstream official OpenWrt image can be installed.
The stock firmware can be recovered via TFTP using the U-Boot based boot loader[3]. Set up a TFTP server on your computer with IP 192.168.1.88/24 serving the stock firmware from Cudy's website renamed to "recovery.bin". Press and hold the reset button while powering on the device, wait for the TFTP server to send the recovery.bin file, then release the reset button. The router will take a couple of minutes to reboot and set up the stock firmware.
This commit add option to enable kTLS support, improving performance by offloading TLS encryption and decryption to kernel space.
- Reduced CPU usage by minimizing data copying between user space and kernel space. - Enables the use of the sendfile() system call with encrypted sockets for zero-copy data transmission. - Leverages hardware-accelerated NIC that support TLS offloading.
Signed-off-by: Tan Zien <nabsdh9@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21306 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 34836df)
- adopted MTD partition size increase from 64M to 128M -> this allows boot to complete - moved MAC addressing stuff out of partition definitions - all MAC addressing stuff is in .dtsi
Power Mesh (RGB Led, user controllable, default set to OpenWrt Status) WLAN 2 GHz (user controllable) WAN (user controllable) LAN3 LAN2 LAN1 WLAN 5 GHz (Not on front panel but blinks through enclosure, user controllable)
Buttons:
Reset Mesh (user controllable, no default function)
Installation:
A. Through U-Boot menu:
- Prepare your connecting computer to use a static IP in network 192.168.1.0/24 - Power down the router and hold in the Reset button. - While holding in the button power up the router again. - Hold the button in for 10 seconds and then release. - Use your browser to go to 192.168.1.1 - If you see a GUI allowing for flashing firmware then you got the right model. - Upload the sysupgrade file.
Note: Recovery GUI can be used to recover from an incorrect firmware flash.
B. Through OpenWrt Dashboard:
If your router comes with OpenWrt preinstalled (modified by the seller), you can easily upgrade by going to the dashboard (192.168.1.1) and then navigate to System -> Backup/Flash firmware, then flash the firmware
mediatek: remove erroneous pipe action from BE7200 recipe
Remove the errorneous pipe action from the BE7200 device package list.
It causes visible errors into config:
perus@ub2510:/OpenWrt/aarch64$ make defconfig ... tmp/.config-target.in:55023:warning: ignoring unsupported character '|' tmp/.config-target.in:191877:warning: ignoring unsupported character '|' tmp/.config-target.in:191878:warning: ignoring unsupported character '|' tmp/.config-target.in:285812:warning: ignoring unsupported character '|' tmp/.config-target.in:285815:warning: ignoring unsupported character '|' tmp/.config-target.in:285819:warning: ignoring unsupported character '|' tmp/.config-target.in:285820:warning: ignoring unsupported character '|' # # configuration written to .config #
100Base-X mode was missing before in the enum rtpcs_sds_mode. So add it to be able to support this mode too. Handle this mode in the _determine_hw_mode mapper.
10G_QXGMII mode was missing in the mode mapper. Add it and map it to USXGMII_10GQXGMII mode.
realtek: pcs: keep track of number of links per SerDes
Add a field to the rtpcs_serdes structure to keep track of how many links (aka ports) are used on a single SerDes. This is needed to be known to map kernel interface modes to SerDes hardware modes properly (e.g. USXGMII --> USXGMII/10G-QXGMII/XSGMII).
While working in rtpcs_create, optimize referencing the SerDes instance for cleaner code.
realtek: pcs: cover number of links per SerDes for USXGMII
A SerDes may supply multiple ports and depending on that number, different hardware modes need to be used. While there are corresponding modes in the kernel in some cases (e.g. USXGMII with 4 2.5G ports aka 10G-QXGMII), this doesn't always map to Realtek hardware modes. Use the previously added link number accounting for that.
An obvious example of this is the SerDes on XGS12xx-12 switches which is connected to an octa-PHY. This runs Realtek proprietary XSGMII mode (10G-pumped SGMII interface) for which there is no corresponding mode in the kernel.
realtek: pcs: select OFF mode with no links on SerDes
Because the PCS driver keeps track of the number of registered links for each SerDes now, we now know when there is no link on a SerDes. In this case, determine to turn off the SerDes in the mode mapper.
Though the phylink subsystem shouldn't attempt to config something different when no link/port references a Serdes, be on the safe side.
realtek: pcs: rtl931x: soften early exit for USXGMII
Now that the PCS driver keeps track of how many links are registered per SerDes, we can also decide which real hardware mode to use when USXGMII is set. While there is still no proper setup for 10G-QXGMII or XSGMII, the existing USXGMII 10G-SXGMII setup seems to work properly.
Soften the condition when to exit early so that single 10G port USXGMII can be setup properly.
Add 'DEFAULT_VARIANT' to two packages, 'iw' and 'eapol-test', that were missed in the first pass. Refactor 'iw' and 'ethtool' package definitions to be consistent with the pattern used in most other packages.
Fixes: https://github.com/openwrt/openwrt/commit/f4fdb996 Fixes: https://github.com/openwrt/openwrt/commit/7a78dc4a Signed-off-by: Eric Fahlgren <ericfahlgren@gmail.com> Link: https://github.com/openwrt/openwrt/pull/21380 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: ded99c2)
These formally pending patches were merged into upstream Linux some time ago. Move them to the backports folder and add the kernel version they were added to the file name.
This patch was cherry picked from upstream Linux because it references a patch we backported in the fixes tag.
The function phy_id_compare_vendor() is needed by the fix. Refresh 782-05-v6.16-net-phy-Add-support-for-Aeonsemi-AS21xxx-PHYs.patch with the upstream code.
Fixes: 08a616b2163e ("generic: backport support for Aeonsemi AS21xxx PHY") Link: https://github.com/openwrt/openwrt/pull/21366 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: b3318fe)
wifi-scripts: wdev.uc: fix mesh mode frequency handling
Mesh mode interface creation fails when the freq parameter is empty or undefined. Unlike adhoc mode which checks if freq exists before using it, mesh mode blindly constructs the iw command with freq parameter, resulting in invalid syntax like:
iw dev mesh0 mesh join ssid freq NOHT
This causes the mesh interface to be created without joining the mesh network, leaving it in a DOWN state with no channel assigned.
Fix by adding freq validation check similar to adhoc mode.
Tested on two routers in parallel as mesh peers: - Xiaomi AX3000T (MediaTek MT7981) - OpenWrt One (MediaTek MT7981) - OpenWrt 6.6.119, 802.11s mesh on 5GHz (Channel 36, HE80)
nat46: fix reproducible-build failure and use latest git
Bump to 2025-11-04 snapshot.
Added 100-gcc15-fix.patch which drops __DATE__/__TIME__ usage and provides a stable fallback ("unknown"). This fixes build failures with GCC 15 and -Werror=date-time in kernel builds.
% git log --oneline 04923c5..adb2f72 adb2f72e6fb8 get rid of spurious ubsan complaint for nat46_instance_t pairs field d5f88686a4a8 Add a test harness which boots the kernel under kvm with a custom init which runs the tests b983bab221f0 nat46-core: Fix FIXMEs about ICMPv6 parameter pointers 1aca482d6917 Add support for ignoring traffic class or TOS translation at the same time
Signed-off-by: John Audia <therealgraysky@proton.me> Link: https://github.com/openwrt/openwrt/pull/21284 [Removed "Replace printk with pr_* macros" patch] Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> (commit: 6c9c641)
The name of the configuration structure suggests that it contains a list of registers. As it contains functions too change the name according to other realtek drivers.
- "Invent" a new driver prefix "rteth" - Rename the structure and variables to config/cfg
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21345 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: e6d282e)
There is no need to set the cpu port depending on the given family. Remove it from the private control structure and add the fixed value to the configuration structure.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21345 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: b8c6713)
The configuration data needs to reference the netdev_ops in the future. Reorder it in a separate commit to avoid confusion later.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21345 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 2d8212e)
Simplify netdev_ops initialization by moving the data into the configuration structure.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21345 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: f14fed9)
Convert all ops structures to the new rteth prefix.
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/21345 Signed-off-by: Robert Marko <robimarko@gmail.com> (commit: 17b90c5)