From 219326392c433af51c9e034bca0059ca19808530 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Mon, 30 Jan 2023 15:28:03 +0100 Subject: [PATCH 1/2] ci-automation: Try reporting the changes in initrd too This relies on flatcar_production_image_initrd_contents.txt being uploaded to the server. It also exports the WITHWTD environment variable with a value 1, which will make the package-diff script to try out the wtd contents file variant first. --- ci-automation/image_changes.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index e17eb10a0b..391836ef32 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -103,6 +103,9 @@ function _image_changes_impl() { echo "Image kernel config changes, compared to ${CHANNEL_A} ${VERSION_A}:" FILE=flatcar_production_image_kernel_config.txt flatcar-build-scripts/package-diff "${VERSION_A}" "${VERSION_B}" echo + echo "Image init ramdisk file changes, compared to ${CHANNEL_A} ${VERSION_A}:" + FILE=flatcar_production_image_initrd_contents.txt FILESONLY=1 flatcar-build-scripts/package-diff "${VERSION_A}" "${VERSION_B}" + echo echo "Image file size change (includes /boot, /usr and the default rootfs partitions), compared to ${CHANNEL_A} ${VERSION_A}:" FILE=flatcar_production_image_contents.txt CALCSIZE=1 flatcar-build-scripts/package-diff "${VERSION_A}" "${VERSION_B}" echo From 46a250bf338186fe12c0303ea84693ef25fb79e0 Mon Sep 17 00:00:00 2001 From: Krzesimir Nowak Date: Mon, 30 Jan 2023 15:31:18 +0100 Subject: [PATCH 2/2] ci-automation: Report file size changes This uses the new size-change-report.sh script to print out some information about largest files being added/removed and files with greatest increase/decrease in file size between two versions of the image. --- ci-automation/image_changes.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ci-automation/image_changes.sh b/ci-automation/image_changes.sh index 391836ef32..7712e73ce3 100644 --- a/ci-automation/image_changes.sh +++ b/ci-automation/image_changes.sh @@ -86,6 +86,10 @@ function _image_changes_impl() { export FROM_B="bincache" export VERSION_B="${vernum}" export BOARD_B="${arch}-usr" + # First parts of the size-changes-report specs, the kind is + # appended at call sites. + SPEC_A_PART="${FROM_A}:${CHANNEL_A}:${arch}-usr:${VERSION_A}" + SPEC_B_PART="${FROM_B}:${arch}:${VERSION_B}" # CHANNEL_B is unused echo "== Image differences compared to ${CHANNEL_A} ${VERSION_A} ==" NEW_VERSION=$(git tag --points-at HEAD) @@ -106,6 +110,19 @@ function _image_changes_impl() { echo "Image init ramdisk file changes, compared to ${CHANNEL_A} ${VERSION_A}:" FILE=flatcar_production_image_initrd_contents.txt FILESONLY=1 flatcar-build-scripts/package-diff "${VERSION_A}" "${VERSION_B}" echo + echo "Image file size changes, compared to ${CHANNEL_A} ${VERSION_A}:" + if ! flatcar-build-scripts/size-change-report.sh "${SPEC_A_PART}:wtd" "${SPEC_B_PART}:wtd"; then + flatcar-build-scripts/size-change-report.sh "${SPEC_A_PART}:old" "${SPEC_B_PART}:old" + fi + echo + echo "Image init ramdisk file size changes, compared to ${CHANNEL_A} ${VERSION_A}:" + if ! flatcar-build-scripts/size-change-report.sh "${SPEC_A_PART}:initrd-wtd" "${SPEC_B_PART}:initrd-wtd"; then + flatcar-build-scripts/size-change-report.sh "${SPEC_A_PART}:initrd-old" "${SPEC_B_PART}:initrd-old" + fi + echo "Take the total size difference with a grain of salt as normally initrd is compressed, so the actual difference will be smaller." + echo "To see the actual difference in size, see if there was a report for /boot/flatcar/vmlinuz-a." + echo "Note that vmlinuz-a also contains the kernel code, which might have changed too, so the reported difference does not accurately describe the change in initrd." + echo echo "Image file size change (includes /boot, /usr and the default rootfs partitions), compared to ${CHANNEL_A} ${VERSION_A}:" FILE=flatcar_production_image_contents.txt CALCSIZE=1 flatcar-build-scripts/package-diff "${VERSION_A}" "${VERSION_B}" echo