Files
kata-containers/tools/packaging/static-build/initramfs/build-initramfs.sh
Fabiano Fidêncio 300f7e686e build: Fix initramfs build
We have noticed in the CI that the `gen_init_cpio ...` was returning 255
and breaking the build. Why? I am not sure.

When chatting with Steve, he suggested to split the command, so it'd be
easier to see what's actually breaking. But guess what? There's no
breakage when we split the command.

So, let's try it out and see whether the CI passes after it.

If someone is willing to educate us on this one, please, that would be
helpful! :-)

Signed-off-by: Fabiano Fidêncio <ffidencio@nvidia.com>
2025-10-02 20:58:22 +02:00

23 lines
509 B
Bash
Executable File

#!/bin/bash
#
# Copyright (c) 2022 Intel
#
# SPDX-License-Identifier: Apache-2.0
set -o errexit
set -o nounset
set -o pipefail
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${script_dir}/../../scripts/lib.sh"
install_dir="${1:-.}"
tmpfile="$(mktemp -t initramfs.XXXXXX.cpio)"
trap 'rm -f "$tmpfile"' EXIT
if ! gen_init_cpio "${script_dir}/initramfs.list" > "${tmpfile}"; then
echo "gen_init_cpio failed" >&2
exit 1
fi
gzip -9 -n -c "${tmpfile}" > "${install_dir}"/initramfs.cpio.gz