From f2e677db34e07d7cb539a71b739edde87aeb701c Mon Sep 17 00:00:00 2001 From: Saikrishna Arcot Date: Tue, 22 Feb 2022 08:38:39 -0800 Subject: [PATCH] Revert "[build]: Use zstd compression for base filesystem squashfs" (#10030) When upgrading from an older image (with an older kernel that doesn't support zstd) to 202012, the squashfs filesystem from the 202012 image can't be mounted on the older image, because zstd was introduced in 4.14, and older images will likely be running 4.9. Therefore, disable zstd compression in the squashfs image for 202012 image. When upgrading from 202012 to newer images, since 202012 is running on 4.19, it can read and mount zstd-compressed squashfs images. # Why this was done The kernel in 201811 image (4.9 kernel) doesn't support zstd. In some cases, it may be needed to mount the squashfs image from the new image while the current (old) image is booted. If the squashfs image is compressed with zstd, then it cannot be mounted on a 4.9 kernel, because zstd was introduced in 4.14. This reverts commit 35e88e5f6a743422496d79540e46e4cb464186be. --- build_debian.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_debian.sh b/build_debian.sh index fa2ef041cf..6ec8abd0c6 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -586,7 +586,7 @@ sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS sudo du -hsx $FILESYSTEM_ROOT sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT -sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -comp zstd -b 1M -e boot -e var/lib/docker -e $PLATFORM_DIR +sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR # Ensure admin gid is 1000 gid_user=$(sudo LANG=C chroot $FILESYSTEM_ROOT id -g $USERNAME) || gid_user="none"