lede/scripts
Albert Xu 6c4e5d7b47
scripts/download.pl: Make the download tool configurable (#10291)
* rules.mk: Move DOWNLOAD_CHECK_CERTIFICATE to include/download.mk

Move DOWNLOAD_CHECK_CERTIFICATE to include/download.mk as it's a better
place than exporting it in the global rules.mk makefile.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

* scripts/download.pl: Make the download tool configurable

Introduce a new option in the "Advanced configuration options" to
configure a custom download tool.

By declaring a string in "Use custom download tool" an user can force
what command to use to download package. With the string empty the
default tool used is curl, with wget as a fallback if not available.

download.pl supports 3 tools officially aria2c, curl and wget.
If one of the tool is used in this config, download.pl will use the
default args to make use of them.

If the provided string is different than aria2c, curl or wget, the command
is used as is and the download url will be appended at the end of such command.

While at it also tweak the tool selection logic and chose the tool only
once when the script is called and move aria2c specific variables in the
relevant section.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>

* scripts/download.pl: Pass aria2 config in ENV only

The aria2c command tries to load config from
${XDG_CONFIG_HOME:-${HOME}/.config}/aria2/aria2.conf by default,
which may result unexpected behavior.

As a replacement, people can use environment variable ARIA2C_OPTIONS
to custom arguments passed to aria2c like curl and wget below.
Including --conf-path=/path/to/config.conf in ARIA2C_OPTIONS can
also set a custom config file path easily if needed.

Signed-off-by: Zhang Hua <zhanghuadedn@gmail.com>

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Zhang Hua <zhanghuadedn@gmail.com>
Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Co-authored-by: Zhang Hua <zhanghuadedn@gmail.com>
2022-10-21 12:47:28 +08:00
..
config scripts: sync with upstream 2022-10-19 20:39:19 +08:00
flashing scripts: sync with upstream 2022-10-19 20:39:19 +08:00
arm-magic.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
brcmImage.pl Merge branch 'master' of https://github.com/lede-project/source 2018-01-09 14:38:15 +08:00
bundle-libraries.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
cameo-imghdr.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
cameo-tag.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
cfe-bin-header.py Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
cfe-partition-tag.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
cfe-wfi-tag.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
check-toolchain-clean.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
checkpatch.pl scripts: sync with upstream 2022-10-19 20:39:19 +08:00
clean-package.sh x64: fix grub2 booting 2021-06-15 17:58:07 +08:00
cleanfile update source 2017-09-06 19:19:45 +08:00
cleanpatch update source 2017-09-06 19:19:45 +08:00
combined-ext-image.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
combined-image.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
command_all.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
config.guess add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
config.rpath update source 2017-09-06 19:19:45 +08:00
config.sub add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
const_structs.checkpatch add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
deptest.sh update source 2017-09-06 19:19:45 +08:00
diffconfig.sh scripts/diffconfig.sh: ensure config/conf is built 2022-02-26 16:06:10 +00:00
dl_cleanup.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
dl_github_archive.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
download.pl scripts/download.pl: Make the download tool configurable (#10291) 2022-10-21 12:47:28 +08:00
dump-target-info.pl scripts: sync with upstream 2022-10-19 20:39:19 +08:00
env scripts: sync with upstream 2022-10-19 20:39:19 +08:00
ext-toolchain.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
ext-tools.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
feeds scripts: sync with upstream 2022-10-19 20:39:19 +08:00
fixup-makefile.pl sync with OpenWrt trunk 2018-09-07 13:43:55 +08:00
functions.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
gen_image_generic.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
gen-dependencies.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
get_source_date_epoch.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
getver.sh kernel: bump 5.4 to 5.4.125 2021-06-15 18:06:21 +08:00
ipkg-build scripts: sync with upstream 2022-10-19 20:39:19 +08:00
ipkg-make-index.sh add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
ipkg-remove sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
json_add_image_info.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
json_overview_image_info.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
kconfig.pl add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
linksys-image.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
make-ipkg-dir.sh update source 2017-09-06 19:19:45 +08:00
md5sum update source 2017-09-06 19:19:45 +08:00
metadata.pm scripts: sync with upstream 2022-10-19 20:39:19 +08:00
mkhash.c scripts: sync with upstream 2022-10-19 20:39:19 +08:00
mkits-qsdk-ipq-image.sh ipq40xx: add G-DOCK 2.0 (P&W R619AC) support 2019-10-22 23:14:35 -07:00
mkits-zyxel-fit.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
mkits.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
netgear-encrypted-factory.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
om-fwupgradecfg-gen.sh x64: fix grub2 booting 2021-06-15 17:58:07 +08:00
package-metadata.pl scripts: sync with upstream 2022-10-19 20:39:19 +08:00
pad_image scripts: sync with upstream 2022-10-19 20:39:19 +08:00
patch-kernel.sh update source 2017-09-06 19:19:45 +08:00
patch-specs.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
portable_date.sh update source 2017-09-06 19:19:45 +08:00
qemustart x64: fix grub2 booting 2021-06-15 17:58:07 +08:00
redboot-script.pl update source 2017-09-06 19:19:45 +08:00
relink-lib.sh update source 2017-09-06 19:19:45 +08:00
remote-gdb sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
rstrip.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
sercomm-crypto.py Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
sercomm-kernel-header.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
sercomm-partition-tag.py Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
sercomm-payload.py Sync to snapshot kernel 5.4 version 2020-07-02 23:30:56 +08:00
sercomm-pid.py scripts: sync with upstream 2022-10-19 20:39:19 +08:00
sign_images.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
size_compare.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
slugimage.pl scripts: sync with upstream 2022-10-19 20:39:19 +08:00
spelling.txt add kernel 5.10 support and sync with upstream 2021-06-14 18:30:08 +08:00
srecimage.pl update source 2017-09-06 19:19:45 +08:00
strip-kmod.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
symlink-tree.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
sysupgrade-tar.sh sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
target-metadata.pl build: switch default target to x64 2022-10-19 20:42:58 +08:00
time.pl sync build script for OpenWrt 19.07 2020-02-21 02:41:00 +08:00
timestamp.pl update source 2017-09-06 19:19:45 +08:00
ubinize-image.sh scripts: sync with upstream 2022-10-19 20:39:19 +08:00
xxdi.pl scripts: xxdi.pl: add xxd -i compat mode 2022-09-13 00:07:13 +08:00