154 Commits

Author SHA1 Message Date
Tianling Shen
db35b0ef9f
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-06-21 02:27:01 +08:00
Christian Marangi
3b83d393dd
scripts/download.pl: fix broken link for KERNEL projects
Fix broken link generation for KERNEL projects.

Using $1 in projectsmirrors sub was still referencing the caller $1
instead of the remaining args of projectsmirrors sub.

Use shift and put the second arg of projectsmirrors sub in $append to
correctly handle the sub args.

Fixes: 465cf358881c ("scripts/download.pl: detach mirror URLs from script file")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-19 14:30:06 +02:00
Christian Marangi
465cf35888
scripts/download.pl: detach mirror URLs from script file
Detach URL from download script to make it easier to change and update
the URLs.

The mirror list is moved to a JSON file in the scripts directory called
projectsmirrors.json.

Link: https://github.com/openwrt/openwrt/pull/15745
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2024-06-18 19:51:45 +02:00
Tianling Shen
9968354df0
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-05-30 14:41:34 +08:00
Sahil Dhiman
6510eb3b5d scripts: Add GNU ftp mirror redirector for GNU and Savannah
Add GNU's redirector which automatically redirect user to nearby online
mirror.

Signed-off-by: Sahil Dhiman <sahil@hopbox.in>
Link: https://github.com/openwrt/openwrt/pull/15557
Signed-off-by: Robert Marko <robimarko@gmail.com>
2024-05-29 11:19:08 +02:00
Tianling Shen
7b72cd5093
scripts/download.pl: remove deprecated onedrive mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2024-03-30 21:15:06 +08:00
Tianling Shen
3ea268343a
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-16 21:52:11 +08:00
Hannu Nyman
e39fd02347
scripts/download.pl: Remove stale download sites and convert to https
Remove the stale site definitions from @APACHE, KERNEL etc.

* Remove site that had dropped APACHE
* Remove KERNEL site leading to wrong directory
* Remove dead sites
* Convert ftp/http URLs to https, if possible. Remove duplicate

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2023-09-16 12:10:22 +02:00
Tianling Shen
b822e2dc62
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-09-02 08:43:34 +08:00
Hannu Nyman
402212c3b0 scripts/download.pl: remove stale GNOME download sites
Remove stale sites from @GNOME alias:
* remove 2 sites that have stale 3 years old content
* remove 2 sites that have dropped GNOME
* convert 2 sites from FTP to HTTP

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2023-09-01 23:09:43 +02:00
Tianling Shen
a32e32a1e3
download.pl: remove duplicate mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-08-15 15:28:38 +08:00
Tianling Shen
3ddf2d6612
download.pl: update cdn domain
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-03-15 17:44:32 +08:00
Tianling Shen
8190433295
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2023-01-07 16:43:13 +08:00
David Bauer
9ac377d0e0 scripts: add Apache fastly mirror
Add the Apache fastly mirror as preferred download source.
This service is using a dual-stacked CDN.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-01-07 01:32:58 +01:00
Tianling Shen
9b3db09fe3
download.pl: fix typo error
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-12-11 22:37:35 +08:00
Tianling Shen
3d37d7b1c0
scripts/download.pl: update mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-12-11 13:44:25 +08:00
Tianling Shen
4fb0bd80d5
Revert "download.pl: remove broken mirror"
mirror2 now points to mirrors.gigenet.com.

This reverts commit 9fbf1751eced799a4320fed8095b78fbde2d5116.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-12-11 12:51:49 +08:00
Tianling Shen
d6b6dbf9e1
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-10-21 15:59:03 +08:00
Zhang Hua
a53f29b583
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>
2022-10-20 20:38:31 +02:00
Christian Marangi
f17608ddca
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>
2022-10-20 00:35:19 +02:00
Tianling Shen
9d6e3e6c02
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-10-08 14:46:37 +08:00
Bradford Zhang
e937663025
scripts/download.pl: add tsinghua and ustc mirrors
Add https://mirrors.tuna.tsinghua.edu.cn/ and https://mirrors.ustc.edu.cn/ mirrors into download.pl to speed up download in China.

Signed-off-by: Bradford Zhang <zyc@zyc.name>
2022-09-30 14:57:19 +02:00
Christian Marangi
261925a869
scripts/download.pl: generilize and simplify download tool check
Generilize download tool check and skip other check if a download tool
has been found.
While at it also reintroduce c836ca84e8f641e10a8349a8f9b7432b33d6cec1
that was previously dropped with aria2c support.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-28 16:55:10 +02:00
Tianling Shen
81f9f50fa4
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-09-27 17:06:04 +08:00
Christian Marangi
f1b3958d02
scripts/download.pl: fix support for aria2c download tool on macos
Currently we use /dev/shm to place aria2c tmp file. This is not present
on macos. Use the openwrt tmp directory instead of the linux-only
/dev/shm to save compatibility with more os.

Fixes: d39123626931 ("download.pl: add aria2c support")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-26 20:50:10 +02:00
Christian Marangi
5df60f5c24
scripts/download.pl: fix mirrors regression for curl and wget
With the introduction of aria2c support, curl and wget no longer try to
download the file from mirrors. Fix this regression by emptying the
remaining mirrors list only when aria2c is used.

Fixes: d39123626931 ("download.pl: add aria2c support")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-26 20:50:09 +02:00
Christian Marangi
295e0ed7a9
scripts/download.pl: fix whitespace in mirror urls and drop for
Fix whitespace in mirror urls and replace for loop with join+map logic.

Fixes: d39123626931 ("download.pl: add aria2c support")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-25 15:54:12 +02:00
Bradford Zhang
d391236269
download.pl: add aria2c support
Use aria2c download tool by default on package download if available in
the system.
aria2c permits to use multiple mirrors and may improve download speed on
special context where servers are hard to reach.

Co-authored-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Bradford Zhang <zyc@zyc.name>
[ fix wrong var in the script and improve commit description ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-25 14:56:45 +02:00
Tianling Shen
165b0899d4
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-09-16 15:32:20 +08:00
Petr Štetiar
50a48faa1b scripts/download.pl: fix downloads with wget
Several users of wget for downloads (curl is not available in the
system) have reported broken download functionality:

 wget --tries=5 --timeout=20 --output-document=-  https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.142.tar.xz
 http://: Invalid host name.

Thats all happening due to '' was passed as an argument, which got later
expanded to http://.

In the context of a list constructor '' is not nothing, it is an empty
string element.  So fix it by using () as it will yield "nothing" and
thus not introduce an empty string element.

Fixes: #10692
Fixes: 90c6e3aedf16 ("scripts: always check certificates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io> [shellwords() -> ()]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-09-13 09:14:09 +02:00
Petr Štetiar
c836ca84e8 scripts/download.pl: silence can't exec curl warning
When running build in verbose mode `make V=s` we can see a lot of
following warnings when curl is not available in the system:

 Can't exec "curl": No such file or directory at scripts/download.pl line 77.

So lets fix it by redirecting of the stderr to null hole.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
2022-09-13 09:14:09 +02:00
Josh Roys
90c6e3aedf
scripts: always check certificates
Remove flags from wget and curl instructing them to ignore bad server
certificates. Although other mechanisms can protect against malicious
modifications of downloads, other vectors of attack may be available
to an adversary.

TLS certificate verification can be disabled by turning oof the
"Enable TLS certificate verification during package download" option
enabled by default in the "Global build settings" in "make menuconfig"

Signed-off-by: Josh Roys <roysjosh@gmail.com>
[ add additional info on how to disable this option ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2022-09-10 15:24:22 +02:00
Tianling Shen
9fbf1751ec
download.pl: remove broken mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-08-06 18:49:52 +08:00
Tianling Shen
a190804949
download.pl: add ImmortalWrt fallback
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-07-12 15:29:29 +08:00
Tianling Shen
02edeb1469
scripts/download.pl: drop broken mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-05-06 22:10:58 +08:00
Tianling Shen
0ea2f57158
scripts/download.pl: add CN mirrors for DEBIAN
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-04-13 03:34:03 +08:00
Tianling Shen
7807fb0119
scripts/download.pl: drop cqu mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-03-17 19:59:49 +08:00
Tianling Shen
4ca3aeca5b
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-03-13 13:44:48 +08:00
Rui Salvaterra
6b822189b1 toolchain: binutils: add support for version 2.38
While at it, also fix the download.xs4all.nl and add ftp.gnu.org to the GNU
mirrors, as it seems to be updated faster.

Deleted (upstreamed):
600-Close_the_file_descriptor.patch [1]

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=5a98fb7513b559e20dfebdbaa2a471afda3b4742

Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com>
2022-03-09 10:23:25 +00:00
Tianling Shen
5b8437bf43
Merge Official Source
Keep iptables for now.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2022-01-24 19:03:56 +08:00
Ansuel Smith
88204bfa82 treewide: drop use of which
Ubuntu started to flag which as deprecated and it
seems which is not really standard and may vary
across Distro.
Drop the use of which and use the standard 'command -v'
for this simple task.
Which is still present in the prereq if some package/script
still use which.
A utility script called command_all.sh is implemented that
will just mimic the output of which -a.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
2022-01-17 09:14:26 +01:00
Tianling Shen
13c56d272d
scripts/download.pl: add new mirror
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-11-30 20:14:11 +08:00
Tianling Shen
9401c4c042
scripts/download.pl: tweak default mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-11-29 13:24:32 +08:00
Tianling Shen
d26b4ff4de
scripts/download.pl: reorder self-hosted mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-11-27 03:09:47 +08:00
Tianling Shen
30da20e2c5
scripts/download.pl: add immortalwrt's mirrors
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-11-21 01:08:19 +08:00
SuLingGG
009c172171
scripts/download.pl: update openwrt.cc mirror url
[updated url]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-08-30 23:06:44 +08:00
Tianling Shen
7679fe4f88
download.pl: add some mirrors disabled by default
To avoid abuse, these mirrors will not be used until you enable them
manually.

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit a3325e5051307bb92c2c3feaf44b0980421eb98c)
2021-07-15 22:38:30 +08:00
Tianling Shen
e821c29ca7
scripts/download: update mirror url
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-05-26 22:18:37 +08:00
Tianling Shen
bb56c18f7c
Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
2021-05-13 22:39:57 +08:00
Leonardo Mörlein
b993b68b6c build: introduce $(MKHASH)
Before this commit, it was assumed that mkhash is in the PATH. While
this was fine for the normal build workflow, this led to some issues if

    make TOPDIR="$(pwd)" -C "$pkgdir" compile

was called manually. In most of the cases, I just saw warnings like this:

    make: Entering directory '/home/.../package/gluon-status-page'
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    bash: line 1: mkhash: command not found
    [...]

While these were only warnings and the package still compiled sucessfully,
I also observed that some package even fail to build because of this.

After applying this commit, the variable $(MKHASH) is introduced. This
variable points to $(STAGING_DIR_HOST)/bin/mkhash, which is always the
correct path.

Signed-off-by: Leonardo Mörlein <me@irrelefant.net>
2021-05-13 15:13:15 +02:00