Commit Graph

65049 Commits

Author SHA1 Message Date
Markus Stockhausen 21d3722c40 realtek: don't disable MIPS counter on secondary VPEs
After observation that timer interrupt 7 always fires on secondary VPEs
the counter was disabled in the startup code. This is a bad idea when
building the kernel with jitterentropy. To generate entropy it makes use
of function random_get_entropy(). On MIPS architecture this simply reads
the counter register on the current core. With a disabled counter it
always returns the same value and the entropy initialization stalls the
core if it runs on a secondary VPE. See backtrace

[   21.736246] rcu: INFO: rcu_sched self-detected stall on CPU
[   21.736246] rcu: INFO: rcu_sched self-detected stall on CPU
[   21.748594] rcu:     1-....: (2100 ticks this GP) idle=064c/1/0x40000002 softirq=7/7 fqs=1050
[   21.748594] rcu:     1-....: (2100 ticks this GP) idle=064c/1/0x40000002 softirq=7/7 fqs=1050
[   21.766871] rcu:     (t=2102 jiffies g=-1187 q=25 ncpus=2)
[   21.766871] rcu:     (t=2102 jiffies g=-1187 q=25 ncpus=2)
[   21.778429] CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.39 #482
[   21.778429] CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.12.39 #482
[   21.778461] Hardware name: Zyxel GS1900-48
[   21.778461] Hardware name: Zyxel GS1900-48
...
[   21.779757] [<8029b968>] jent_measure_jitter+0xc8/0x10c
[   21.779757] [<8029b968>] jent_measure_jitter+0xc8/0x10c
[   21.779779] [<8029b9e8>] jent_gen_entropy+0x3c/0xb0
[   21.779779] [<8029b9e8>] jent_gen_entropy+0x3c/0xb0
[   21.779800] [<8029bcc0>] jent_entropy_collector_alloc+0x104/0x118
[   21.779800] [<8029bcc0>] jent_entropy_collector_alloc+0x104/0x118
[   21.779822] [<8029bd6c>] jent_entropy_init+0x4c/0x2ec
[   21.779822] [<8029bd6c>] jent_entropy_init+0x4c/0x2ec
[   21.779844] [<8086f184>] jent_mod_init+0x58/0xac
[   21.779844] [<8086f184>] jent_mod_init+0x58/0xac
[   21.779865] [<80100200>] do_one_initcall+0x70/0x250
[   21.779865] [<80100200>] do_one_initcall+0x70/0x250
[   21.779883] [<8085c018>] kernel_init_freeable+0x1f0/0x280
[   21.779883] [<8085c018>] kernel_init_freeable+0x1f0/0x280
[   21.779905] [<8067cba4>] kernel_init+0x20/0xb0
[   21.779905] [<8067cba4>] kernel_init+0x20/0xb0
[   21.779926] [<80101158>] ret_from_kernel_thread+0x14/0x1c
[   21.779926] [<80101158>] ret_from_kernel_thread+0x14/0x1c

This bit of entropy is helpful on these low end devices. Reenable the
counter and simply disable the interrupt.

Fixes: b7aab19585 ("realtek: SMP handling of R4K timer interrupts")
Reported-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19499
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 15:51:23 +02:00
Markus Stockhausen a3bfb67072 realtek: mdio: RTL838x: move functions over to bus
The mdio bus functions are still split between ethernet and dsa driver.
Before moving everthing out to a separate mdio driver we decided to
collect everything in the ethernet driver with the rtmdio prefix.
Take over the remaining RTL838x functions.

Remark: This is more or less a copy/paste with function renaming. As
there are still some consumers in the DSA driver the definitions and
inclusions must be flipped.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19484
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 15:46:31 +02:00
INAGAKI Hiroshi 6e8042ed97 mediatek: add missing #address/size-cells for ELECOM WRC-X3000GS3
Add missing `#address-cells = <1>;` and `#size-cells = <0>;` properties
to `&eth` and `&wifi` nodes to resolve the following warnings.

```
../dts/mt7981b-elecom-wrc-x3000gs3.dts:114.3-13: Warning (reg_format): /soc/ethernet@15100000/mac@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
../dts/mt7981b-elecom-wrc-x3000gs3.dts:129.3-13: Warning (reg_format): /soc/ethernet@15100000/mac@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
../dts/mt7981b-elecom-wrc-x3000gs3.dts:372.3-13: Warning (reg_format): /soc/wifi@18000000/band@0:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
../dts/mt7981b-elecom-wrc-x3000gs3.dts:378.3-13: Warning (reg_format): /soc/wifi@18000000/band@1:reg: property has invalid length (4 bytes) (#address-cells == 2, #size-cells == 1)
../dts/mt7981b-elecom-wrc-x3000gs3.dts:112.15-125.4: Warning (avoid_default_addr_size): /soc/ethernet@15100000/mac@0: Relying on default #address-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:112.15-125.4: Warning (avoid_default_addr_size): /soc/ethernet@15100000/mac@0: Relying on default #size-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:127.15-136.4: Warning (avoid_default_addr_size): /soc/ethernet@15100000/mac@1: Relying on default #address-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:127.15-136.4: Warning (avoid_default_addr_size): /soc/ethernet@15100000/mac@1: Relying on default #size-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:371.9-375.4: Warning (avoid_default_addr_size): /soc/wifi@18000000/band@0: Relying on default #address-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:371.9-375.4: Warning (avoid_default_addr_size): /soc/wifi@18000000/band@0: Relying on default #size-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:377.9-381.4: Warning (avoid_default_addr_size): /soc/wifi@18000000/band@1: Relying on default #address-cells value
../dts/mt7981b-elecom-wrc-x3000gs3.dts:377.9-381.4: Warning (avoid_default_addr_size): /soc/wifi@18000000/band@1: Relying on default #size-cells value
```

Signed-off-by: INAGAKI Hiroshi <musashino.open@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/19530
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 15:41:23 +02:00
Michael Pratt d7d0205940 tools/automake: update to 1.18
Update to the latest stable release
with the new API versions for binaries.

The temporary patching of shebangs is no longer necessary
since the whitespace check has been changed to a warning.

Part of a patch was upstreamed and therefore removed.

Manually adjusted patch:
 - 000-relocatable.patch
 - 101-do-not-require-files.patch

All other patches are automatically refreshed.

Link: https://lists.gnu.org/archive/html/autotools-announce/2025-05/msg00001.html
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt da541f7acd gettext-full: update to 0.24.1
Update to a newer bugfix release of gettext.
Include gnulib-l10n as a new dependency.

All patches are automatically refreshed.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt 246eba7528 gnulib-l10n: add package
This package is a supplement for part of gettext
that uses gnulib sources, and includes the localizations
for messages specifically in gnulib files.

This is being added as a separate package
instead of a build target of gnulib
because that method of acquiring the localizations
requires the use of gettext and would be a reverse dependency.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt 1a253a2bb5 tools/gnulib: backport patches for gettext
The latest versions of gettext rely on several changes to gnulib
including both changes to modules and new modules
and some previously gettext specific code being moved to gnulib.

Backport these changes in order to allow updating gettext
while using the local gnulib copy of sources.

Add patch:
 - 640-mem-hash-map.patch
 - 645-next-prime.patch
 - 646-hashcode-string.patch
 - 647-hashkey-string.patch
 - 650-package-version.patch
 - 651-package-version-simplify.patch
 - 652-package-version-simplify-further.patch
 - 653-package-version-warning.patch
 - 660-version-stamp.patch
 - 689-vc-mtime.patch
 - 755-clean-temp-hashkey.patch
 - 795-string-desc-rename-functions.patch
 - 796-vc-mtime-less-read.patch
 - 797-vc-mtime-add-api.patch
 - 798-vc-mtime-add-api.patch
 - 799-vc-mtime-old-git.patch
 - 900-str_startswith-module.patch
 - 901-str_endswith-module.patch

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt d19f8bc199 tools/gnulib: update to branch stable-202501
Move to the June 2025 update of the first 2025 stable branch
in order to better support updating gettext to the latest versions.

More instances of blocking the defining of functions
that use reallocarray() is needed for portability with macOS
as more similar functions have been added.
And one instance is removed as the function was removed.
Refer to a previous commit to explain the need for this.

Manually adjusted patch:
 - 150-portable-tdestroy.patch
 - 160-flag-reallocarray.patch
 - 200-force-disable-after-configure.patch

Removed upstreamed patch:
 - 500-acl-function-name.patch

All other patches are automatically refreshed.

Ref: 5ade7ee60 ("tools/gnulib: add macros to skip reallocarray() functions")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt 92d10e2cdf nftables: remove usage of autoreconf
The usage of automake is left over
after the patch which required it was removed
since the new configure option
"--without-cli" was added to upstream.

Remove the usage of autotools to save build time.

Ref: 72e6e0b85 ("nftables: introduce experimental nftables")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt 0b4ebe5dd3 tools/elfutils: enable parallel building
There are multiple subdirectories for elfutils
and more than one is not dependent on another,
so enabling parallel building can save time
if multiple cores are available.

The change in build time for the package
is as much as 20% when cores are not in use by other jobs.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt abf243eae8 tools/elfutils: update to 0.192
Update to the next release.

Removed upstream patch:
 - 000-backport-iquote-include.patch
 - 010-backport-mips-support-reloc.patch
 - 014-backport-mips-support-stack.patch
 - 015-backport-mips-support-regs.patch
 - 095-src-unused-variable.patch
 - 096-lib-config_h.patch
 - 097-libcpu-config_h.patch
 - 098-libdw-maintainer-clean.patch
 - 099-remove-unlocked-stdio.patch

Manually adjusted patch:
 - 012-backport-mips-support-readelf.patch
 - 013-backport-mips-support-elflint.patch
 - 101-shared-conditional.patch

All other patches are automatically refreshed.

Link: https://sourceware.org/pipermail/elfutils-devel/2024q4/007540.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:09 +02:00
Michael Pratt 5bb84fb53b tools/elfutils: update MIPS support patches
The original patch series partially added by commit
f97da2c61 ("tools/elfutils: add missing MIPS reloc support")
now has a v3 which has half of it's commits accepted.

To prepare for updating to the new release,
use the new series that includes backports.

Manually adjusted patch:
 - 010-backport-mips-support-reloc.patch

Add patch:
 - 011-backport-mips-support-strip.patch
 - 012-backport-mips-support-readelf.patch
 - 013-backport-mips-support-elflint.patch
 - 014-backport-mips-support-stack.patch
 - 015-backport-mips-support-regs.patch

Tested-by: Tony Ambardar <itugrok@yahoo.com>
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt c83941d288 tools/elfutils: add maintainer-clean to clean target
Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does delete itself or libtool.

In order to enable rules for building what is removed,
maintainer mode is required for configuring.

Building from tracked sources only with maintainer mode
requires a lexical analyzer, so add dependency for bison.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

The function obstack_printf() is not present on macOS,
so use the available gnulib module and their dependencies.

Many more modules from gnulib are now needed,
and some replacements of some functions must be skipped
to prevent build errors at link time.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt c16ed51e06 tools/elfutils: backport version 0.192 portability patches
These patches will be present in version 0.192 release.

Include them before the update
to support changes before updating
and in order to have a more organized git history.

Manually refreshed patch:
 - 110-objects-manifest.patch

Add patch:
 - 095-src-unused-variable.patch
 - 096-lib-config_h.patch
 - 097-libcpu-config_h.patch
 - 098-libdw-maintainer-clean.patch
 - 099-remove-unlocked-stdio.patch

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 8f920d2f94 tools/elfutils: replace dependency hack with upstream include path fix
In order to solve the problem of the possibility that
the "stack" binary is incorrectly included as a header
while the compiler looks for the standard C++ header "stack",
a workaround forcing a dependency between building "stack"
and the C++ program was introduced.

This upstream fix uses the compiler "-iquote" option
in order to avoid looking for standard headers
in the current working directory
and blocks the default inclusion of "-I ."
to the compiler flags.

The upstream fix happens to be incomplete,
so add an extra patch to fix an additional instance
and then remove the workaround.

Also, adjust the way DEFAULT_INCLUDES is overridden
in the build Makefile by using the "-iquote" option
in the same manner in order to remove all instances
of the default inclusion for the current directory.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 30105c77ef tools/automake: do not delete libtool in clean targets
For the building of some packages, it is helpful
to completely clean the packaged release copy of the source,
however this usually deletes libtool if used,
otherwise causing the need to run the bootstrap script twice.

Not deleting libtool allows compilation to continue directly
after cleaning pre-generated files in the package distribution.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 7a8fd73548 tools: require coreutils to build util-linux
The install stage of util-linux uses the install utility
with GNU options which is provided to macOS by coreutils.

Before, Make coincidentally built them in the right order,
this makes the prerequisite explicit.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 405652469f tools: require coreutils to build findutils
The install stage of findutils uses the install utility
with GNU options which is provided to macOS by coreutils.

Before, Make coincidentally built them in the right order,
this makes the prerequisite explicit.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt e776c9fe4e tools: require coreutils to build elfutils
The version of the rmdir utility in macOS is POSIX-only
while elfutils uses the GNU extended options while building.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt f7fd8303be tools: build coreutils for development targets
Include the coreutils utilities required for macOS
and other non-GNU friendly OSs to products like the SDK.

This also allows manually building coreutils on Linux
without having to manually edit this Makefile.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt f197b5827a prereq: prefer existing built coreutils as symlink target
For the utilities provided by coreutils
but required before coreutils is built,
if coreutils is actually built already, prefer a symlink to
the built versions instead of the host machine's version.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 660e398f92 prereq: add support for creating relative symlinks
For targets that install symlinks, like coreutils,
if the links happen to be deleted, let prereq stage
be capable of creating them again with a relative path.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 90262c6f6e tools/coreutils: provide the rmdir utility
Use the rmdir utility provided by GNU coreutils for macOS
in order to be able to use the option "--ignore-fail-on-non-empty".

Some other tools such as elfutils use this while building.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt b8c0ed4692 tools/coreutils: replace symlinks to build prerequisites
Before building, symlinks are made from existing utilities
on the host machine, because they are necessary before
coreutils can be built.

Instead of leaving these utilities as symlinks,
replace them with the copy provided by the coreutils build
in order to increase version control for these utilities
and to have a real copy for targets like the SDK.

The utilities required before building and provided by coreutils are
cp, install, realpath, seq, and stat.

Let all of the utilities be installed with the "g" prefix,
then, existing symlinks named without the "g" prefix are safely replaced
with a new symlink using the coreutils version of `ln` just built
in order to prevent an inconsistent state of the file
since these utilities must always be available.

While at it, sort the list alphabetically.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 5c832d7833 tools/coreutils: disable uninstall target
GNU coreutils is a unique case where we require
some of the utilities on the host machine
before anything is built.

The prerequisite is handled by symlinks to the host binaries
in the staging directory that are installed
by the build system and that are expected to remain
as long as the corresponding stampfile exists.

Because the binaries built by coreutils
will replace the symlinks, the uninstall target
will actually delete the symlinks
long before the build finishes whenever it is ran.

This can cause the utilities to be temporarily missing
from the controlled part of the shell's PATH,
so disable the removal of the coreutils utilities.
The appropriate way to clear all of the programs and links
would be `make dirclean`.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 6a3cfeb4a6 tools/coreutils: add maintainer-clean to clean target
Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Automake with modified rules must be ran
in order to generate a Makefile that does not delete itself.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

Redefine MAINTAINERCLEANFILES with Make functions
to avoid deleting the targets of gettext and gperf rules.

In order to prevent an inconsistent state of `install`
since this utility must always be available as a prerequisite,
do not allow it to be removed.

Instead of preventing the removal of the config.h header,
the Makefile supports regenerating it quickly.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 26f8a3874b tools/coreutils: use automake during bootstrap
This was previously not possible because
part of the source code for coreutils in the form of
extra gnulib modules was missing from the release distribution.

Now that the local modules from coreutils source
is included in coreutils releases,
the bootstrap script can be ran without skipping
automake in the autoreconf stage after importing modules
by using fake paths to each autotools program,
and instead use the real paths to our modified autotools.

Because we do not require tools for building documentation,
continue to fake the paths to autopoint and gtkdocize.

Remove the skipping of imports of some source files
which is no longer necessary.

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 199afe9ef7 tools/coreutils: update to 9.6
Update to the next stable release.

Prevent the need for gperf to build
gperf based headers due to new gnulib versions
by skipping replacement of gperf files.

Without Automake, there are some
existing macro conflicts
due to the new version of gnulib,
causing build errors with some source files,
so skip those file replacements.

All patches are automatically refreshed.

Link: https://lists.gnu.org/archive/html/coreutils/2025-01/msg00049.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 40c241d857 tools/coreutils: do not require gettext or gperf
The bootstrap configuration is set to require
gettext and gperf for regenerating documentation and headers.
However, these steps are skipped in favor
of not building documentation and using existing headers.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 6d2bfe50d3 tools/automake: control all cleaning with clean variables
Automake previously makes rules for the target maintainer-clean
to remove both the contents of MAINTAINERCLEANFILES and BUILT_SOURCES.

In order to have finer control over what is removed,
let there only be a rule for deleting MAINTAINERCLEANFILES,
and set MAINTAINERCLEANFILES to a default value of BUILT_SOURCES
if only conditional or missing, and append BUILT_SOURCES if user-defined.

In order to maintain conditional values for MAINTAINERCLEANFILES
while keeping a default value, change the behavior of automake
to output unconditional definitions before conditions.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt fddac9af6f tools/libtool: remove parallel building
There is only one subdirectory for libtool that actually compiles,
so enabling parallel building has no significant beneficial effects.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt c7554019dd tools/libtool: add maintainer-clean to clean target
Use the clean recipe during build, so that files already
generated by the bootstrapping within the release are removed
before the bootstrap script is run again.

Override an automake variable "am__CONFIG_DISTCLEAN_FILES"
and related variables for their dependencies
in order to prevent removing config.status and other configure files
so that configure stage does not need to be ran twice.

Automake with modified rules must be ran
in order to generate a Makefile that does not delete itself.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 9ea963e471 tools/automake: do not delete Makefile in clean targets
For the building of some packages, it is sometimes helpful
to completely clean the packaged release copy of the source,
however this usually both requires and deletes the Makefile,
causing the need to run the configure stage twice.

Not deleting the Makefile allows compilation to continue directly
after cleaning pre-generated files in the package distribution.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 222a1bed79 tools/gnulib: use git archive as download source
Snapshot downloads, whether from GNU cgit or GNU gitweb,
are becoming more unreliable and unstable.
Use the GNU gnulib git repository server for downloads
because GNU has disabled cgit server snapshots due to performance issues.

Other possible options include GNU gitweb snapshot or a git bundle download
but these methods either may also have similar performance issues
or require additions to the build system to handle the method
beyond the previous commit.

In case snapshots are to be used again for build tools in the future,
the previous commit reduces the tarball generation attempts
for the original source of snapshots in order to reduce server impact.

A conversation regarding server performance issues and alternatives is linked.

Link: https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00124.html
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 685fc753a7 download: add support for gitweb snapshots
When downloading a snapshot archive from gitweb,
the filename is not part of the URL,
and adding the filename to the URL causes errors.

The gitweb API exclusively uses query parameters
instead of paths in order to execute snapshot downloads.

Add a condition to the Perl download script
that removes the filename if the relevant
query parameter matches in the URL.

Also, to reduce server load of the original sources
try the Openwrt CDN servers first for these downloads.

Even though snapshot downloads are not ideal
due to the impact on the source's server health,
they are better for download performance than using git only.
Therefore, attempting it last will reduce the impact
and thus encourage maintainers to keep the option enabled.

This change is partly inspired by a conversation linked below
about snapshot downloads and server performance issues
which led to the feature being disabled for a particular server.

Link: https://lists.gnu.org/archive/html/bug-gnulib/2024-12/msg00124.html
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt 774ce21c66 tools/gnulib: use exact directory copy for install
The python implementation of gnulib-tool
uses a hidden file as the independent main function.

A copy with glob ('*') does not include hidden files
at the top level directory, so use whole directory copy
instead and remove the patch for a non-hidden python file.

Ensure the directory does not already exist
by attempting uninstall first to remove it
and by not using "install" to create a directory.

Rename the clean target to uninstall, as it handles
the staging directory and not the build directory.

Removed:
 - 021-python-main.patch

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:08 +02:00
Michael Pratt b07b8c8b43 tools/gnulib: update to branch stable-202407
Bump to the next stable branch with the May 2025 update.

Add a patch to compensate for gnulib-tool being further split up
into independent shell and python implementations
by using a non-hidden version of the main.py file.

Add a patch for the python implementation of gnulib-tool
in order to ignore the required version of autoconf in configure.ac
being lower than the required version of autoconf for gnulib
if the version that is being run exceeds the required version for both,
and adjust existing autoconf version shell script patch to new filename.

Backport a patch for a change in function naming convention
for forward compatibility with tool releases after this stable branch.

Added:
 - 020-python-version.patch
 - 021-python-main.patch
 - 500-acl-function-name.patch

Manually Adjusted:
 - 010-autoconf-version.patch
 - 160-flag-reallocarray.patch

Existing patches are automatically refreshed.

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 03b9b7e894 tools/automake: update to 1.17
Update to the latest stable release.

This is the automake API that newer packages
such as libtool 2.5.4 is bootstrapped with,
and is required for bootstrapping it again.

Manually Adjusted:
 - 000-relocatable.patch

All other patches are automatically refreshed.

Link: https://lists.gnu.org/archive/html/autotools-announce/2024-07/msg00000.html
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 793be94a3a tools/automake: hardcode portable location for Perl
The latest automake version 1.17 includes a restriction against whitespace
for the configure variable $PERL, which is set to "/usr/bin/env perl"
for portability reasons with products like the SDK.

Instead of waiting until the next version of automake is released
for this error to be converted to a warning,
set the shebang of automake and aclocal manually with a patch.

In past git history, these lines have been patched before,
but only to remove the "-w" flag in favor of setting global warnings
in the script itself so that env does not strip the option.

The other purposes of Perl during building can use
the static staging directory path without any limitations.

Also, the configure variable "am_cv_prog_PERL_ithreads"
for the detection of Perl threads support
has been removed since 2013 in favor of dynamic runtime detection.
Remove our manual setting of this variable value as it has no effect.

Ref: 1ef07eee4 ("automake: forcibly disable perl ithreads support")
Ref: 182626687 ("ithreads: use runtime (not configure time) detection of perl threads") # automake.git
Ref: f6c581cc3 ("automake: portability fixes")
Ref: 87f3365d9 ("Revert "tools/automake: bump to 1.17"")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 89056bd7b1 tools/util-linux: include macOS system uuid header
The type definition of uuid_string_t and possibly other details
used by macOS SDKs like XCode is missing from util-linux.

Headers on macOS have a different inclusion guard
compared to the unique util-linux "_UL" prefix.

This uuid.h header is guaranteed to be present since macOS 10.8 and iOS 6
even without the presence of XCode or other SDKs on the system,
so adding an include_next directive is safe after checking for clang.

Link: https://developer.apple.com/documentation/foundation/uuid
Link: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/uuid.3.html
Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 346872e720 tools/bc: let getopt() prototype be defined normally
Add a patch in order to remove an obsolete workaround
that is currently causing issues on some macOS systems.

Add patch:
 - 000-getopt-prototype.patch

Tested-by: Georgi Valkov <gvalkov@gmail.com> # macOS
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 46506776e6 tools/bc: override SUBDIRS variable with Makefile
Instead of editing the SUBDIRS variable with a patch,
it can be overriden at the end of the command line when invoking Make.

Also, remove use of autoreconf, as this patch
was the only one that made it necessary.

Removed:
 - 001-no_doc.patch

Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Michael Pratt 3e95b955fc tools/bc: remove useless patch
The remaining changes in this patch to the configure script
has no effect at all since autoreconf is used with bc
and the recent update to bc removed the need to patch
the original set of changes in order to fix building.

Remove the patch.

Removed:
 - 002-fix-libmath.patch

Fixes: abd424c3e ("tools/bc: update to 1.08.1")
Signed-off-by: Michael Pratt <mcpratt@pm.me>
Link: https://github.com/openwrt/openwrt/pull/16522
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 14:38:07 +02:00
Markus Stockhausen ded18a3683 realtek: dsa: enhance pcs_get_state() for RTL83xx
Currently the SerDes driven SFP ports give strange ethtool readings
on RTL83xx devices. Especially duplex and speed are shown even if
no link is up and running. That leads to confusion because the MAC
reports arbitrary values.

Enhance the readout by refactoring the pcs_get_state() function.
Calculate speed/duplex/pause only if link is detected. Additionally
add reporting of 10G for SFP+ on RTL839x.

ethtool for empty SFP cage before/after

root@OpenWrt:~# ethtool lan9
Settings for lan9:
        Supported ports: [ MII ]
        Supported link modes:   1000baseT/Full
                                1000baseKX/Full
                                1000baseX/Full
                                1000baseT1/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                1000baseKX/Full
                                1000baseX/Full
                                1000baseT1/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 10Mb/s
        Duplex: Half
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: no

root@OpenWrt:~# ethtool lan9
Settings for lan9:
        Supported ports: [ MII ]
        Supported link modes:   1000baseT/Full
                                1000baseKX/Full
                                1000baseX/Full
                                1000baseT1/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseT/Full
                                1000baseKX/Full
                                1000baseX/Full
                                1000baseT1/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: no

ethtool with inserted but NOT connected 1G module before/after

root@OpenWrt:~# ethtool lan9
Settings for lan9:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: no

root@OpenWrt:~# ethtool lan9
Settings for lan9:
        Supported ports: [ FIBRE ]
        Supported link modes:   1000baseX/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  1000baseX/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: FIBRE
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: d
        Wake-on: d
        Link detected: no

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19524
Signed-off-by: Robert Marko <robimarko@gmail.com>
2025-07-26 13:23:42 +02:00
Hauke Mehrtens 88c7803197 kernel: Reorder kernel configuration
This was done by running:
./scripts/kconfig-reorder.sh

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:21 +02:00
Hauke Mehrtens 3c246f6d03 x86: Activate CONFIG_DRM_ACCEL
This allows building the kmod-drm-ivpu which depends on
CONFIG_DRM_ACCEL. This module is x86_64 only.

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:21 +02:00
Hauke Mehrtens 27643ebfa9 bcm27xx: Make kernel modules depend on target
The kmod-rpi-panel-attiny-regulator and kmod-rpi-panel-7inch-touchscreen
are included in target modules.mk file, they should also depend on the target,
otherwise they can be selected from every target.

Fix the AutoProbe for panel-raspberrypi-touchscreen too.

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:21 +02:00
Hauke Mehrtens da0736c16f armsr: Make kernel modules depend on target
The kmod-imx2-wdt, kmod-imx7-ulp-wdt and kmod-wdt-sp805 are included in
target modules.mk file, they should also depend on the target, otherwise
they can be selected from every target.

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:21 +02:00
Hauke Mehrtens e9ae1f678c apm821xx: kmod-ata-dwc: Make kernel module depend on target
The kmod-ata-dwc is included in target modules.mk file, it should also
depend on the target, otherwise it can be selected from every target.

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:21 +02:00
Hauke Mehrtens 6ff85791c5 kernel: kmod-fs-nfs-v4: Package nfs_layout*.ko files
The nfs_layout_flexfiles.ko and nfs_layout_nfsv41_files.ko file are
build automatically when CONFIG_NFS_V4_1 is selected, we can not
deactivate them. Pack them into the NFS package too. I do not know if we
should also load them automatically.

Link: https://github.com/openwrt/openwrt/pull/19480
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2025-07-26 01:11:20 +02:00