From e8e28f49f97807d119903cfef93fe13585422bf6 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Fri, 4 Sep 2026 11:21:22 +0200 Subject: T9277: add noticable warning when installing debug packages --- scripts/image-build/build-vyos-image | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'scripts') diff --git a/scripts/image-build/build-vyos-image b/scripts/image-build/build-vyos-image index 40d9cfdf..0f9e1ef8 100755 --- a/scripts/image-build/build-vyos-image +++ b/scripts/image-build/build-vyos-image @@ -783,6 +783,22 @@ Pin-Priority: 600 for f in local_packages: shutil.copy(f, os.path.join(defaults.LOCAL_PACKAGES_PATH, os.path.basename(f))) + ## T9277: Debug packages are installed on purpose - placing a .deb into + ## packages/ is a deliberate act - but linux-image-*-dbg alone expands to + ## ~2.3 GB in the rootfs, so make the cost impossible to miss. + debug_packages = [f for f in local_packages + if re.search(r'-dbg(sym)?_', os.path.basename(f))] + if debug_packages: + print("W: " + "=" * 60) + print(f"W: Installing {len(debug_packages)} debug package(s) from packages/:") + for f in sorted(debug_packages): + size_mb = os.path.getsize(f) / (1024 * 1024) + print(f"W: {os.path.basename(f)} ({size_mb:.1f} MB deb)") + print("W: Debug symbols expand significantly in the rootfs and will") + print("W: noticeably increase the image size. Remove them from packages/") + print("W: if this was unintended.") + print("W: " + "=" * 60) + ## Build the image print("I: Starting image build") if debug: -- cgit v1.2.3