Merge pull request #8933 from fidencio/topic/package-coco-guest-components

packaging: Build coco-guest-components
This commit is contained in:
Greg Kurz
2024-01-29 16:34:06 +01:00
committed by GitHub
13 changed files with 194 additions and 4 deletions

View File

@@ -28,6 +28,9 @@ LIBC=${LIBC:-musl}
SECCOMP=${SECCOMP:-"yes"}
SELINUX=${SELINUX:-"no"}
AGENT_POLICY=${AGENT_POLICY:-no}
AGENT_SOURCE_BIN=${AGENT_SOURCE_BIN:-""}
AGENT_TARBALL=${AGENT_TARBALL:-""}
COCO_GUEST_COMPONENTS_TARBALL=${COCO_GUEST_COMPONENTS_TARBALL:-""}
lib_file="${script_dir}/../scripts/lib.sh"
source "$lib_file"
@@ -143,6 +146,11 @@ ARCH Target architecture (according to \`uname -m\`).
and glibc agents.
Default value: $(uname -m)
COCO_GUEST_COMPONENTS_TARBALL Path to the kata-coco-guest-components.tar.xz tarball to be unpacked inside the
rootfs.
If set, the tarball will be unpacked onto the rootfs.
Default value: <not set>
DISTRO_REPO Use host repositories to install guest packages.
Default value: <not set>
@@ -684,7 +692,7 @@ EOF
rm -rf "${libseccomp_install_dir}" "${gperf_install_dir}"
fi
popd
elif [ "${AGENT_SOURCE_BIN}" ]; then
elif [ -n "${AGENT_SOURCE_BIN}" ]; then
mkdir -p ${AGENT_DIR}
cp ${AGENT_SOURCE_BIN} ${AGENT_DEST}
OK "cp ${AGENT_SOURCE_BIN} ${AGENT_DEST}"
@@ -780,6 +788,10 @@ EOF
[ -x "${init}" ] || [ -L "${init}" ] || die "/sbin/init is not installed in ${ROOTFS_DIR}"
OK "init is installed"
if [ -n "${COCO_GUEST_COMPONENTS_TARBALL}" ] ; then
tar xvJpf ${COCO_GUEST_COMPONENTS_TARBALL} -C ${ROOTFS_DIR}
fi
# Create an empty /etc/resolv.conf, to allow agent to bind mount container resolv.conf to Kata VM
dns_file="${ROOTFS_DIR}/etc/resolv.conf"
if [ -L "$dns_file" ]; then