[arm][build_debian] Clean up qemu-arm-static bin after collecting post-versions info (#6289)

- Why I did it
scripts/collect_host_image_version_files.sh fails with below error:

scripts/collect_host_image_version_files.sh target ./fsroot
/usr/sbin/chroot: failed to run command 'post_run_buildinfo': No such file or directory
/bin/cp: cannot stat './fsroot/usr/local/share/buildinfo/post-versions': No such file or directory

- How I did it
Issues is because qemu-arm-static is removed before this step. So, I moved the cleanup step to the end.

Signed-off-by: Sabareesh Kumar Anandan <sanandan@marvell.com>
This commit is contained in:
Sabareesh-Kumar-Anandan 2020-12-25 00:15:19 +05:30 committed by GitHub
parent f6d1c4a575
commit 9aae9c9e47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -568,12 +568,6 @@ sudo LANG=C chroot $FILESYSTEM_ROOT fuser -km /proc || true
sleep 15
sudo LANG=C chroot $FILESYSTEM_ROOT umount /proc || true
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; then
# Remove qemu arm bin executable used for cross-building
sudo rm -f $FILESYSTEM_ROOT/usr/bin/qemu*static || true
DOCKERFS_PATH=../dockerfs/
fi
## Prepare empty directory to trigger mount move in initramfs-tools/mount_loop_root, implemented by patching
sudo mkdir $FILESYSTEM_ROOT/host
@ -585,7 +579,13 @@ sudo du -hsx $FILESYSTEM_ROOT
sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker
sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR
scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT
sudo scripts/collect_host_image_version_files.sh $TARGET_PATH $FILESYSTEM_ROOT
if [[ $CONFIGURED_ARCH == armhf || $CONFIGURED_ARCH == arm64 ]]; 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