Skip to content

Commit 535e12d

Browse files
committed
initramfs: compressor: report gains for both cpio and compressed initramfs
1 parent eede031 commit 535e12d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bash/linuxkit.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,12 @@ function linuxkit_build() {
221221
222222
RUN zstdmt -9 -o /output/${output_compressed_initramfs_name} /output/repacked.cpio
223223
RUN { echo -n "## output magic: " && file /output/${output_compressed_initramfs_name}; }>> /output/${output_report_name}
224+
225+
# Report on the reductions done.
226+
# First, the original cpio vs the repacked cpio; this is twice in memory and uncompressed so most relevant
227+
RUN { echo "## size reduction: original cpio vs repacked cpio: " && ls -lh /input/initramfs_decompress.cpio /output/repacked.cpio ; }>> /output/${output_report_name}
228+
# Then, the original gzipped initramfs vs the final zstd initramfs; this is only once in memory but affects download/TFTP time
229+
RUN { echo "## size reduction: original gzipped initramfs vs final zstd initramfs: " && ls -lh /input/initramfs.img /output/${output_compressed_initramfs_name} ; }>> /output/${output_report_name}
224230
FROM scratch
225231
COPY --from=builder /output/* /
226232
INITRAMFS_COMPRESSOR_DOCKERFILE

0 commit comments

Comments
 (0)