From 5883dc1bd9ff96694ef61f8dbbe82188d81343e6 Mon Sep 17 00:00:00 2001 From: Hyounggyu Choi Date: Fri, 3 Feb 2023 11:11:42 +0100 Subject: [PATCH 1/2] CI: Set docker version to v20.10 in ubuntu:20.04 for s390x|ppc64le This is to make a docker version to v20.10 in docker upstream image ubuntu:20.04 for s390x and ppc64le. Fixes: #6211 for stable-3.0 Signed-off-by: Hyounggyu Choi (cherry picked from commit f49b89b632e64d0cd72bbe39ed4b5f83abbfb0bb) Signed-off-by: Greg Kurz --- tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile b/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile index 06a4a93ac9..2ff5f5ae83 100644 --- a/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile +++ b/tools/packaging/kata-deploy/local-build/dockerbuild/Dockerfile @@ -8,6 +8,7 @@ ENV INSTALL_IN_GOPATH=false COPY install_yq.sh /usr/bin/install_yq.sh +SHELL ["/bin/bash", "-o", "pipefail", "-c"] # Install yq and docker RUN apt-get update && \ @@ -18,6 +19,7 @@ RUN apt-get update && \ apt-get clean && rm -rf /var/lib/apt/lists/ && \ install_yq.sh && \ curl -fsSL https://get.docker.com -o get-docker.sh && \ + if uname -m | grep -Eq 's390x|ppc64le'; then export VERSION="v20.10"; fi && \ sh get-docker.sh ARG IMG_USER=kata-builder From 0623f1fe6beb449730525fb9b39270caa5c1c570 Mon Sep 17 00:00:00 2001 From: Hyounggyu Choi Date: Wed, 26 Oct 2022 23:43:22 +0200 Subject: [PATCH 2/2] virtiofsd: Not use "link-self-contained=yes" on s390x The compile option link-self-contained=yes asks rustc to use C library startup object files that come with the compiler, which are not available on the target s390x-unknown-linux-gnu. A build does not contain any startup files leading to a broken executable entry point (causing segmentation fault). Fixes: #5522 for stable-3.0 Signed-off-by: Hyounggyu Choi (cherry picked from commit 43fcb8fd09064b8b383ec3b15275991665e269ca) Signed-off-by: Greg Kurz --- .../static-build/virtiofsd/build-static-virtiofsd.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh b/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh index 90d6d6fa57..8b0a048264 100755 --- a/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh +++ b/tools/packaging/static-build/virtiofsd/build-static-virtiofsd.sh @@ -47,6 +47,7 @@ pull_virtiofsd_released_binary() { init_env() { source "$HOME/.cargo/env" + extra_rust_flags=" -C link-self-contained=yes" case ${ARCH} in "aarch64") LIBC="musl" @@ -60,6 +61,7 @@ init_env() { "s390x") LIBC="gnu" ARCH_LIBC=${ARCH}-linux-${LIBC} + extra_rust_flags="" ;; "x86_64") LIBC="musl" @@ -76,7 +78,7 @@ build_virtiofsd_from_source() { git clone --depth 1 --branch ${virtiofsd_version} ${virtiofsd_repo} virtiofsd pushd virtiofsd - export RUSTFLAGS='-C target-feature=+crt-static -C link-self-contained=yes' + export RUSTFLAGS='-C target-feature=+crt-static'${extra_rust_flags} export LIBSECCOMP_LINK_TYPE=static export LIBSECCOMP_LIB_PATH=/usr/lib/${ARCH_LIBC} export LIBCAPNG_LINK_TYPE=static