274e929f11
Why I did it Running SONiC releases past 202012 has become really challenging on system with small storage devices (4GB). Some of these devices can also be limited by only having 4GB of RAM which complicates mitigations. The main contributor to these issues is the SONiC image growth. Being able to reduce it by some decent amount should allow these systems to run SONiC longer. It would also reduce some impacts related to space savings mitigations. Work item tracking Microsoft ADO (number only): How I did it Add a build option to reduce the image size. The image reduction process is affecting the builds in 2 ways: change some packages that are installed in the rootfs apply a rootfs reduction script The script itself will perform a few steps: remove file duplication by leveraging hardlinks under /usr/share/sonic since the symlinks under the device folder are lost during the build. under /var/lib/docker since the files there will only be mounted ro remove some extra files (man, docs, licenses, ...) some image specific space reduction (only for aboot images currently) The script can later be improved but for now it's reducing the rootfs size by ~30%. How to verify it Compare the size of an image with this option enabled and this option enabled. Expect the fully extracted content to be ~30% less. Which release branch to backport (provide reason below if selected) This is a backport of #16729 Description for the changelog Add build option to reduce final image size |
||
---|---|---|
.. | ||
j2cli | ||
build_debian_base_system.sh | ||
build_kvm_image.sh | ||
build_mirror_config.sh | ||
build-optimize-fs-size.py | ||
collect_build_version_files.sh | ||
collect_docker_version_files.sh | ||
collect_host_image_version_files.sh | ||
convert-pfx-cert-format.sh | ||
dbg_files.sh | ||
docker_version_control.sh | ||
efi-sign.sh | ||
generate_buildinfo_config.sh | ||
populate_file_web_server.py | ||
prepare_debian_image_buildinfo.sh | ||
prepare_docker_buildinfo.sh | ||
prepare_slave_container_buildinfo.sh | ||
process_log.sh | ||
run_with_retry | ||
secure_boot_signature_verification.sh | ||
sign_image_dev.sh | ||
sign_image.sh | ||
signing_kernel_modules.sh | ||
signing_secure_boot_dev.sh | ||
versions_manager.py | ||
wait_for_docker.sh |