mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-03 14:07:24 +00:00
packaging/shim-v2: Only change the config if the file exists
Let's not try to sed a file that doesn't exist, which may be the case
depending on the architecture we're building the shim-v2 for.
This is a partial-forward port of
f24c47ea47
.
Fixes: #6293
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
This commit is contained in:
parent
0d2a7f8324
commit
a68c5004f8
@ -12,6 +12,7 @@ script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
readonly repo_root_dir="$(cd "${script_dir}/../../../.." && pwd)"
|
readonly repo_root_dir="$(cd "${script_dir}/../../../.." && pwd)"
|
||||||
readonly kernel_builder="${repo_root_dir}/tools/packaging/kernel/build-kernel.sh"
|
readonly kernel_builder="${repo_root_dir}/tools/packaging/kernel/build-kernel.sh"
|
||||||
|
|
||||||
|
VMM_CONFIGS="qemu fc"
|
||||||
|
|
||||||
GO_VERSION=${GO_VERSION}
|
GO_VERSION=${GO_VERSION}
|
||||||
RUST_VERSION=${RUST_VERSION}
|
RUST_VERSION=${RUST_VERSION}
|
||||||
@ -47,8 +48,12 @@ sudo docker run --rm -i -v "${repo_root_dir}:${repo_root_dir}" \
|
|||||||
"${container_image}" \
|
"${container_image}" \
|
||||||
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install"
|
bash -c "git config --global --add safe.directory ${repo_root_dir} && make PREFIX="${PREFIX}" DESTDIR="${DESTDIR}" install"
|
||||||
|
|
||||||
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-qemu.toml"
|
for vmm in ${VMM_CONFIGS}; do
|
||||||
sudo sed -i -e '/^initrd =/d' "${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-fc.toml"
|
config_file="${DESTDIR}/${PREFIX}/share/defaults/kata-containers/configuration-${vmm}.toml"
|
||||||
|
if [ -f ${config_file} ]; then
|
||||||
|
sudo sed -i -e '/^initrd =/d' ${config_file}
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
pushd "${DESTDIR}/${PREFIX}/share/defaults/kata-containers"
|
pushd "${DESTDIR}/${PREFIX}/share/defaults/kata-containers"
|
||||||
sudo ln -sf "configuration-qemu.toml" configuration.toml
|
sudo ln -sf "configuration-qemu.toml" configuration.toml
|
||||||
|
Loading…
Reference in New Issue
Block a user