Go to file
Thomas De Schampheleire 448d1d1e69 pkg-download: use raw basename for repo archiving to remove host- prefix
For packages that use a version control repository rather than a pre-made
tarball, the directory prefix used inside the tarball is currently
FOO_BASE_NAME, which can be 'foo' or 'host-foo'.

This means that the hash of such tarball will be different for target and
host packages, even though the contents are exactly the same. Hence, if the
hash file is created based on 'foo', and later a fresh build is made where
'host-foo' happens to be built before 'foo' (with a different config, for
example), the hash will be detected as incorrect and a new download is
started.

This problem does not affect many packages/users, due to the number of
conditions to be met:
- the package should be available for target _and_ host
- the package needs to use a VCS download method, e.g. git, hg, svn, ...
  This does not include standard github downloads, which download a pre-made
  archive.
- there should be a hash file containing the hash of the downloaded archive.
  Since normally there is no hash file for packages with sources coming from
  a version control system, this restricts even further. Some examples of
  packages in this category that do have a hash file (but not necessarily
  match the earlier conditions): expedite, vexpress-firmware, squashfs, ...
- the archive needs to be stored in a 'primary site' after initial archiving
  and thus be downloaded later using a non-version-controlled method, like
  wget or scp. This is because the version control download methods do not
  receive a '-H' parameter pointing to the hash file and thus no hashes are
  checked at all even if the file is present.

While packages matching the third condition could be considered to be 'wrong'
and need to be fixed, it does actually makes sense to have a hash file for
packages from version control, in particular if they are stored in a
primary site as mentioned in the last condition.

Regardless of any different opinions on the previous paragraph, it is also
not conceptually correct that a tarball of a package source can contain a
Buildroot-specific directory prefix 'host-'.  Therefore, use
FOO_RAW_BASE_NAME instead of FOO_BASE_NAME when calling the dl-wrapper.

Example test scenario that exhibits the problem:
$ rm -rf /tmp/dl dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz
$ make qemu_x86_64_defconfig
$ make host-squashfs-dirclean host-squashfs-source
$ mkdir /tmp/dl
$ mv dl/squashfs-9c1db6d13a51a2e009f0027ef336ce03624eac0d.tar.gz /tmp/dl/
$ sed -i -e 's,BR2_PRIMARY_SITE=.*,BR2_PRIMARY_SITE="file:///tmp/dl",' \
         -e '/BR2_PRIMARY_SITE/aBR2_PRIMARY_SITE_ONLY=y'  .config
$ make host-squashfs-dirclean host-squashfs-source

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-10-20 21:46:10 +02:00
arch MIPS: add support for M6201 cores 2016-10-19 23:31:29 +02:00
board configs/freescale_mpc8315erdb: remove U-Boot build 2016-10-15 23:14:44 +02:00
boot core: introduce per br2-external NAME 2016-10-16 13:01:02 +02:00
configs beaglebone: defconfigs: u-boot needs dtc 2016-10-19 17:54:22 +02:00
docs website: add Free Electrons as a current sponsor 2016-10-20 21:33:32 +02:00
fs fs/common: add option to execute custom scripts under fakeroot 2016-07-03 20:58:46 +02:00
linux linux: bump default to version 4.8.3 2016-10-20 21:34:42 +02:00
package pkg-download: use raw basename for repo archiving to remove host- prefix 2016-10-20 21:46:10 +02:00
support get-developers: use --cc instead of --to for developers 2016-10-19 23:38:16 +02:00
system system: fix typo 2016-10-13 08:06:11 +02:00
toolchain toolchain/external: remove unused Linaro symlink hook 2016-10-16 13:08:21 +02:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.gitignore
CHANGES CHANGES: fix typo in 2016.08 release line 2016-09-21 23:06:11 +02:00
Config.in core: do not hard-code inclusion of br2-external in Kconfig 2016-10-16 13:01:02 +02:00
Config.in.legacy wvstreams: remove deprecated package 2016-10-15 23:14:45 +02:00
COPYING
DEVELOPERS DEVELOPERS: add entry for inadyn 2016-10-19 23:34:11 +02:00
Makefile core: re-enter make if $(CURDIR) or $(O) are not canonical paths 2016-10-19 23:11:06 +02:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README

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 Freenode IRC.

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