Go to file
Yann E. MORIN 9b6804f5b8 package/pkg-generic: explicitly do not download package without source
Recent commit f0c7cb01a9 (package/pkg-download: do not try to vendor
_EXTRA_DOWNLOADS) got last-minute changes when applied, which changed
the expected behaviour for packages that do not have a main download.

Before f0c7cb01a9, the dl-wrapper would not even be called for those
packages, and the original patch that was sent also avoided downloading
such packages, but f0c7cb01a9 now causes the dl-wrapper to be called.

It is however an accident that the dl-wrapper does not fail. Indeed, it
is expected to fail if no download was successful; we pass no URI, so
the dl-wrapper should have failed, as it basically does:

    download_and_check=0
    for uri in "${uris[@]}"; do
        ...
    done
    if [ "${download_and_check}" -eq 0 ]; then
        exit 1
    fi

However, it does not even go that far...

Even though there is no output file, we still pass the path to the
package output directory as the output path. So, to avoid downloading
files already present, the wrapper checks if the output file exists,
and checks its hash:

    if [ -e "${output}" ]; then
        if support/download/check-hash ${quiet} "${hfile}" "${output}" ...
            exit 0
        ...
    fi

The output path does exist now, because we explicitly create it just
before calling the wrapper, because that's where we also locate the
lockfile.

So it ends up trying to validate the hash of a directory, but it fails
to, as there is indeed no hash file for that package. And a missing hash
file is just a warning, not an error, which makes the download actually
a success...

So, this is currently working, and this is by pure luck.

However, there is a potential issue: if a target package is a virtual
package, but the host package is a real package, e.g. the same foo.mk
does (or the other way around):

    HOST_FOO_VERSION = 1.2.3
    HOST_FOO_SITE = http://example.net/
    $(eval $(virtual-package))
    $(eval $(host-generic-package))

If there is a hash file to validate the host download, then the current
situation will cause a failure, because there would be a hash file, but
no hash for the output path of the target variant, which would then be
a hard-error.

So, revert to the behaviour from before f0c7cb01a9, where no download
is attempted for a package without a source (really, without a main
download, now).

Signed-off-by: Yann E. MORIN <yann.morin@orange.com>
Cc: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
(cherry picked from commit d95a6dac31)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2022-05-28 21:33:36 +02:00
arch arch/Config.in.sh: move BR2_ARCH_HAS_MMU_MANDATORY one level up 2022-05-26 11:19:34 +02:00
board configs/zynqmp_zcu106_defconfig: uboot dp pll patch 2022-05-28 11:09:18 +02:00
boot boot/shim: big endian arm/aarch64 variants are not supported 2022-05-28 11:14:03 +02:00
configs configs/zynqmp_zcu106_defconfig: uboot dp pll patch 2022-05-28 11:09:18 +02:00
docs docs/manual: Remove link to emdebian and replace with debian port page 2022-03-20 22:25:45 +01:00
fs fs/oci: depends on BR2_PACKAGE_HOST_GO_TARGET_ARCH_SUPPORTS 2022-04-09 12:48:32 +02:00
linux linux: Fix powerpc64le defconfig selection 2022-05-28 21:24:46 +02:00
package package/pkg-generic: explicitly do not download package without source 2022-05-28 21:33:36 +02:00
support support/testing: test_lxc: bump kernel version to 5.15.38 for complete pidfds support 2022-05-28 13:00:36 +02:00
system system/skeleton: provide run/lock directory 2022-01-12 20:38:09 +01:00
toolchain Revert "toolchain/toolchain-external: error if BR2_TOOLCHAIN_EXTERNAL_PATH is not set" 2022-05-27 21:02:09 +02:00
utils arch: drop support for SH2A 2022-05-26 11:19:03 +02:00
.clang-format .clang-format: initial import from Linux 5.15.6 2022-01-01 15:01:13 +01:00
.defconfig
.flake8 Revert ".flake8: fix check for 80/132 columns" 2021-01-02 17:38:20 +01:00
.gitignore
.gitlab-ci.yml utils/checkpackagelib/lib_sysv: run shellcheck 2022-02-06 18:27:03 +01:00
CHANGES Update for 2022.02.1 2022-04-11 23:49:53 +02:00
Config.in support/download: Add SFTP support 2022-01-06 09:34:05 +01:00
Config.in.legacy package/libcurl: bump version to 7.82.0 2022-05-27 21:03:53 +02:00
COPYING
DEVELOPERS DEVELOPERS: add Dario Binacchi for libmnl 2022-05-27 21:07:26 +02:00
Makefile Update for 2022.02.1 2022-04-11 23:49:53 +02:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README docs: move the IRC channel away from Freenode 2021-05-29 22:16:23 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches