openwrt/staging/neocturne.git
4 months agotools: util-linux: use --disable-all-programs
Robert Marko [Tue, 25 Jun 2024 15:45:57 +0000 (17:45 +0200)]
tools: util-linux: use --disable-all-programs

util-linux supports passing --disable-all-programs configure flag to
disable building anything that isnt then manually enabled.

So, lets switch to using that instead of manually having to disable all
tools we dont need.

However, current drawback is that there is no upstream support for enabling
building hexdump so I included a patch that is pending upstream[0].

[0] https://github.com/util-linux/util-linux/pull/3101

Link: https://github.com/openwrt/openwrt/pull/15806
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoutils: mtd-utils: update to 2.2.0
Robert Marko [Tue, 25 Jun 2024 12:14:43 +0000 (14:14 +0200)]
utils: mtd-utils: update to 2.2.0

Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html

mtd-utils are currently depending on zlib, however it is not expressed
as a dependency and it is somehow being only pulled-in by lincurses-devel
so mtd-utils were able to compile.

Since 2.2.0 zlib is optional so lets disable support for it like for other
compressors since we dont package the mkfs.ubifs or mkfs.jffs2 that
are only users of compressors anyway.

Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
4 months agoutils: mtd-utils: drop autoreconf
Robert Marko [Tue, 25 Jun 2024 12:30:51 +0000 (14:30 +0200)]
utils: mtd-utils: drop autoreconf

Now that we are not patching mtd-utils with JFFS2 LZMA support there
is no need for autoreconf to be run.

Link: https://github.com/openwrt/openwrt/pull/15802
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoramips: yuncore_g720: fix buttons
Daniel Golle [Tue, 25 Jun 2024 19:40:59 +0000 (20:40 +0100)]
ramips: yuncore_g720: fix buttons

Turns out the device got two buttons, while the currently listed on is
actually WPS, and the other (will hidden) button is intended as RESET.
Update DT accordingly.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 months agotools: mtd-utils: fix disabling tests
Robert Marko [Sun, 23 Jun 2024 21:52:45 +0000 (23:52 +0200)]
tools: mtd-utils: fix disabling tests

Passing --disable-tests does not do anything since upstream commit [0]
("Fix test binary installation") as that commit removed it since there is
already and existing --without-tests compile option to not compile
the tests at all as --disable-tests was just disabling their installation.

So, lets just pass --without-tests instead to disable test compilation.

[0] https://git.infraroot.at/mtd-utils.git/commit/?id=7170a28d46d5db1e7a9da24a5555a194a233ef0b

Fixes: 67efb6a66146 ("tools: mtd-utils: Update to version 2.1.4")
Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools: mtd-utils: update to 2.2.0
Robert Marko [Sun, 23 Jun 2024 21:47:17 +0000 (23:47 +0200)]
tools: mtd-utils: update to 2.2.0

Release notes:
https://lists.infradead.org/pipermail/linux-mtd/2024-March/104058.html

Manually refresh the portability and JFFS2 LZMA patches.

Since mtd-utils have converted most of the JFFS2 compressors to be compile
time configurable and manual refreshing of JFFS2 LZMA was needed I also
converted it to a compile time option and enabled the new --with-lzma
option.

Link: https://github.com/openwrt/openwrt/pull/15791
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agobmips: sercomm,ad1018: remove unneeded LED default-state
Álvaro Fernández Rojas [Tue, 25 Jun 2024 15:26:29 +0000 (17:26 +0200)]
bmips: sercomm,ad1018: remove unneeded LED default-state

Remove unneeded default-state from led_power_green (led@8) to be in line with
other bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobmips: innacomm,w3400v6: remove unneeded LED default-state
Álvaro Fernández Rojas [Tue, 25 Jun 2024 15:24:53 +0000 (17:24 +0200)]
bmips: innacomm,w3400v6: remove unneeded LED default-state

Remove unneeded default-state from led_power_green (led@4) to be in line with
other bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agogeneric: 6.6: replace Aquantia pending LEDs patch with upstream version
Christian Marangi [Mon, 24 Jun 2024 21:22:41 +0000 (23:22 +0200)]
generic: 6.6: replace Aquantia pending LEDs patch with upstream version

Replace Aquantia pending LEDs patch with upstream version.
Sadly net maintainers didn't like integrated solution hence we still
need to handle LED restore on reset with custom solution.

Link: https://github.com/openwrt/openwrt/pull/15797
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoutils: mtd-utils: drop patches
Robert Marko [Sun, 23 Jun 2024 21:26:45 +0000 (23:26 +0200)]
utils: mtd-utils: drop patches

We have been carrying the 100-fix_includes.patch and 130-lzma_jffs2.patch
for a long time but the reason is lost to history.

We dont need to carry the JFFS2 LZMA support patch as mkfs.jffs2 is not
even being packaged so its not even being used.

As for the 100-fix_includes.patch that also seems like a relic of history
as mtd-utils compiles fine without it.

So, lets drop both patches.

Link: https://github.com/openwrt/openwrt/pull/15790
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoqualcommax: fix RAX120v2 PWM Fan controller wrong definition
Christian Marangi [Sat, 25 May 2024 10:54:31 +0000 (12:54 +0200)]
qualcommax: fix RAX120v2 PWM Fan controller wrong definition

Fix RAX120v2 PWM Fan controller wrong definition by using a non-existant
kmod and using the wrong compatible for it enabling an external clock
while actually the device use an internal one.

Link: https://github.com/openwrt/openwrt/pull/15796
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agogeneric: 6.6: backport patch for G671 PWM Fan controller support
Christian Marangi [Sat, 25 May 2024 10:52:44 +0000 (12:52 +0200)]
generic: 6.6: backport patch for G671 PWM Fan controller support

Backport patch for G761 PWM Fan controller support. This is used by
an ipq807x RAX120v2 and have an internal clock that was currently
unconfigured making the device not working.

Link: https://github.com/openwrt/openwrt/pull/15796
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoipq806x: fix broken line break with Linksys e8350-v1
Christian Marangi [Tue, 25 Jun 2024 10:20:14 +0000 (12:20 +0200)]
ipq806x: fix broken line break with Linksys e8350-v1

Fix broken line break for Linksys e8350-v1 pushed with CRLF instead of
LF.

Fixes: 45b3c620e597 ("ipq806x: add support for Linksys e8350-v1")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoipq806x: add support for Linksys e8350-v1
Sergey Filippov [Sat, 15 Jun 2024 19:36:43 +0000 (21:36 +0200)]
ipq806x: add support for Linksys e8350-v1

AC2400 Dual-Band Gigabit Wi-Fi Router base on ipq8064.
https://www.linksys.com/support-product?sku=E8350

Specification:
 - Qualcomm dual-core IPQ8064 @ 1.4 GHz
 - 512 MB of RAM
 - 4 MB of SPI NOR MX25U3235F
 - 128 MB of NAND S34MS01G2
 - Qualcomm QCA9880 2.4GHz 802.11bgn
 - Quantenna QSR1000 5GHz 802.11ac (no support)
 - 4 x 10/100/1000 Mbit/s w/ vlan support Ethernet
 - Qualcomm Atheros QCA8337 switch
 - 1 x 3.0 + 1 x 2.0 (combo with eSata port)
 - 115200, 8N1 internal serial console
 - Power, Reset, WPS and WLAN buttons
 - Power, WPS and WLAN leds
 - 12 VDC, 3 A power

Installation:
The installation must be done using web interface of the router.
To achive this new firmware-utils tool was added to set correct
magic headers for the factory images.

Installation from vendor firmware:
 1. Flash over the native Linksys WEB interface using factory image.

Installation using recovery mode:
 1. Power off the device and disconnect the WAN port.
    (Only LAN port to be connected)
 2. Press & hold the "Reset" button
 3. Power on the device & wait 10 seconds with pressed "Reset" button
 4. Set IP Internet Protocol on your PC from
    192.168.1.0/24 network (Router is on IP 192.168.1.1)
 5. Open the Firmware Recovery page in your browser:
    http://192.168.1.1/index.shtml
    Firmware Recovery -> File Name -> Recovery & Reboot

The device page in inbox:
https://openwrt.org/inbox/toh/linksys/linksys_ea8350_1

Signed-off-by: Sergey Filippov <sergey.filippov@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/15798
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agobmips: drop kernel 6.1 support
Álvaro Fernández Rojas [Tue, 25 Jun 2024 07:43:07 +0000 (09:43 +0200)]
bmips: drop kernel 6.1 support

kernel 6.1 can be dropped since 6.6 is the default kernel.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobmips: switch default kernel to 6.6
Álvaro Fernández Rojas [Tue, 25 Jun 2024 07:40:49 +0000 (09:40 +0200)]
bmips: switch default kernel to 6.6

Update default kernel version to 6.6 for the bmips devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobmips: add 6.6 kernel as testing
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: add 6.6 kernel as testing

enable testing kernel version 6.6 for bmips

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
5 months agobmips: refresh 6.6 kernel config files
Álvaro Fernández Rojas [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: refresh 6.6 kernel config files

Refresh config for kernel 6.6.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobmips: 6.6: refresh kernel patches
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: 6.6: refresh kernel patches

refresh 6.6. kernel patches via 'make target/linux/refresh'

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
[refresh patches]
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobmips: 6.6: copy patches, config from 6.1
Goetz Goerisch [Mon, 24 Jun 2024 20:11:13 +0000 (22:11 +0200)]
bmips: 6.6: copy patches, config from 6.1

copy the 6.1 config to 6.6

Signed-off-by: Goetz Goerisch <ggoerisch@gmail.com>
5 months agogeneric: 6.6: backport mips kexec dependency fix
Álvaro Fernández Rojas [Mon, 24 Jun 2024 17:37:37 +0000 (19:37 +0200)]
generic: 6.6: backport mips kexec dependency fix

Backport upstream fix for incorrect ifdeffery and dependency of CONFIG_KEXEC,
which causes compilation errors with the following symbols:
CONFIG_CRASH_CORE=y
CONFIG_KEXEC_CORE=y
CONFIG_CRASH_DUMP=y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agotools/llvm: update to 18.1.7
Konstantin Demin [Wed, 19 Jun 2024 16:43:51 +0000 (19:43 +0300)]
tools/llvm: update to 18.1.7

- release notes:
  - https://discourse.llvm.org/t/llvm-16-0-0-release/69326
  - https://discourse.llvm.org/t/llvm-17-0-1-released/73549
  - https://discourse.llvm.org/t/llvm-18-1-0-released/77448
  - https://discourse.llvm.org/t/llvm-18-1-1-released/77540
  - https://discourse.llvm.org/t/18-1-2-released/77821
  - https://discourse.llvm.org/t/18-1-3-released/78136
  - https://discourse.llvm.org/t/18-1-4-released/78430
  - https://discourse.llvm.org/t/18-1-5-released/78740
  - https://discourse.llvm.org/t/18-1-6-released/79068
  - https://discourse.llvm.org/t/18-1-7-released/79433
- remove PKG_RELEASE (irrelevant to tools)
- set default target/triplet to "bpf"
- rearrange configuration options
- better control feature support and improve build reproducibility:
  disable auxiliary features that are enabled implicitly - their
  support is detected at build-time

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15704
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: add support for RB5009UG+S+IN
Robert Marko [Wed, 9 Feb 2022 07:45:47 +0000 (09:45 +0200)]
mvebu: add support for RB5009UG+S+IN

This patch adds support for Mikrotik RB5009UG+S+IN.

Specifications:
  - SoC: Marvell Armada 7040 (88F7040) - 4 cores, ARMv8 Cortex-A72, 1.4GHz, 64bit
  - RAM: 1024MB DDR4
  - Flash: 16MB SPI NOR flash, 1024MB NAND
  - Ethernet:
   * Marvell 88E6393X - Amethyst:
   * one 2.5G RJ45 port via Qualcomm QCA8081 PHY
   * seven 1G RJ45 ports via built-in PHY-s
   * one 10G SFP+ cage
   * All ports share the same 10G switch uplink to the CPU
  - LED: User, SFP, Hdr1, Hdr2
  - Buttons: Reset
  - UART: 115200 8n1 on the MikroTik 16 pin header
  - USB: One USB3 port
  - Power: 24-57 V via
   * DC jack
   * 802.3af/at PoE on Ethernet 1
   * 2-pin terminal on the side

16 Pin header pinout:
1   GND Vcc  RX  ?  GND
   #--------------------#
   |.-. .-. .-. .-. .-. |
   |'-' '-' '-' '-' '-' |
   |.-. .-. .-. .-. .-. |
   |'-' '-' '-' '-' '-' |
   #--------------------#
2   CLK  DO /CS  TX  DI

Do note that the default RouterBoot has disabled UART even when the
required hard-config bit is set to indicate UART support.
Patched RouterBoot must be used if UART is desired.

Also, since ARM64 Linux support does not support in any way appending the
DTB to the kernel image we use mainline U-Boot with added RB5009 support
in order to boot OpenWrt.
MikroTik uses YAFFS to store the boot kernel and we use YAFUT to put U-Boot
as the kernel which RouterBoot then simply boots as an ELF.

Install instructions:

NOTE: In case you are using an existing out of tree version of OpenWrt make
sure to reinstall RouterOS via Netinstall to return the expected partition
layout.

1. Prepare FAT or EXT4 formatted USB drive with OpenWrt initramfs:
* Copy bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-initramfs-uImage.itb
to the root of FAT or EXT4 formatted USB drive.
* Plug in the drive to the RB5009 USB port

2. Boot the modified OpenWrt built U-Boot ELF:
u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf

Consult OpenWrt wiki for common instructions on switching to boot from
Ethernet once as well as serving the file:
https://openwrt.org/toh/mikrotik/common

Once U-Boot is booted it will attempt to boot in the following order:
1. NAND
2. USB
3. Network

NAND is expected to fail but USB or Networking need to serve the OpenWrt
initramfs image and after booting it will be accessible from LAN ports
on the default 192.168.1.1 IP with default credentials.

3. Flash modified RouterBoot that enables UART (Optional but recommended):
https://public.robimarko.eu/RB5009/70x0-7.15-uart.fwf

* Copy the file over to the booted OpenWrt initramfs to /tmp
* Run: mtd erase RouterBOOT-primary
* Run: mtd write /tmp/70x0-7.15-uart.fwf RouterBOOT-primary

4. Install U-Boot to boot OpenWrt:
* Copy the u-boot.elf from bin/targets/mvebu/cortexa72/u-boot-rb5009/u-boot.elf
to OpenWrt initramfs to /tmp.
* Run: . /lib/functions.sh
* Run: yafut -d /dev/mtd$(find_mtd_index "YAFFS") -w -i /tmp/u-boot.elf -o kernel -T
This will use yafut to copy the U-Boot as kernel in YAFFS so that RouterBoot boots it.

5. Wipe the NAND UBI partition:
* Run: ubiformat /dev/mtd$(find_mtd_index "ubi") -y
This will prepare the existing RouterOS rootfs partition for OpenWrt.

6. Flash OpenWrt:
* Copy the bin/targets/mvebu/cortexa72/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin
to OpenWrt initramfs to /tmp.
* Run: sysupgrade /tmp/openwrt-mvebu-cortexa72-mikrotik_rb5009-squashfs-sysupgrade.bin

Device will reboot, boot U-Boot and then OpenWrt.

Recovery:

In case you need to reinstall OpenWrt if it crashes after U-Boot, there is
a recovery mechanism in OpenWrt to boot the OpenWrt initramfs.
You need to hold the reset button while U-Boot is booting and then it will
boot the OpenWrt initramfs from:
1. USB
2. Networking

In recovery mode U-Boot will light all of the LED-s except for the switch
ones.

In case you want to return to RouterOS, you can simply do that via
Netinstall like on any other MikroTik board.

Credits also go to Serhii Serhieiev <adron@mstnt.com> who origininally
figured out the RouterBoot modification for UART, the missing 10G MVPP2
support in U-Boot as well as the custom aux loader to boot directly via
RouterBoot.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agouboot-mvebu: add support for MikroTik RB5009
Robert Marko [Sat, 8 Jun 2024 08:25:29 +0000 (10:25 +0200)]
uboot-mvebu: add support for MikroTik RB5009

MikroTik RB5009 uses RouterBoot as its bootloader like all MikroTik devices
running RouterOS, meaning that its not FIT compatible and can only boot
ELF images.

Now this is not so much of an issue on ARM or MIPS since kernel supports
appending DTB-s to it (Or we patch the kernel to embed it), but on ARM64
there is intentionally no such support.

RouterBoot will pass a DTB, but its the broken MikroTik one which is a
modified reference DTB and incorrect in more places than its valid so we
cannot use it to boot our kernel.

Thus, the solution is to use an intermediary loader and luckily for us
Armada 7040 is well supported in U-Boot which makes it a great option since
it supports anything that we will ever need to boot.

Upstream U-Boot currently requires the Armada boards to be converted to
OF_UPSTREAM before adding anything new and this requires updating all of
the drivers to accomodate the Linux DTS, while I plan to do this eventually
we will need to keep this board downstream for now.

Most stuff is supported in U-Boot, including networking since the switch
is preconfigured by RouterBoot.

A custom environment is used to try and boot from the following devices:
1. NAND (UBI)
2. USB
3. Networking

If NAND boot fails then U-Boot will attempt to boot OpenWrt initramfs from
USB or via networking.

There is a manual recovery mechanism implemented where if the reset button
is held when U-Boot is booting it will try to boot OpenWrt initramfs from:
1. USB
2. Networking

When U-Boot is in recovery mode it will light all of the LED-s except the
switch ones.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: cortex-a72: enable MikroTik NVMEM layout driver
Robert Marko [Sun, 9 Jun 2024 10:18:54 +0000 (12:18 +0200)]
mvebu: cortex-a72: enable MikroTik NVMEM layout driver

RB5009 will take advantage of the driver to get MAC adress.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: cortex-a72: enable U-Boot NVMEM driver
Robert Marko [Fri, 7 Jun 2024 17:43:14 +0000 (19:43 +0200)]
mvebu: cortex-a72: enable U-Boot NVMEM driver

In order to not have to ship envtools configuration per board, we can
instead rely on the kernel U-Boot environment NVMEM driver through which
envtools can read/write the environement.

Since size difference is negligeble and this subtarget has rather large
storage regardless, enable it by default.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: cortex-a72: enable MikroTik platform drivers and NOR variable erase
Robert Marko [Sun, 17 Sep 2023 20:17:56 +0000 (22:17 +0200)]
mvebu: cortex-a72: enable MikroTik platform drivers and NOR variable erase

MikroTik RB5009 will be using advantage of the MikroTik platform drivers,
RouterBoot partition parser and SPI NOR variable erase support.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: cortex-a72: enable ARM SBSA Generic Watchdog
Robert Marko [Fri, 7 Jun 2024 13:05:30 +0000 (15:05 +0200)]
mvebu: cortex-a72: enable ARM SBSA Generic Watchdog

Marvell 70x0 and 80x0 both have ARM SBSA Generic Watchdog built-in,
so lets enable the required driver for them.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agomvebu: cortex-a72: enable QCA8081 PHY support
Robert Marko [Mon, 18 Sep 2023 08:51:19 +0000 (10:51 +0200)]
mvebu: cortex-a72: enable QCA8081 PHY support

MikroTik RB5009 uses Qualcomm QCA8081 PHY for the 2.5G RJ45 port,
so we need to enable the driver for it.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotreewide: refresh patches
Robert Marko [Sat, 22 Jun 2024 10:41:28 +0000 (12:41 +0200)]
treewide: refresh patches

These need to be refreshed, probably the generic backports affected them.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agogeneric: backport QCA808x possible interfaces fix
Robert Marko [Tue, 27 Feb 2024 18:07:42 +0000 (19:07 +0100)]
generic: backport QCA808x possible interfaces fix

QCA808x does not currently fill in the possible_interfaces.

This leads to Phylink not being aware that it supports 2500Base-X as well
so in cases where it is connected to a DSA switch like MV88E6393 it will
limit that port to phy-mode set in the DTS.

That means that if SGMII is used you are limited to 1G only while if
2500Base-X was set you are limited to 2.5G only.

Populating the possible_interfaces fixes this, so lets backport the patches
from kernel 6.9.

This also includes a backport of the Phylink PHY validation series from
kernel 6.8 that allows the use of possible_interfaces.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agogeneric: 6.6: backport Marvell Amethyst SMI GPIO setup
Robert Marko [Sun, 17 Sep 2023 20:43:48 +0000 (22:43 +0200)]
generic: 6.6: backport Marvell Amethyst SMI GPIO setup

Marvell Amethyst switches use a different SMI GPIO pin setup than other
switches, and since RB5009 uses Amethyst switch and its SMI bus to talk
to QCA8081 lets backport the required fix from kernel 6.9.

Link: https://github.com/openwrt/openwrt/pull/15765
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agobcm27xx: drop upstream patch that breaks rpi5 wifi
Álvaro Fernández Rojas [Mon, 24 Jun 2024 03:48:44 +0000 (05:48 +0200)]
bcm27xx: drop upstream patch that breaks rpi5 wifi

As reported in the following issue, this patch breaks wifi on the RPi 5.
https://github.com/raspberrypi/linux/issues/6237

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agogeneric: 6.6: backport upstream r8169 patches
Álvaro Fernández Rojas [Sun, 23 Jun 2024 17:19:47 +0000 (19:19 +0200)]
generic: 6.6: backport upstream r8169 patches

Backport a bunch of upstream r8169 patches:
- RTL8168/RTL8101 LEDs support.
- RTL8126A support.
- RTL8125/RTL8126 LEDs support.
- RTL8168M support.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agoqualcommax: get rid of custom socinfo.h header
Robert Marko [Sun, 23 Jun 2024 16:02:09 +0000 (18:02 +0200)]
qualcommax: get rid of custom socinfo.h header

Now that SSDK has been updated to use in-kernel SMEM ID-s to identify
the SoC its running on instead of relying on the downstream socinfo.h
header we can move the read_ipq_soc_version_major() function directly to
cpr3-util.c as its the only user of anything from the header and drop it.

Link: https://github.com/openwrt/openwrt/pull/15786
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agolinux-firmware: add RTL8126 firmware
Álvaro Fernández Rojas [Sun, 23 Jun 2024 16:40:34 +0000 (18:40 +0200)]
linux-firmware: add RTL8126 firmware

This commit adds RTL8126 firmwares to r8169-firmware package.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agoath79: remove SPI driver link order hack
Shiji Yang [Sat, 22 Jun 2024 14:58:56 +0000 (14:58 +0000)]
ath79: remove SPI driver link order hack

This hack is used to make sure that the mfd device starts before the
mtd driver[1]. Now the linux driver framework "struct spi_driver {}"
can always ensure this.

[1] 47f8fd1dde5d ("ar71xx: rewrite SPI drivers for the RB4xx boards")

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
5 months agoath79: remove GPIO driver earlier registration hack
Shiji Yang [Sat, 22 Jun 2024 14:58:16 +0000 (14:58 +0000)]
ath79: remove GPIO driver earlier registration hack

After porting the ar71xx target to the new ath79 target, we are now
using the device tree instead of the device mach file. And the
platform drivers already support deferred probe. So there is no need
to keep it.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
5 months agoqca-ssdk: fix compiling for ipq60xx
Robert Marko [Sun, 23 Jun 2024 15:24:57 +0000 (17:24 +0200)]
qca-ssdk: fix compiling for ipq60xx

Trying to compile for ipq60xx will fail with:
ERROR: modpost: "qca808x_phy_reset" [build_dir/target-aarch64_cortex-a53_musl/linux-qualcommax_ipq60xx/qca-ssdk-2024.06.13~c451136b/qca-ssdk.ko] undefined!

So, lets fix this by disabling Manhattan switch and PHY support as this is
the new 2.5G quad port switch that is not present on ipq60xx boards.

Fixes: 87a45ea43207 ("kernel: qca-ssdk: update 12.5 to 2024-06-13")
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agokernel: qca-ssdk: update 12.5 to 2024-06-13
Kristian Skramstad [Fri, 21 Jun 2024 22:00:15 +0000 (00:00 +0200)]
kernel: qca-ssdk: update 12.5 to 2024-06-13

There are some new commits, so refresh and update patches.
Some build warnings have been fixed upstream too.

Add backport target/linux/generic/backport-6.6/722-v6.10-dt-bindings-arm-qcom-ids-Add-SoC-ID-for-IPQ5321.patch.

Removed upstream:
[-] qca-ssdk/patches/101-hsl_phy-add-support-for-detection-PSGMII-PHY-mode.patch
[-] qca-ssdk/patches/201-fix-compile-warnings.patch

List of changes:
2024-04-16  -c451136b-  qca-ssdk: strip MRPPE code
2024-06-05  -f455a820-  [qca-ssdk]: fix enum-int-mismatch warnings
2024-05-31  -bbfc0fa9-  Merge "[qca-ssdk]: update eee status of phydev"
2024-05-31  -adbe9dc5-  Merge "[qca-ssdk]: support psgmii and uqsxgmii mode of kernel"
2024-05-31  -d06ca777-  Merge "[qca-ssdk]: fix 5G issue with the AQR FW that use 5gbaser for 5G speed"
2024-05-31  -c6f539a5-  Merge "qca-ssdk: support mrppe pktedit padding functions"
2024-04-29  -c321e2a9-  qca-ssdk: support mrppe pktedit padding functions
2024-05-24  -ee6e201e-  qca-ssdk: Fix the big endian compile error
2024-05-15  -8c116bb9-  [qca-ssdk]: update eee status of phydev
2024-05-20  -f0341a2c-  Merge "qca-ssdk: Enable igmp for PPE MINI profile"
2024-05-16  -44a0ce93-  qca-ssdk: Enable igmp for PPE MINI profile
2024-05-15  -8b91bbf6-  [qca-ssdk]: support psgmii and uqsxgmii mode of kernel
2024-05-14  -7eec1658-  [qca-ssdk]: fix 5G issue with the AQR FW that use 5gbaser for 5G speed
2024-05-12  -b9f5ea0e-  [qca-ssdk]: ethtool support, do not change wake-up timer when the requested timer is 0
2024-05-09  -5e2c15ed-  Merge "[qca-ssdk]: remove check when mht clock enable"
2024-05-09  -a1563b90-  Merge "[qca-ssdk] support new sku IPQ5321"
2024-04-23  -f04b7680-  [qca-ssdk]: show unknown status when link down
2024-03-22  -33b91b30-  [qca-ssdk]: remove check when mht clock enable
2024-04-29  -b6362f2b-  Merge "qca-ssdk:fix bug in marina nptv6 iid cal"
2024-04-29  -097033ae-  Merge "[qca-ssdk] support cypress uniphy0 connecting MHT switch port0"
2024-04-24  -d45560fd-  qca-ssdk:fix bug in marina nptv6 iid cal
2024-04-24  -7d7a42af-  qca-ssdk: enable policer counter on low memory profile
2024-04-18  -e36cf6ea-  Merge "[qca-ssdk]: change portvlan egress mode initial value as untouched"
2024-04-18  -27817881-  Merge "[qca-ssdk]: update the aqr phy supported ability"
2024-04-18  -5a3a693c-  Merge "qca-ssdk:support marina nptv6"
2024-04-16  -129fe9b3-  Merge "qca-ssdk: support tunnel fields and innner fields inverse"
2024-01-09  -fc8f6abd-  qca-ssdk:support marina nptv6

Signed-off-by: Kristian Skramstad <kristian+github@83.no>
Link: https://github.com/openwrt/openwrt/pull/15771
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agokernel: bump 6.1 to 6.1.95
Zxl hhyccc [Sat, 22 Jun 2024 05:50:31 +0000 (13:50 +0800)]
kernel: bump 6.1 to 6.1.95

https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.95

Removed upstreamed:
generic/pending-6.1/779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch
reference:
This patch can be removed. It will never return false. And the upstream commit should fix the same issue:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.1.95&id=a31d0e5deb1abe7c57c6457ae2502f278063126e

All other patches automatically rebased.

Build system: Kirkwood bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
5 months agoarmsr: add realtek and smsc ethernet phy drivers to the default image
Mathew McBride [Tue, 28 May 2024 23:09:17 +0000 (09:09 +1000)]
armsr: add realtek and smsc ethernet phy drivers to the default image

This adds two more common PHY brands to the image.
Realtek is used on the Google Coral "Phanbell" board (i.MX8MQ).
SMSC has been used on various Raspberry Pi boards.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
5 months agoarmsr: armv8: enable NXP i.MX8MQ/P USB phy
Mathew McBride [Tue, 28 May 2024 23:04:13 +0000 (09:04 +1000)]
armsr: armv8: enable NXP i.MX8MQ/P USB phy

Support for 'fsl,imx8mq-usb-phy' is needed for USB to work
on NXP i.MX8MQ and i.MX8MP platforms.

Tested with a Google Coral "Phanbell" board.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
5 months agoarmsr: enable framebuffer emulation for virtio-gpu/drm displays
Mathew McBride [Sun, 26 May 2024 04:12:58 +0000 (14:12 +1000)]
armsr: enable framebuffer emulation for virtio-gpu/drm displays

This was discovered when trying to run OpenWrt on Hetzner Cloud's
Arm-based instances.

Hetzner uses QEMU/KVM with virtio-gpu as the main display device,
together with an ACPI firmware. This was not displaying a console
previously.

This setup can be emulated by qemu using options below:
qemu-system-aarch64 \
    -machine virt \
    -bios QEMU_EFI.fd \
    -device virtio-gpu \
    -usb \
    -device qemu-xhci,id=xhci \
    -device usb-tablet,bus=xhci.0 \
    -device usb-kbd,bus=xhci.0 \
    -vnc :0

Signed-off-by: Mathew McBride <matt@traverse.com.au>
5 months agokernel/armsr: disable NXP i.MX9 PMU related option
Mathew McBride [Sun, 17 Mar 2024 23:51:21 +0000 (10:51 +1100)]
kernel/armsr: disable NXP i.MX9 PMU related option

This PMU (performance management unit) related kernel option
can appear under certain kernel configurations (such as
KVM being enabled).

Disable them, as we do with other PMU-related options.

Signed-off-by: Mathew McBride <matt@traverse.com.au>
5 months agokernel: crypto: remove FCRYPT from miscellany
Nathaniel Wesley Filardo [Thu, 20 Jun 2024 14:15:50 +0000 (15:15 +0100)]
kernel: crypto: remove FCRYPT from miscellany

It has its own dedicated knob

Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15761
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agokernel: catch up rxrpc
Nathaniel Wesley Filardo [Thu, 20 Jun 2024 14:15:41 +0000 (15:15 +0100)]
kernel: catch up rxrpc

New dependencies required for the module to be useful, and correct IPv6 support

Signed-off-by: Nathaniel Wesley Filardo <nwfilardo@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15761
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agouml: fix glibc-static check with GCC14
Robert Marko [Sat, 22 Jun 2024 19:57:23 +0000 (21:57 +0200)]
uml: fix glibc-static check with GCC14

Running the glibc-static check with GCC14 as the host compiler will fail:
Please install a static glibc package. (Missing libutil.a, librt.a or libpthread.a)

However, this error will get printed even with the required static
libraries installed when GCC14 is used.

Manually running the check exposes the real error:
<stdin>: In function ‘main’:
<stdin>:1:45: error: implicit declaration of function ‘timer_gettime’ [-Wimplicit-function-declaration]

GCC14 now errors on implicit declarations by default, so lets add the
required time.h header to fix compilation and thus the check.

Link: https://github.com/openwrt/openwrt/pull/15778
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/fakeroot: fix check for whether to wrap time64 functions
Michael Pratt [Sat, 22 Jun 2024 04:58:39 +0000 (00:58 -0400)]
tools/fakeroot: fix check for whether to wrap time64 functions

Fakeroot uses an egrep configure check to look for the string "time64"
within a preprocessed include of the sys/stat.h header
in order to decide whether or not to create declarations
and internal functions used for wrapping the native functions
stat64_time64 fstat64_time64 lstat64_time64 and fstatat64_time64.

On specific older versions of glibc these functions are not included,
but there are some references to "time64" unrelated to functions,
like aliasing the time64_t typedef to the standard time_t typedef
when the size of a word is 64 bits or defining it if not.

In this case, a grep for "stat64"
of the preprocessed sys/stat.h header matches nothing,
however, the grep for "time64" in the configure check
of the preprocessed sys/stat.h header matches a line
that has nothing to do with the functions
that will be wrapped as a result of successful matching.

  __extension__ typedef __int64_t __time64_t;

This causes the attempt to wrap the functions to occur,
which fails due to some of the corresponding macros being empty
since the native declarations they are based on do not exist,
causing a common error claiming that a part of the syntax is missing.

  error: expected '=', ',', ';', 'asm' or '__attribute__' before ...

Fix this by making the testing regular expression more complex
in order to match actual function names ending in "_time64"
with or without a set of preceding underscores, but none after.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15773
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agokernel: bump 6.6 to 6.6.35
John Audia [Fri, 21 Jun 2024 14:02:58 +0000 (10:02 -0400)]
kernel: bump 6.6 to 6.6.35

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.35

Removed upstreamed:
bcm27xx/patches-6.6/950-1135-ax25-Fix-refcount-imbalance-on-inbound-connections.patch[1]

Removed no longer needed:
generic/pending-6.6/779-net-vxlan-don-t-learn-non-unicast-L2-destinations.patch[2]

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/glinet_gl-mt6000, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.35&id=52100fd74ad07b53a4666feafff1cd11436362d3
2. As suggested by @DragonBluep, "This patch can be removed. It will never return false. And the upstream commit should fix the same issue: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?h=v6.6.35&id=924f7bbfc5cfd029e417c56357ca01eae681fba6"

Signed-off-by: John Audia <therealgraysky@proton.me>
5 months agoopenssl: conditionally disable engine section
Sean Khan [Sun, 9 Jun 2024 01:02:30 +0000 (21:02 -0400)]
openssl: conditionally disable engine section

Currently, the build option to enable/disable engine support isn't
reflected in the final '/etc/ssl/openssl.cnf' config. It assumes `engines`
is always enabled, producing an error whenever running any
commands in openssl util or programs that explicitly use settings
from '/etc/ssl/openssl.cnf'.

```
➤ openssl version
FATAL: Startup failure (dev note: apps_startup()) for openssl
307D1EA97F000000:error:12800067:lib(37):dlfcn_load:reason(103):crypto/dso/dso_dlfcn.c:118:filename(libengines.so):
Error loading shared library libengines.so: No such file or directory
307D1EA97F000000:error:12800067:lib(37):DSO_load:reason(103):crypto/dso/dso_lib.c:152:
307D1EA97F000000:error:0700006E:lib(14):module_load_dso:reason(110):crypto/conf/conf_mod.c:321:module=engines, path=engines
307D1EA97F000000:error:07000071:lib(14):module_run:reason(113):crypto/conf/conf_mod.c:266:module=engines
```

Build should check for the `CONFIG_OPENSSL_ENGINE` option, and comment out `engines`
if not explicitly enabled.

Example:
```
[openssl_init]
providers = provider_sect
```

After this change, openssl util works correctly.

```
➤ openssl version
OpenSSL 3.0.14 4 Jun 2024 (Library: OpenSSL 3.0.14 4 Jun 2024)
```

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15661
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoimx: 6.6: add upstream patches for imx8m{m,n,p} venice
Tim Harvey [Tue, 21 May 2024 19:18:50 +0000 (12:18 -0700)]
imx: 6.6: add upstream patches for imx8m{m,n,p} venice

Add a set of upstream patches for the imx8m{m,n,p} based Venice
boards.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/15736
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoimx: coretexa53: fix network configuration for GW74xx
Tim Harvey [Tue, 21 May 2024 18:44:34 +0000 (11:44 -0700)]
imx: coretexa53: fix network configuration for GW74xx

The GW74xx's first RJ45 is eth0 which should be the WAN adapter, not
eth1 which is the CPU uplink port to the switch.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
Link: https://github.com/openwrt/openwrt/pull/15736
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agowifi-scripts: ensure get_freq returns int (iw-6.9)
Sean Khan [Sat, 22 Jun 2024 00:01:22 +0000 (20:01 -0400)]
wifi-scripts: ensure get_freq returns int (iw-6.9)

With `iw` version 6.9 frequencies are now being reported as float,
which is incompatible with wpa_supplicant's config option 'frequency'
which expects an integer.

iwinfo phy0 info output:

Version: 5.19
```
Frequencies:
  * 5180 MHz [36] (30.0 dBm)
  * 5200 MHz [40] (30.0 dBm)
  * 5220 MHz [44] (30.0 dBm)
  * 5240 MHz [48] (30.0 dBm)
  * 5260 MHz [52] (24.0 dBm)
  * 5280 MHz [56] (24.0 dBm)
  * 5300 MHz [60] (24.0 dBm)
  * 5320 MHz [64] (24.0 dBm)
  * 5500 MHz [100] (24.0 dBm)
  * 5520 MHz [104] (24.0 dBm)
  * 5540 MHz [108] (24.0 dBm)
  * 5560 MHz [112] (24.0 dBm)
  * 5580 MHz [116] (24.0 dBm)
  * 5600 MHz [120] (24.0 dBm)
  * 5620 MHz [124] (24.0 dBm)
  * 5640 MHz [128] (24.0 dBm)
  * 5660 MHz [132] (24.0 dBm)
  * 5680 MHz [136] (24.0 dBm)
  * 5700 MHz [140] (24.0 dBm)
  * 5720 MHz [144] (24.0 dBm)
  * 5745 MHz [149] (30.0 dBm)
  * 5765 MHz [153] (30.0 dBm)
  * 5785 MHz [157] (30.0 dBm)
  * 5805 MHz [161] (30.0 dBm)
  * 5825 MHz [165] (30.0 dBm)
  * 5845 MHz [169] (disabled)
  * 5865 MHz [173] (disabled)
  * 5885 MHz [177] (disabled)
```

Version: 6.9
```
Frequencies:
  * 5180.0 MHz [36] (30.0 dBm)
  * 5200.0 MHz [40] (30.0 dBm)
  * 5220.0 MHz [44] (30.0 dBm)
  * 5240.0 MHz [48] (30.0 dBm)
  * 5260.0 MHz [52] (24.0 dBm)
  * 5280.0 MHz [56] (24.0 dBm)
  * 5300.0 MHz [60] (24.0 dBm)
  * 5320.0 MHz [64] (24.0 dBm)
  * 5500.0 MHz [100] (24.0 dBm)
  * 5520.0 MHz [104] (24.0 dBm)
  * 5540.0 MHz [108] (24.0 dBm)
  * 5560.0 MHz [112] (24.0 dBm)
  * 5580.0 MHz [116] (24.0 dBm)
  * 5600.0 MHz [120] (24.0 dBm)
  * 5620.0 MHz [124] (24.0 dBm)
  * 5640.0 MHz [128] (24.0 dBm)
  * 5660.0 MHz [132] (24.0 dBm)
  * 5680.0 MHz [136] (24.0 dBm)
  * 5700.0 MHz [140] (24.0 dBm)
  * 5720.0 MHz [144] (24.0 dBm)
  * 5745.0 MHz [149] (30.0 dBm)
  * 5765.0 MHz [153] (30.0 dBm)
  * 5785.0 MHz [157] (30.0 dBm)
  * 5805.0 MHz [161] (30.0 dBm)
  * 5825.0 MHz [165] (30.0 dBm)
  * 5845.0 MHz [169] (disabled)
  * 5865.0 MHz [173] (disabled)
  * 5885.0 MHz [177] (disabled)
```

Error reported from wpa_supplicant
```console
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: invalid number "5320.0"
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 10: failed to parse frequency '5320.0'.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Line 16: failed to parse network block.
Fri Jun 21 14:07:22 2024 daemon.err wpa_supplicant[2866]: Failed to read or parse configuration '/var/run/wpa_supplicant-phy1-mesh0.conf'.
```

This affects mesh, adhoc, and client-mode WDS.

Until hostapd/wpa_supplicant is updated (or patched) to support float
frequencies, ensure `get_freq` prints out an integer.

Signed-off-by: Sean Khan <datapronix@protonmail.com>
Link: https://github.com/openwrt/openwrt/pull/15770
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoqoriq: use 6.1 by default and drop 5.15
Robert Marko [Fri, 21 Jun 2024 11:41:33 +0000 (13:41 +0200)]
qoriq: use 6.1 by default and drop 5.15

qoriq has had kernel 6.1 as testing for 2 months now, so lets default to
it and drop 5.15 support.

Link: https://github.com/openwrt/openwrt/pull/15767
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools: firmware-utils: update to Git HEAD (2024-06-20)
Christian Marangi [Fri, 21 Jun 2024 11:34:32 +0000 (13:34 +0200)]
tools: firmware-utils: update to Git HEAD (2024-06-20)

224d497dd94f srec2bin: drop unused "dum" variable
6777b2d51961 uimage_sgehdr: use "char" type for header struct strings
81db3025aac5 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc74b43e pc1crypt: make decrypt/encrypt functions take void * as argument
6ac44974185a linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agowifi-scripts: rewrite wifi detect code in ucode
Felix Fietkau [Tue, 11 Jun 2024 15:29:22 +0000 (17:29 +0200)]
wifi-scripts: rewrite wifi detect code in ucode

Rely entirely on /etc/board.json instead of screen scraping iw cli output

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agowifi-scripts: add default channel to board.json in wifi-detect.uc
Felix Fietkau [Tue, 11 Jun 2024 09:34:27 +0000 (11:34 +0200)]
wifi-scripts: add default channel to board.json in wifi-detect.uc

Preparation for avoiding iw calls in /lib/wifi/mac80211.sh

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agoucode: update to Git HEAD (2024-06-18)
Felix Fietkau [Wed, 19 Jun 2024 11:50:21 +0000 (13:50 +0200)]
ucode: update to Git HEAD (2024-06-18)

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

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agoiw: update to version 6.9
Felix Fietkau [Mon, 10 Jun 2024 18:50:38 +0000 (20:50 +0200)]
iw: update to version 6.9

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agohostapd: use strdup on string passed to hostapd_add_iface
Felix Fietkau [Fri, 14 Jun 2024 12:17:57 +0000 (14:17 +0200)]
hostapd: use strdup on string passed to hostapd_add_iface

The data is modified within hostapd_add_iface

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agohostapd: fix crash on interface setup failure
Felix Fietkau [Fri, 14 Jun 2024 12:43:39 +0000 (14:43 +0200)]
hostapd: fix crash on interface setup failure

Add a missing NULL pointer check when deleting beacons

Signed-off-by: Felix Fietkau <nbd@nbd.name>
5 months agofirmware-utils: update to Git HEAD (2024-06-20)
Christian Marangi [Thu, 20 Jun 2024 21:22:01 +0000 (23:22 +0200)]
firmware-utils: update to Git HEAD (2024-06-20)

224d497dd94f srec2bin: drop unused "dum" variable
6777b2d51961 uimage_sgehdr: use "char" type for header struct strings
81db3025aac5 uimage_sgehdr: drop unused "ltmp" variable
bd7fcc74b43e pc1crypt: make decrypt/encrypt functions take void * as argument
6ac44974185a linksys: add magic header generation tool for e8350 v1

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agogeneric: platform/mikrotik: add NVMEM layout driver main
Robert Marko [Sun, 9 Jun 2024 10:14:25 +0000 (12:14 +0200)]
generic: platform/mikrotik: add NVMEM layout driver

Currently, information from MikroTik hard_config is only available via
sysfs, meaning that we have to rely on userspace to for example setup MACs.

So, lets provide a basic NVMEM layout based driver to expose the same cells
as sysfs driver exposes.

Do note that the we dont extract the WLAN caldata and BDF-s at this point.

Reviewed-by: Thibaut VARÈNE <hacks@slashdirt.org>
Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agogeneric: platform/mikrotik: move hard config tag ID-s to a header
Robert Marko [Mon, 10 Jun 2024 10:20:11 +0000 (12:20 +0200)]
generic: platform/mikrotik: move hard config tag ID-s to a header

Move the hard config tag ID-s to a separate header so they can be reused
by the NVMEM driver as well.

Link: https://github.com/openwrt/openwrt/pull/15665
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools: util-linux: update to v2.40.1
Thomas Weißschuh [Sun, 16 Jun 2024 20:59:29 +0000 (22:59 +0200)]
tools: util-linux: update to v2.40.1

Release Notes:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoutil-linux: update to v2.40.1
Thomas Weißschuh [Sun, 16 Jun 2024 20:55:41 +0000 (22:55 +0200)]
util-linux: update to v2.40.1

Release Notes:
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40-ReleaseNotes
https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.1-ReleaseNotes

Remove upstreamed:
001-meson-properly-handle-gettext-non-existence.patch

New:
0001-meson-Fix-build-python-option.patch

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
5 months agoath79: trim useless package kmod-leds-reset for some devices
Shiji Yang [Wed, 19 Jun 2024 10:53:01 +0000 (10:53 +0000)]
ath79: trim useless package kmod-leds-reset for some devices

Only NETGEAR WNDR3x00 series devices have reset controller LED.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
5 months agoath79: disable unnecessary driver CONFIG_LEDS_RESET
Shiji Yang [Wed, 19 Jun 2024 10:52:37 +0000 (10:52 +0000)]
ath79: disable unnecessary driver CONFIG_LEDS_RESET

This driver has already been packed as a software package. There is
no need to build it into the kernel.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
5 months agoath79: add back usb LED label for NETGEAR WNDR3x00 devices
Shiji Yang [Wed, 19 Jun 2024 10:52:03 +0000 (10:52 +0000)]
ath79: add back usb LED label for NETGEAR WNDR3x00 devices

The "reset-leds" driver does not support parsing color and function
properties.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
5 months agobcm27xx: fix malformed upstream arm64 DT patch
Álvaro Fernández Rojas [Wed, 19 Jun 2024 18:17:44 +0000 (20:17 +0200)]
bcm27xx: fix malformed upstream arm64 DT patch

This patch was causing buildbot issues when copying arm64 DT files since
bcm283x-rpi-csi1-2lane.dtsi and bcm283x-rpi-lan7515.dtsi were linked to
"../../../../arm/boot/dts/" instead of "../../../../arm/boot/dts/broadcom".
These files aren't needed, so let's remove them instead of fixing them.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15762
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoapk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG
Christian Marangi [Thu, 20 Jun 2024 03:51:07 +0000 (05:51 +0200)]
apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG

Limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG as APK have different
way to validate package integrity (apk audit)

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoRevert "apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG"
Christian Marangi [Thu, 20 Jun 2024 03:49:21 +0000 (05:49 +0200)]
Revert "apk: limit CONFIG_IPK_FILES_CHECKSUMS config to OPKG"

This reverts commit 25bbefcdd9424ed1b6ef35a39e84420fc4cce322.

Only the Config-build.in change needed to be merged and this contains
leftover from previous revision of the feature.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoath79: ag71xx: support probe defferal for getting MAC address
Robert Marko [Wed, 19 Jun 2024 09:26:47 +0000 (11:26 +0200)]
ath79: ag71xx: support probe defferal for getting MAC address

Currently, of_get_ethdev_address() return is checked for any return error
code which means that trying to get the MAC from NVMEM cells that is backed
by MTD will fail if it was not probed before ag71xx.

So, lets check the return error code for EPROBE_DEFER and defer the ag71xx
probe in that case until the underlying NVMEM device is live.

Link: https://github.com/openwrt/openwrt/pull/15752
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agoipq40xx: net/ipqess: fix outbound port tag computation
Matthias Schiffer [Wed, 19 Jun 2024 23:05:51 +0000 (01:05 +0200)]
ipq40xx: net/ipqess: fix outbound port tag computation

Since the introduction of out-of-band tagging, writing the outbound tag
had been completely broken: First, in place of a port mask containing
the port number, just the port number itself was set in the register
value. Just after that, the full port mask 0x3e (all 5 external ports)
was set unconditionally.

This remained unnoticed because the switch would then use the FDB to
decide where to send unicast packets; broadcast and multicast packets
were however sent to every port.

Fix the port tag computation and only use the full port mask as a
fallback for non-DSA mode, as it was done in the older driver patches
used on Linux 5.15.

Fixes: cd9c7211241e ("ipq40xx: 6.1: use latest DSA and ethernet patches")
Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agokernel: bump 6.1 to 6.1.94
Zxl hhyccc [Mon, 17 Jun 2024 16:04:43 +0000 (00:04 +0800)]
kernel: bump 6.1 to 6.1.94
https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.1.94

All other patches automatically rebased.

Build system: Kirkwood bcm53xx

Signed-off-by: Zxl hhyccc <zxlhhy@gmail.com>
5 months agolantiq: fix pci driver once again
Martin Schiller [Mon, 17 Jun 2024 06:27:59 +0000 (08:27 +0200)]
lantiq: fix pci driver once again

In my previous attempt to solve the PCI problems for the lantiq targets,
I did not pay attention to the fact that the original accesses to the
GPIO took place in RAW mode. As a result, the polarity defined in the
device trees (apart from the initial value) was irrelevant.

In addition, the expected name of the GPIO in the dts has changed due to
the upstream change and therefore no RESET is currently performed.

As discussed in [1] on the linux-mips mailing list, we will now adapt
the dts files accordingly instead of patching the driver:

- dts property will be renamed to "reset-gpios"
- Polarity is set to "GPIO_ACTIVE_LOW".

I have verified this with a TP-Link TD-W8980. The PCI device is now
recognized by the system.

[1] https://patchwork.kernel.org/project/linux-mips/patch/20240607090400.1816612-1-ms@dev.tdt.de/

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Tested-by: Aleksander Jan Bajkowski <olek2@wp.pl> # Tested on AVM 7330 (ar9)
Link: https://github.com/openwrt/openwrt/pull/15731
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agogeneric: backport pending driver for Winchip CH348 USB serial
Daniel Golle [Mon, 17 Jun 2024 14:31:12 +0000 (15:31 +0100)]
generic: backport pending driver for Winchip CH348 USB serial

Import patch and package kernel module for Winchip CH348
USB-to-8x-UART chip.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 months agogeneric: 6.6: mt7530: add support for bridge port isolation
Daniel Golle [Wed, 19 Jun 2024 12:33:23 +0000 (13:33 +0100)]
generic: 6.6: mt7530: add support for bridge port isolation

Import patches accepted upstream introducing port isolation feature
on MT7530 switches:
  - [net-next,v3,1/2] net: dsa: mt7530: factor out bridge join/leave logic
    https://git.kernel.org/netdev/net-next/c/c25c961fc7f3
  - [net-next,v3,2/2] net: dsa: mt7530: add support for bridge port isolation
    https://git.kernel.org/netdev/net-next/c/3d49ee2127c2

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 months agokernel: bump 6.6 to 6.6.34
John Audia [Wed, 19 Jun 2024 11:56:04 +0000 (07:56 -0400)]
kernel: bump 6.6 to 6.6.34

Changelog: https://cdn.kernel.org/pub/linux/kernel/v6.x/ChangeLog-6.6.34

Removed upstreamed:
backport-6.6/701-v6.8-net-sfp-bus-fix-SFP-mode-detect-from-bitrate.patch[1]

All other patches automatically rebased.

Build system: x86/64
Build-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3
Run-tested: x86/64/AMD Cezanne, flogic/xiaomi_redmi-router-ax6000-ubootmod, ramips/tplink_archer-a6-v3

1. https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v6.6.34&id=9399baa02e4b7f101c39fdbc4d681d54bca4465b

Signed-off-by: John Audia <therealgraysky@proton.me>
5 months agomac80211: backport upstream patch for tim->virtual_map flex array warn
Christian Marangi [Wed, 19 Jun 2024 16:03:01 +0000 (18:03 +0200)]
mac80211: backport upstream patch for tim->virtual_map flex array warn

Backport upstream patch for tim->virtual_map flex array warning for
invalid write.

This has been notice with the bump of ath10k-ct to version 6.7.

Link: https://github.com/openwrt/openwrt/pull/15760
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agobcm27xx: base-files: diag: fix LEDs
Álvaro Fernández Rojas [Wed, 19 Jun 2024 18:03:29 +0000 (20:03 +0200)]
bcm27xx: base-files: diag: fix LEDs

At some point RPi LEDs were renamed from led0/led1 to PWR/ACT.
This patch fixes this and also automatically detects the status_led without
relying on board_name.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobcm27xx: drop kernel 6.1 support
Álvaro Fernández Rojas [Tue, 18 Jun 2024 20:10:25 +0000 (22:10 +0200)]
bcm27xx: drop kernel 6.1 support

kernel 6.1 can be dropped since 6.6 is the default kernel.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agobcm27xx: switch default kernel to 6.6
Álvaro Fernández Rojas [Tue, 18 Jun 2024 20:04:57 +0000 (22:04 +0200)]
bcm27xx: switch default kernel to 6.6

Update default kernel version to 6.6 for the Raspberry Pi devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
5 months agotarget.mk: improve handling of default enabled SECCOMP
Christian Marangi [Wed, 19 Jun 2024 14:19:10 +0000 (16:19 +0200)]
target.mk: improve handling of default enabled SECCOMP

Handling default packages selection is really problematic and error
prone. In all the changes, the SECCOMP config is enabled by default if
supported by the target.

This is problematic for the scenario of the first .config creation where
this option will be enabled by default but the package default are
already being parsed.

This cause the reparsing of the default package on the next command and
the "outdated config" error. To better handle this special case, add
additiona logic to match the dependency in the config and check if
CONFIG_SECCOMP should be enabled by default in the scenario where a
.config needs to be init and doesn't exist.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agoscripts/download.pl: fix broken link for KERNEL projects
Christian Marangi [Wed, 19 Jun 2024 12:30:06 +0000 (14:30 +0200)]
scripts/download.pl: fix broken link for KERNEL projects

Fix broken link generation for KERNEL projects.

Using $1 in projectsmirrors sub was still referencing the caller $1
instead of the remaining args of projectsmirrors sub.

Use shift and put the second arg of projectsmirrors sub in $append to
correctly handle the sub args.

Fixes: 465cf358881c ("scripts/download.pl: detach mirror URLs from script file")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
5 months agobase-files: migrate old UCI network sections defining bridges
Rafał Miłecki [Tue, 18 May 2021 21:41:33 +0000 (23:41 +0200)]
base-files: migrate old UCI network sections defining bridges

Old "interface" sections for bridges were mixing layer 2 and layer 3.
That syntax got deprecated and UCI section "device" is used for bridge
configuration now.

Backward compatibility may be dropped from netifd soon now so migrate
old configs using uci-defaults script.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
5 months agoath79: mikrotik: set compat version for NAND devices
Robert Marko [Wed, 19 Jun 2024 10:15:16 +0000 (12:15 +0200)]
ath79: mikrotik: set compat version for NAND devices

Currently, trying to upgrade on a MikroTik NAND device will force you to
use sysupgrade -n due to:
upgrade: The device is supported, but the config is incompatible to the new image (1.0->1.1). Please upgrade without keeping config (sysupgrade -n).
upgrade: NAND images switched to yafut. If running older image, reinstall from initramfs.

So instead of having users manually set the new compat version lets do
what other targets do and set it for all NAND devices after good boot.

Link: https://github.com/openwrt/openwrt/pull/15754
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/coreutils: ignore gnulib changes to fcntl.h
Michael Pratt [Fri, 14 Jun 2024 07:58:19 +0000 (03:58 -0400)]
tools/coreutils: ignore gnulib changes to fcntl.h

As a side-effect to adding a gnulib module for posix_fallocate(),
there are changes to the input file for fcntl.h which
are not handled here since autoreconf is not ran.

Skip updating the fcntl.h header from gnulib
and use the version shipped with the release.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: add more pkg-config library info
Michael Pratt [Tue, 18 Jun 2024 04:01:31 +0000 (00:01 -0400)]
tools/elfutils: add more pkg-config library info

In order for linking the static libraries from elfutils to work,
other libraries need to be included to handle the references
to functions made in the library's objects that are not included
as they would already be if the library was a shared object instead.

A shared object library stores this list of libraries when it was made,
so that the dynamic linker can refer to that list at runtime,
but a static library has no such functionality so the list of libraries
for missing functions must be included at link time.

This information was already added to the pc file for libelf
using the definitions in src/Makefile.am,
so extend this to the rest of the pc files in the project.

For situations where the libraries may be used
without pkg-config setting the flags and library list,
this patch and the pc files can serve as a quick reference.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: use weak alias over no alias for macOS
Michael Pratt [Tue, 11 Jun 2024 03:59:10 +0000 (23:59 -0400)]
tools/elfutils: use weak alias over no alias for macOS

Clang has support for weak aliases
despite no support for strong aliases,
but it only works with the #pragma directive.

Implementing weak aliases instead of none
is likely a more upstream-friendly solution
for supporting building on other platforms.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: split upstreamable parts of portability patch
Michael Pratt [Sat, 18 May 2024 03:21:42 +0000 (23:21 -0400)]
tools/elfutils: split upstreamable parts of portability patch

The addition of LT_INIT as well as the adjustment of
the BUILD_STATIC and addition of the BUILD_SHARED conditionals
and their usage to block building of shared objects
and adjust the variables for building static libraries
is potentially upstream-friendly.

The use of a manifest file to keep a list
of the objects in each library instead of calling ar
is also potentially upstream-friendly.

Separate these changes from the macOS-specific hacks.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: use conditional to block build of shared objects
Michael Pratt [Sat, 18 May 2024 01:23:33 +0000 (21:23 -0400)]
tools/elfutils: use conditional to block build of shared objects

Add a potentially upstream-friendly conditional
using the libtool configure variable "enable_shared"
in order to block building and installing of shared objects
and adjust the build of static libraries
instead of directly patching lines in or out.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: do not use ar to list library objects
Michael Pratt [Thu, 13 Jun 2024 19:40:57 +0000 (15:40 -0400)]
tools/elfutils: do not use ar to list library objects

The use of ar to list the archive members in a library
in order to include them in another library is not portable.

On BSD and macOS, ar will also list
the special archive member "__.SYMDEF"
which is not a compiled object, rather it is
part of the metadata prepended to the library by ranlib.

Fix this by writing the list of unique objects used
to create the library into a separate "manifest" file
when the library is created, which will be read later
when the Makefiles of other subdirectories are ran.

Extend this to all other libraries whether or not they are linked
to another library for a shared object that is installed
so that it is possible for any of the libraries
to be statically built with more objects.

The use of the wildcard function to ignore the
special archive members which are only metadata
is no longer needed to prevent build errors.

Not using the wildcard function is preferred,
since errors should be caught during the build
instead of when linking something else or at runtime.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: do not use libtool for all subdirectories
Michael Pratt [Sat, 18 May 2024 00:11:58 +0000 (20:11 -0400)]
tools/elfutils: do not use libtool for all subdirectories

Importing gnulib in order to have a local portable library
to link against for missing functions currently requires
using libtool to produce the libgnu.la library.

Ideally, linking would be simple if the rest of the libraries
built by elfutils were also built using libtool, as linking
them together would not require any manipulations of library paths.

However, upstream elfutils does not support building the libraries
statically with libtool, so using libtool comes at the cost
of creating a huge patch to introduce that functionality.

For building on macOS, it turns out that libgnu.la is only needed
for building the binaries, and that just one or two objects from libgnu
are needed to build the libraries, so in this case, it would be simple
to add the specific non-libtool-wrapped library and objects
to the link paths as needed, rather than use libtool to link
the libtool wrappers, which greatly reduces the need to patch.

Not using libtool also makes the original Makefile definitions for LIBADD
once again be the right ones to use. However, to be portable,
for libdw the wildcard function needs to be used in order to exclude
special archive members like "__.SYMDEF" which are not compiled objects
because some BSD-like versions of ar include that metadata in the list,
or because the library included may have objects from another subdirectory.
Also, the rest of the subdirectories have custom "LDLIBS" variables
meant for building shared objects only, so define the LIBADD variables
with objects from those existing definitions so that when building only
the static versions of the libraries, those objects can still be included.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: use gnulib module for posix_fallocate()
Michael Pratt [Mon, 10 Jun 2024 18:43:04 +0000 (14:43 -0400)]
tools/elfutils: use gnulib module for posix_fallocate()

The version of posix_fallocate() patched into elfutils
for macOS using code from Mozilla is now patched into gnulib.

Import the fallocate-posix module and always link
the corresponding object to libraries whenever it is built.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/gnulib: add fallocate-posix module
Michael Pratt [Mon, 10 Jun 2024 08:04:41 +0000 (04:04 -0400)]
tools/gnulib: add fallocate-posix module

Add a module to gnulib to support posix_fallocate()
for macOS and other systems that are missing it.

Apple-specific code is sourced from Mozilla,
and the rest from glibc, both licensed under LGPL.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/elfutils: simplify portability patch
Michael Pratt [Sat, 18 May 2024 03:47:54 +0000 (23:47 -0400)]
tools/elfutils: simplify portability patch

Several changes to the elfutils source files
made during the process of figuring out how to
successfully build elfutils on macOS
turn out to not be necessary to do so,
and were most likely leftover bits during testing.

Remove the line changes that are not needed
and add some line changes to adapt to sources as is:

 - Remove now unnecessary bump to autoconf version prereq
 - AC_CONFIG_MACRO_DIRS is not necessary to define
   as ACLOCAL_AMFLAGS is already defined in Makefiles
 - let libtool "enable_static" variable also decide the value
   of the local conditional BUILD_STATIC
 - override configure variables instead of removing
   checks for libraries or additions to LDFLAGS
 - only exclude "hidden" attribute for macOS instead of deleting
 - preserve original list of sources to build for libelf
 - use openwrt Makefile to add gnulib headers
 - use openwrt Makefile to add LIBADD variables
 - remove deletion of variables and rules for shared objects
 - prefer recursively expanded variables over muliple renames
   each time that a word is added to its value
 - remove changes to subdirectories that are not built
   and remove changes to target files of those subdirectories
 - prefer basic text rename over variables in cases where
   there would be no line number difference
 - give LT_INIT forced default values that match upstream
 - move gl_EARLY and gl_INIT down relative to compiler checks
 - reorganize some line changes to save some lines

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/gnulib: ignore AC_PREREQ error if actual version passes
Michael Pratt [Sun, 19 May 2024 23:33:13 +0000 (19:33 -0400)]
tools/gnulib: ignore AC_PREREQ error if actual version passes

The gnulib-tool script is written to have a fatal error
whenever the minimum required version of autoconf
for the project that gnulib is being imported into
as defined in configure.ac was less than
the minimum required version required by gnulib.

However, none of this matters if the version of autoconf
that we use is newer than both requirements.

Instead, use functions from the bootstrap script
to check for the version of autoconf being used
and print a warning whenever this case occurs.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>
5 months agotools/gnulib: allow forced exclusion of functions after configure
Michael Pratt [Sat, 8 Jun 2024 03:52:56 +0000 (23:52 -0400)]
tools/gnulib: allow forced exclusion of functions after configure

Overriding variables used in both the macros and the headers
like setting REPLACE_FCNTL to 0 while invoking Make causes the
function aliases like rpl_fcntl() to not be defined,
however the object may still be built with the fnctl() function.

Usually this is enough for building while avoiding
the need to link the resulting libgnu library
to every single other build target for a project
in order to include the gnulib copy of the function,
because in these cases we don't care which version
of the function is used.

However for functions like fcntl() this doesn't work
as it is designed to use either the alias or standard declaration
from gnulib headers in order to be
a wrapper for the native host copy of fcntl()
by containing recursive calls to fcntl() within itself
after undefining the gnulib function declaration.

Overriding the variables used by the header when invoking Make
causes the header's declarations to be blocked,
and this results in the gnulib version of fcntl()
to call itself recursively and indefinitely
leading to segmentation faults.

Fix this by using macros defined with those variables
in order to exclude the function during preprocessing.

While at it, do the same for reallocarray()
so that the configure option --avoid=reallocarray
and Make variable REPLACE_REALLOCARRAY set to 0
would have a similar effect.

In the future this patch can be expanded to include
more functions and some version of this may be upstreamable.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/15690
Signed-off-by: Robert Marko <robimarko@gmail.com>