Skip to content

Commit

Permalink
podvm: Temporary fix for installing cryptsetup in SE-enabled PodVM image
Browse files Browse the repository at this point in the history
Due to issue https://gitlab.com/qemu-project/qemu/-/issues/2054, we can't install packages on RHEL s390x base machines. As a temporary fix, we're downloading cryptsetup in a container and copying the binaries to the VM image.

Signed-off-by: ANJANA-A-R-K <ANJANA.A.R.K1@ibm.com>

Signed-off-by: Saripalli Lavanya <Saripalli.Lavanya@ibm.com>
  • Loading branch information
Saripalli-lavanya committed Jul 28, 2024
1 parent cc69208 commit d1fb986
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cloud-api-adaptor/podvm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ $(IMAGE_FILE): $(BINARIES) $(FILES) setopts
mkdir -p toupload
if [ "${SE_BOOT}" = "1" ] && [ "${ARCH}" = "s390x" ]; then \
qemu-img create -f qcow2 "se-${IMAGE_FILE}" 100G; \
# Temporary workaround for installing cryptsetup on RHEL 9.4 and below s390x base images for enabling se \
# Due to issue: https://gitlab.com/qemu-project/qemu/-/issues/2054 \
# Remove this if using the latest QEMU version (v9.0.0) \
if [ "${PODVM_DISTRO}" = "rhel" ]; then \
yum install -y cryptsetup; \
cp /usr/sbin/cryptsetup ./files; \
fi \
fi
packer init ./qcow2/${PODVM_DISTRO}
if [ "${ARCH}" = "x86_64" ]; then \
Expand Down
4 changes: 4 additions & 0 deletions src/cloud-api-adaptor/podvm/qcow2/build-s390x-se-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ done

if [ "${PODVM_DISTRO}" = "rhel" ]; then
export LANG=C.UTF-8
# Below is the tmp work-around to install cryptsetup on rhel9.4 and below s390x version base images,
#due to the issue : https://gitlab.com/qemu-project/qemu/-/issues/2054
cp /tmp/files/cryptsetup /usr/bin/cryptsetup
chmod +x /usr/bin/cryptsetup
if ! command -v jq &> /dev/null || ! command -v cryptsetup &> /dev/null; then
if ! command -v jq &> /dev/null; then
echo >&2 "jq is required but it's not installed. Installing now..."
Expand Down

0 comments on commit d1fb986

Please sign in to comment.