Go to file
Thomas Petazzoni fee7e61665 package/pkg-generic.mk: rework pkg_size logic with the "installed" step
This commits reworks the pkg_size logic to no longer use the
GLOBAL_INSTRUMENTATION_HOOKS mechanism, but instead be directly
implemented within the configure step and install step.

The problem with the current implementation in the
GLOBAL_INSTRUMENTATION_HOOKS is that we only capture what is installed
in $(HOST_DIR) during the "host installation step", what is installed
in $(TARGET_DIR) during the "target installation step" and what is
installed in "$(STAGING_DIR)" during the staging installation step.

While this seems reasonable in principle, it is in fact not completely
true. For example, "toolchain", which is a target package, installs
tons of files in $(HOST_DIR). "qt5base", which is also a target
package, also installs things in $(HOST_DIR). Same with the "syslinux"
package.

The idea behind this patch is pretty simple:

 - At the beginning of the configure step, right after the per-package
   directories have been populated (if BR2_PER_PACKAGE_DIRECTORIES=y),
   we capture the state of the HOST_DIR, TARGET_DIR and STAGING_DIR.

 - At the end of all install steps (which is possible thanks to the
   newly introduced "install" step), we capture again the state of
   HOST_DIR, TARGET_DIR and STAGING_DIR, and compare it to what we
   have saved at the configure step.

So regardless of whether a file has been installed in $(HOST_DIR)
during the target or staging installation steps of a target package,
or if a host package has installed a file in $(TARGET_DIR), we will
detect it.

The pkg_size_before and pkg_size_after macros are intentionally left
where they are (even if they now fall in the middle of the
GLOBAL_INSTRUMENTATION_HOOKS implementations) to minimize the diffstat
and facilitate review.

Note that we also have to change check_bin_arch to be explicitly
called from the install step rather than through a
GLOBAL_INSTRUMENTATION_HOOKS as it depends on the .files-list.txt file
produced by the pkg_size_after function.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
2020-07-23 22:33:15 +02:00
arch arch/Config.in: add BR2_ARCH_NEEDS_GCC_AT_LEAST_10 2020-06-24 21:57:43 +02:00
board configs/imx6ullevk: new defconfig 2020-07-16 09:20:06 +02:00
boot boot/arm-trusted-firmware: bump to version 2.2 2020-07-20 22:29:17 +02:00
configs configs/raspberrypi*: bump kernel version to 1c64f4b (5.4.51) 2020-07-23 22:04:23 +02:00
docs docs/manual/adding-packages-generic.txt: fix typo 2020-06-06 21:28:31 +02:00
fs fs/cpio: generate reproducible archives 2020-06-29 17:57:12 +02:00
linux legacy: drop options removed more than 5 years ago now 2020-06-22 07:17:05 +02:00
package package/pkg-generic.mk: rework pkg_size logic with the "installed" step 2020-07-23 22:33:15 +02:00
support package/meson: bump to version 0.55.0 2020-07-18 15:53:43 +02:00
system system: replace nogroup with nobody 2020-07-18 14:18:33 +02:00
toolchain toolchain/toolchain-wrapper: let recent GCC handle SOURCE_DATE_EPOCH 2020-06-27 17:19:53 +02:00
utils utils/scancpan: use two spaces indentation in hash file 2020-03-15 23:17:46 +01:00
.defconfig arch: remove support for sh64 2016-09-08 22:15:15 +02:00
.flake8 .flake8: fix check for 80/132 columns 2019-04-10 12:31:33 +02:00
.gitignore
.gitlab-ci.yml configs/imx6ullevk: new defconfig 2020-07-16 09:20:06 +02:00
.gitlab-ci.yml.in gitlab.yml.in*: enable Qemu gitlab testing 2020-04-13 21:51:13 +02:00
CHANGES Update for 2020.02.3 2020-06-04 11:10:45 +02:00
Config.in Config.in: update BR2_OPTIMIZE_FAST prompt and help text 2020-07-18 16:05:01 +02:00
Config.in.legacy Config.in.legacy: drop legacy handling for BR2_PACKAGE_FIRMWARE_DDRFW_* options 2020-07-12 10:16:47 +02:00
COPYING
DEVELOPERS package/resiprocate: new package 2020-07-20 22:25:16 +02:00
Makefile Makefile: use order-only dependency so symlinks are made only once 2020-07-18 08:47:34 +02:00
Makefile.legacy Remove BR2_DEPRECATED 2016-10-15 23:14:45 +02:00
README README: add reference to submitting-patches 2016-02-01 19:16:08 +01: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 Freenode IRC.

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