()
| 370 | |
| 371 | |
| 372 | def main() -> None: |
| 373 | report = build_report() |
| 374 | images_dir = Path(env("IMAGES_DIR")) |
| 375 | out_path = images_dir / f"sizes.{report['board']}-{report['variant']}.json" |
| 376 | images_dir.mkdir(parents=True, exist_ok=True) |
| 377 | out_path.write_text(json.dumps(report, indent=2) + "\n") |
| 378 | pkgs = len(report["packages"]) |
| 379 | mods = len(report["linux_components"]["modules"]) |
| 380 | rem = len(report["removed_by_finalize"]) |
| 381 | rootfs = report["rootfs"] |
| 382 | headroom = report["headroom"] |
| 383 | print( |
| 384 | f"size-report: {out_path}\n" |
| 385 | f" packages={pkgs} modules={mods} removed={rem}\n" |
| 386 | f" rootfs={rootfs.get('compressed_bytes')}B " |
| 387 | f"(uncompressed {rootfs.get('uncompressed_bytes')}B, " |
| 388 | f"ratio {rootfs.get('compression_ratio')})\n" |
| 389 | f" headroom: kernel={headroom['kernel']['headroom_kb']}KB " |
| 390 | f"rootfs={headroom['rootfs']['headroom_kb']}KB" |
| 391 | ) |
| 392 | |
| 393 | |
| 394 | if __name__ == "__main__": |
no test coverage detected