mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-23 16:24:19 +01:00
Currently QEMU is built inside the container, its tarball pulled to the host, files removed then packaged again. Instead, let's run all those steps inside the container and the resulting tarball will be the final version. For that end, it is introduced the qemu-build-post.sh script which will remove the uneeded files and create the tarball. The patterns for directories on qemu.blacklist had to be changed to work properly with `find -path`. Fixes #1168 Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
29 lines
601 B
Bash
Executable File
29 lines
601 B
Bash
Executable File
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2020 Red Hat, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
# This script process QEMU post-build.
|
|
#
|
|
set -e
|
|
|
|
script_dir="$(realpath $(dirname $0))"
|
|
source "${script_dir}/../qemu.blacklist"
|
|
|
|
if [[ -z "${QEMU_TARBALL}" || -z "${QEMU_DESTDIR}" ]]; then
|
|
echo "$0: needs QEMU_TARBALL and QEMU_DESTDIR exported"
|
|
exit 1
|
|
fi
|
|
|
|
pushd "${QEMU_DESTDIR}"
|
|
# Remove files to reduce the surface.
|
|
echo "INFO: remove uneeded files"
|
|
for pattern in ${qemu_black_list[@]}; do
|
|
find . -path "$pattern" | xargs rm -rfv
|
|
done
|
|
|
|
echo "INFO: create the tarball"
|
|
tar -czvf "${QEMU_TARBALL}" *
|
|
popd
|