From cc3c1ed8b43a3bca06d5a0461e0a2a373e86bb62 Mon Sep 17 00:00:00 2001 From: dflynn-Nokia <60479697+dflynn-Nokia@users.noreply.github.com> Date: Thu, 22 Apr 2021 00:00:12 -0400 Subject: [PATCH] [build]: Fix ARM build break introduced in PR# 7249 (#7395) PR# 7249 introduced a new bit of logic _after_ the point where the qemu based build environment for ARM is removed. Hence the new logic fails when building for ARM. Builds for AMD64 were not affected. This commit moves the new logic introduced by PR# 7249 to just _before_ the point where the qemu based build environment for ARM is removed. A comment is added to reduce the likelihood of this sort of ARM build break from happening again. --- build_debian.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/build_debian.sh b/build_debian.sh index 3dc7f73fdefc..e6f839ba65b9 100755 --- a/build_debian.sh +++ b/build_debian.sh @@ -581,18 +581,21 @@ sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT -if [ $MULTIARCH_QEMU_ENVIRON == y ]; then - # Remove qemu arm bin executable used for cross-building - sudo rm -f $FILESYSTEM_ROOT/usr/bin/qemu*static || true - DOCKERFS_PATH=../dockerfs/ -fi - # Ensure admin gid is 1000 gid_user=$(sudo LANG=C chroot $FILESYSTEM_ROOT id -g $USERNAME) || gid_user="none" if [ "${gid_user}" != "1000" ]; then die "expect gid 1000. current:${gid_user}" fi +# ALERT: This bit of logic tears down the qemu based build environment used to +# perform builds for the ARM architecture. This must be the last step in this +# script before creating the Sonic installer payload zip file. +if [ $MULTIARCH_QEMU_ENVIRON == y ]; then + # Remove qemu arm bin executable used for cross-building + sudo rm -f $FILESYSTEM_ROOT/usr/bin/qemu*static || true + DOCKERFS_PATH=../dockerfs/ +fi + ## Compress docker files pushd $FILESYSTEM_ROOT && sudo tar czf $OLDPWD/$FILESYSTEM_DOCKERFS -C ${DOCKERFS_PATH}var/lib/docker .; popd