build: handle --root feeds script feature
authorChristian Marangi <[email protected]>
Sun, 19 Oct 2025 18:43:09 +0000 (20:43 +0200)
committerChristian Marangi <[email protected]>
Mon, 20 Oct 2025 11:50:15 +0000 (13:50 +0200)
commit330d17f52d3cbe50802101966368c45e1d822453
treea9e8e4db8418d4299ebc30aedc632f4d36318923
parentb91b99ec18504e766d4a341f572435f7621dbb40
build: handle --root feeds script feature

Rework the package SOURCE entry handling to account for the --root feeds
script feature.

Move the SOURCE entry string manipulation logic outside package-defaults.mk
in package.mk and limit only to non DUMP scenario to not pollute the .mk
too much.

Restructure the previous logic and add a new additional condition.
If we detect the package comes from a feed, replace any feed path that
have the _root prefix to the feed name with the non-root variant (the
feeds script create a symbolic link to it) and point the package SOURCE
entry to what the symbolic link points to.

Example:
Feed link: feeds/base_root/package -> feeds/base
Package: feeds/base_root/package/system/uci -> feeds/base/system/uci

Link: https://github.com/openwrt/openwrt/pull/20459
Signed-off-by: Christian Marangi <[email protected]>
include/package-defaults.mk
include/package.mk