Skip to content

buildstats: avoiding disk usage warnings in Isar

Uladzimir Bely openembedded-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest1 patch 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1buildstats: disk usage outside bbclassmeta/classes/buildstats-utils.bbclass meta/classes/buildstats.bbclass+7 -22 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/1] [meta-oe] buildstats: avoiding disk usage warnings in Isar

Recently we've borrowed buildstats functionality to Isar (https://github.com/
ilbers/isar/). Everything works well, but there is a problem with a large number of warnings in the console.

The problems comes from run_buildstats() function (bb.build.TaskSucceeded handler). Here, rootfs_size is calculated by executing "du -sh" on the directory.

In case of Isar, this directory may: 1) be created by root, so some directories are not available for the user; 2) have ./proc and ./dev mounted. So "du" produces a big amount of "Permissions denied" warnings.

The easiest solution in our case is using "sudo du -shx" instead. This solution works, bus it requires forking buildstats.bbclass, so our copy will differ from OE's one. That's what we want to avoid.

I'm looking for a proper way to make some changes in openembedded-core upstream that will continue using "du -sh" (or "du -shx") in OE/Yocto/etc, but will allow to use "sudo du -shx" in Isar.

Current idea is to put "du -sh" functionality to some small separate file (.py or .bbclass) so it could be called from buidstats.bbclass via some abstract method. Isar could just use its own implementation.

But I'm not sure that it would be a good option for OE-core, because it doesn't bring any essential improvements for it.

Probably, someone could hint some other way to deal with the issue that doesn't require changes in files borrowed from OE?

The following patch is an example how it could look like.

Uladzimir Bely (1):
buildstats: disk usage outside bbclass

 meta/classes/buildstats-utils.bbclass | 4 ++++
 meta/classes/buildstats.bbclass       | 5 +++--
 2 files changed, 7 insertions(+), 2 deletions(-)
 create mode 100644 meta/classes/buildstats-utils.bbclass
Signature · 1 line
2.20.1