Skip to content

Commit

Permalink
[build]: Fix ARM build break introduced in PR# 7249 (sonic-net#7395)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dflynn-Nokia authored and raphaelt-nvidia committed May 13, 2021
1 parent 11812af commit 9f74a2f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9f74a2f

Please sign in to comment.