Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a way to run storage statistics on a yocto-produced filesystem?

Tags:

yocto

I used Yocto to build a filesystem, using a .bbappend of core-image-minimal. Two questions:

  1. how can i figure out which package is taking huge storage space on the rootfs?

    I can't think of a way other than to look into the ${D} of every package and see how big its components are. There's gotta be a more systematic, and intelligent way to do that.

From what i can decipher from the manifest, there is nothing related to the size of the package that is being included.

Also, removing some of the packages I added using the IMAGE_INSTALL object, seems to remove the package but the end result of the built image doesn't show a change in its size!!

  1. I compared the size of a particular .so on the build machine and on the installation device (a vm) and found that the size on the installation device was 20-30% of the original size seen on the build machine. Any explanation?

Thanks!

like image 857
user3342339 Avatar asked Oct 15 '25 03:10

user3342339


1 Answers

1) One way is to enable buildhistory, by adding the following to local.con

INHERIT += "buildhistory"
BUILDHISTORY_COMMIT = "1"

This will create a directory (git repo) buildhistory in your $BUILDDIR. There you'll be able to find e.g.

images/$MACHINE/eglibc/$IMAGE/installed-package-sizes.txt

That file will give you the sizes of all installed packages.

There are a lot more things you can learn from buildhistory, see buildhistory introduction

2) Where did you compare the particular .so-file? If it was from the package's ${B} (i.e. where the library is built), it's not surprising, as the installed .so-file will be stripped. The debug information is installed into -deb.rpm (as the debug info is usually useless on the target and the smaller size is of much higher importance).

like image 155
Anders Avatar answered Oct 19 '25 14:10

Anders