openwrt-6.x/scripts
Christian Marangi e112fd8e59
scripts/feeds: implement support for --root option
Some feeds might need to set the source for their packages in a
different directory than the cloned one.

For example a feed "test" might be an entire repository and the relevant
packages that wants to be included are in the directory "foo".

In such scenario the source info in the package will result in something
like "feeds/test/foo/network/dnsmasq" instead of an expected entry like
"feeds/test/network/dnsmasq".

To give a more real-world example, this problem is currently present
with OpenWrt SDK where the SDK clone the entire OpenWrt core repository
as "base" feeds but the package are present in the "package" directory.

This cause every package to have the source entry set to
"feeds/base/package/..." conflicting with what a non-SDK build do with
setting the source entry to "feeds/base/..."

To solve this, actually enable support for "flags" in the feeds script
and implement a new option "--root" to set the root directory for the
defined feed to an inner directory.

The "flags" in the feed script are no more than argument option that can
be defined right after the "src-" type in the feed.conf file.

This feature was partially implemented but never actually used for
anything keeping it dormant with all the core piece there (the pattern
regex always accounted for these extra option but they were never passed
to the relevant functions)

An example of the "--root" flag is the following:

src-git --root=package base https://git.openwrt.org/openwrt/openwrt.git;main

With "--root" defined, the script will append "_root" to the feed name
clone directory and will create a symbolic link named with the feed name
and pointing to the feed name clone directory + the value in root.

From the previous example:

feed name: base -> clone directory: base_root
symbolic link: base -> base_root/package

The script internally reference the "_root" directory for every update
operation and OpenWrt build system transparently use the feed name
directory to reference feed packages producing consistent source info
entry.

Link: https://github.com/openwrt/openwrt/pull/20396
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2025-10-13 11:47:07 +02:00
..
config
flashing
belkin-header.py
brcmImage.pl
bundle-libraries.sh
cameo-imghdr.py
cameo-tag.py
cfe-bin-header.py
cfe-partition-tag.py
cfe-wfi-tag.py
check-toolchain-clean.sh
checkpatch.pl
clean-package.sh
cleanfile
cleanpatch
combined-ext-image.sh
combined-image.sh
command_all.sh
config.guess
config.rpath
config.sub
const_structs.checkpatch
deptest.sh
diffconfig.sh
dl_cleanup.py
dl_github_archive.py
download-check-artifact.sh
download.pl download: add support for gitweb snapshots 2025-07-26 14:38:08 +02:00
dump-target-info.pl
env
ext-toolchain.sh scripts/ext-toolchain: adjust with recent glibc 2025-07-12 23:38:19 +02:00
ext-tools.sh
feeds scripts/feeds: implement support for --root option 2025-10-13 11:47:07 +02:00
fixup-makefile.pl
functions.sh
gen_image_generic.sh
gen-dependencies.sh
get_source_date_epoch.sh
getver.sh build: parsing "git log" breaks with gpg signature verification 2025-09-23 21:49:54 +02:00
ipkg-build
ipkg-make-index.sh
ipkg-remove build: fix ipkg-remove: add support for removing apk files 2025-07-15 20:48:45 +02:00
json_add_image_info.py
json_overview_image_info.py
kconfig-reorder.sh
kconfig.pl
kernel_bump.sh Note inspiration for this script to give credit where it's due 2025-07-21 16:17:29 +01:00
linksys-image.sh
make-index-json.py
make-ipkg-dir.sh
md5sum
metadata.pm
mkhash.c
mkits-qsdk-ipq-image.sh
mkits-zyxel-fit-filogic.sh
mkits-zyxel-fit.sh
mkits.sh
moxa-encode-fw.py
nand-fwupgradecfg-gen.sh ramips: add support for Plasma Cloud PAX1800-Lite 2025-10-04 20:30:36 +02:00
netgear-encrypted-factory.py
noop.sh
om-fwupgradecfg-gen.sh
package-metadata.pl
pad_image
patch-kernel.sh scripts/patch-kernel.sh: do not try to check files after patch 2025-09-29 13:33:07 +02:00
patch-specs.sh
portable_date.sh
projectsmirrors.json projectsmirrors: remove kernel mirror ftp.riken.jp 2025-07-26 01:05:44 +02:00
qemustart
redboot-script.pl
relink-lib.sh
remote-gdb
rstrip.sh
sercomm-crypto.py
sercomm-kernel-header.py
sercomm-partition-tag.py
sercomm-payload.py
sercomm-pid.py
sign_images.sh
size_compare.sh
slugimage.pl
spelling.txt
srecimage.pl
strip-kmod.sh
symlink-tree.sh
sysupgrade-tar.sh
target-metadata.pl targets: add USES_PM auto-feature 2025-07-20 12:16:13 +01:00
time.pl
timestamp.pl
tplink-mkimage-2022.py
ubinize-image.sh
xxdi.pl