openwrt/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 treewide: strip trailing whitespace 2025-05-20 00:47:37 +02:00
flashing
belkin-header.py realtek: scripts: fix error in belkin-header 2024-10-11 23:37:09 +02:00
brcmImage.pl
bundle-libraries.sh
cameo-imghdr.py scripts: add cameo image header generator 2022-06-28 22:20:09 +02:00
cameo-tag.py scripts: fix CAMEO tag generator 2022-07-05 10:18:06 +02:00
cfe-bin-header.py
cfe-partition-tag.py scripts: format to black 2022-04-16 14:53:17 +02:00
cfe-wfi-tag.py scripts: format to black 2022-04-16 14:53:17 +02:00
check-toolchain-clean.sh check-toolchain-clean.sh: workaround stray rebuilds 2022-02-28 15:17:11 +01:00
checkpatch.pl
clean-package.sh
cleanfile
cleanpatch
combined-ext-image.sh
combined-image.sh
command_all.sh
config.guess scripts: config.guess: update to 2024-07-27 2024-09-28 22:48:47 +02:00
config.rpath
config.sub scripts: config.guess: update to 2024-07-27 2024-09-28 22:48:47 +02:00
const_structs.checkpatch
deptest.sh
diffconfig.sh scripts/diffconfig.sh: ensure config/conf is built 2022-02-26 13:36:30 +01:00
dl_cleanup.py scripts: add .tar.zst to dl_cleanup extensions 2024-04-06 17:07:32 +03:00
dl_github_archive.py scripts/dl_github_archive: use tar -I for ZSTD 2024-04-09 18:39:36 +02:00
download-check-artifact.sh scripts: download-check-artifact.sh: fix shellcheck and improve 2024-11-13 20:26:46 +00:00
download.pl download: add support for gitweb snapshots 2025-07-26 14:38:08 +02:00
dump-target-info.pl scripts/dump-target-info.pl: add new function to DUMP devices 2023-11-15 10:59:23 +01:00
env
ext-toolchain.sh scripts/ext-toolchain: adjust with recent glibc 2025-07-12 23:38:19 +02:00
ext-tools.sh scripts: ext-tools: add option to only refresh timestamps 2023-01-23 19:18:05 +01:00
feeds scripts/feeds: implement support for --root option 2025-10-13 11:47:07 +02:00
fixup-makefile.pl
functions.sh
gen-dependencies.sh
gen_image_generic.sh scripts: gen_image_generic: allow the partition types to be set 2023-06-02 11:36:13 +02:00
get_source_date_epoch.sh build: add explicit --no-show-signature for git 2024-02-20 20:57:53 +01:00
getver.sh build: parsing "git log" breaks with gpg signature verification 2025-09-23 21:49:54 +02:00
ipkg-build scripts: fix installed-size calculation 2024-01-08 14:08:06 +01:00
ipkg-make-index.sh Revert "scripts: run ipkg-make-index through shellcheck" 2023-05-09 21:32:26 +02:00
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 build: include size-limits to device-metadata 2025-04-18 14:00:39 +02:00
json_overview_image_info.py build: profiles.json: add kernel version information 2024-11-26 22:47:00 +00:00
kconfig-reorder.sh scripts: Add script to reorder kernel config-* files 2024-10-22 21:13:26 +02:00
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 scripts: linksys-image: add NAND devices 2024-10-22 10:10:17 +02:00
make-index-json.py imagebuilder: implement STRIP_ABI option for manifest target 2025-07-03 12:45:59 +02:00
make-ipkg-dir.sh
md5sum
metadata.pm target/metadata: set OpenWrt One as the default menuconfig target/profile 2024-12-02 13:55:36 +01:00
mkhash.c mkhash: fix build errors on FreeBSD 13.0 2022-03-05 18:01:04 +01:00
mkits-qsdk-ipq-image.sh qualcommax: ipq50xx: add support for GL.iNET GL-B3000 2025-04-20 16:11:29 +02:00
mkits-zyxel-fit-filogic.sh mediatek: add support for ZyXEL NWA50AX Pro 2023-07-21 20:28:13 +02:00
mkits-zyxel-fit.sh ramips: add support for ZyXEL NWA50AX / NWA55AXE 2022-07-20 21:52:06 +02:00
mkits.sh scripts/mkits.sh: DT overlays don't need a loadaddr 2023-07-12 19:02:08 +01:00
moxa-encode-fw.py ath79: Add support for MOXA AWK-1137C 2023-06-25 12:59:26 +02:00
nand-fwupgradecfg-gen.sh ramips: add support for Plasma Cloud PAX1800-Lite 2025-10-04 20:30:36 +02:00
netgear-encrypted-factory.py image: add additional fields to Netgear encrypted image 2023-07-01 14:42:11 +02:00
noop.sh build: replace `true` with a custom noop script 2023-11-03 23:06:07 +01:00
om-fwupgradecfg-gen.sh
package-metadata.pl build: add explicit timezone in CycloneDX SBOM 2024-06-07 12:05:49 +02:00
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 scripts: qemustart: Fix x86/legacy bootup 2023-08-14 23:37:04 +02:00
redboot-script.pl
relink-lib.sh
remote-gdb
rstrip.sh scripts/rstrip.sh: ignore /lib/firmware 2024-01-22 13:01:31 +01:00
sercomm-crypto.py
sercomm-kernel-header.py scripts: sercomm-kernel-header.py: improve compatibility 2023-06-11 13:36:38 +08:00
sercomm-partition-tag.py
sercomm-payload.py scripts: sercomm-payload: add PID file support 2023-04-09 09:55:57 +02:00
sercomm-pid.py scripts: sercomm-pid.py: use uppercase hwid in pid 2023-11-25 01:11:18 +01:00
sign_images.sh
size_compare.sh scripts: size_compare: print a grand total 2023-02-03 21:22:49 +01:00
slugimage.pl
spelling.txt
srecimage.pl
strip-kmod.sh
symlink-tree.sh
sysupgrade-tar.sh build: add dtb support for sysupgrade-tar 2025-06-22 22:17:20 +02:00
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 qualcommax: ipq807x: Create working factory images for EAP620 HD v1 and EAP660 HD v1 2025-03-27 17:42:04 +01:00
ubinize-image.sh scripts: ubinize-image.sh: fix support for static volume 2024-04-24 02:32:22 +01:00
xxdi.pl scripts: xxdi.pl: add xxd -i compat mode 2022-09-06 08:04:53 +02:00