[Buildroot] [PATCHv5 1/4] pkg-generic: add step_pkg_size global instrumentation hook

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Wed Sep 9 13:46:17 UTC 2015


Dear Vicente Olivert Riera,

On Wed, 9 Sep 2015 14:11:08 +0100, Vicente Olivert Riera wrote:

> > +# This hook will be called before the target installation of a
> > +# package. We store in a file named .br_filelist_before the list of
> > +# files currently installed in the target. Note that the MD5 is also
> > +# stored, in order to identify if the files are overwritten.
> > +define step_pkg_size_start
> > +	(cd $(TARGET_DIR) ; find . -type f -print0 | xargs -0 md5sum) | sort > \
> 
> why only "-type f"? Packages can also install other type of files such
> as links, for instance. Don't you want to track them as well?

It doesn't make sense to "md5sum" a symbolic link: what you will md5 is
the target of the link, i.e another file of the file system that is
already taken into account by the size statistics mechanism.

We are really only interested in calculating the size of the
filesystem, so the only thing of interest are real file. We assume that
the size of things like device files, directories or symbolic links is
negligible and not relevant for our analysis.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com



More information about the buildroot mailing list