[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH v1 2/3] automation: add linux argo test artifacts


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: <victorm.lira@xxxxxxx>
  • Date: Thu, 17 Oct 2024 10:18:27 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1zaVyoOUYBX6WPASuaE/d8keX1X2ko5PNA11fHB6pyo=; b=a81lmu8FRsgGOadZhtQQl1UFRQhnRBZwSLq+xAHFSdHUx2GM0gL/MfSrEIlzgJi/GojdE+OlT66PEKrJ/5fSulO+yck8IdQD2MRxdPgI4iWc+l6lZL4mH13IvK/z6CXfIx1EuiofWBUYzR72yC3czj9w7dRV0in6qBxhxMpxD0Pehmc6Ebll85mW7utpejI/jylHGH8zGI0My0756IScbUqGkZEBizc5nFhyDu83vgyIHixL6sHxrEBvK6g3K7ZmUHTaHMhj7ZdUyY8808FaIOxraT98zyzA69jc5IMjslo4rWzPuXEY4mdVIHiFNhnY5SCXikSbyM+amie+Vetryw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=IqPhtnWtyeq8ejdG0iy2u53JbKgz7WitO14SiC3WtBFDHX+snDUFTTHItEjJfiULlMiMHESif/I11R9AD3P1aVolK7hui10O70QmKlOCyo8jlao2hznu+v2uNwtONmjsYPgj17NU6oBZt4XBMj/ohIA0tsil5Qe0gykaDu65NESzdYcLuXF0swsrMVauLx53uF79sGCzyjqy1a5LcBimNKCl6IFPlWhvQMV+ji91UnGi7LVvLEWYk9hqp0k5bAw1OzvevhvcoVdL1YXYeyOlXMrYUZ6mIEcp9hP6bRwx9q58D/8lr7mCVcKVQ3aVPg02KB85OJZhS1DRUXxOBCGN+g==
  • Cc: Victor Lira <victorm.lira@xxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Thu, 17 Oct 2024 17:19:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

From: Victor Lira <victorm.lira@xxxxxxx>

Add dockerfile for building container image that holds test binaries for
Xen Argo test on Linux 6.6.56 x86_64

The build produces the following:
- xen-argo.ko       Linux kernel module
- lib/libargo*      Linux shared library
- argo-exec         Linux user test program

Signed-off-by: Victor Lira <victorm.lira@xxxxxxx>
---
Cc: Doug Goldstein <cardoe@xxxxxxxxxx>
Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
---
 .../tests-artifacts/argo/6.6.56.dockerfile    | 95 +++++++++++++++++++
 1 file changed, 95 insertions(+)
 create mode 100644 automation/tests-artifacts/argo/6.6.56.dockerfile

diff --git a/automation/tests-artifacts/argo/6.6.56.dockerfile 
b/automation/tests-artifacts/argo/6.6.56.dockerfile
new file mode 100644
index 0000000000..a8e199ad3b
--- /dev/null
+++ b/automation/tests-artifacts/argo/6.6.56.dockerfile
@@ -0,0 +1,95 @@
+# syntax=docker/dockerfile:1
+FROM --platform=linux/amd64 alpine:3.18
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@xxxxxxxxxxxxxxxxxxxx"
+
+ENV LINUX_VERSION=6.6.56
+ENV USER root
+
+RUN mkdir /build /artifacts
+WORKDIR /build
+ENV BUILDDIR=/build/
+ENV COPYDIR=/artifacts/
+ENV ARGO_SHA="705a7a8a624b42e13e655d3042059b8a85cdf6a3"
+ENV ARGOEXEC_SHA="d900429f6640acc6f68a3d3a4c945d7da60625d8"
+
+RUN apk --no-cache add \
+  \
+  musl-dev  \
+  build-base \
+  libc6-compat \
+  linux-headers \
+  bash \
+  git \
+  curl \
+  flex \
+  bison \
+  elfutils-dev \
+  autoconf \
+  automake \
+  libtool && \
+  \
+  # Prepare Linux sources
+  curl -fsSLO 
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
+  tar xJf linux-"$LINUX_VERSION".tar.xz && \
+  cd linux-"$LINUX_VERSION" && \
+  make ARCH=x86 defconfig && \
+  make ARCH=x86 xen.config && \
+  ./scripts/config --enable BRIDGE && \
+  ./scripts/config --enable IGC && \
+  ./scripts/config --enable TUN && \
+  cp .config .config.orig && \
+  cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
+  make ARCH=x86 olddefconfig && \
+  make ARCH=x86 modules_prepare && \
+  \
+  # Build Linux kernel module for Xen Argo
+  cd "${BUILDDIR}" && \
+  git clone \
+      --depth=1 --branch=master \
+      https://github.com/OpenXT/linux-xen-argo.git && \
+  git -C "${BUILDDIR}/linux-xen-argo" switch --detach "${ARGO_SHA}" && \
+  make -C "linux-${LINUX_VERSION}" M="${BUILDDIR}/linux-xen-argo/argo-linux" \
+      CFLAGS_MODULE="-Wno-error" KBUILD_MODPOST_WARN=1 && \
+  cp "linux-xen-argo/argo-linux/xen-argo.ko" "${COPYDIR}/xen-argo.ko" && \
+  \
+  # Build Linux libargo shared library, applying fixes to build in Alpine
+  cd "${BUILDDIR}/linux-xen-argo/libargo" && \
+  sed -i "s|AM_INIT_AUTOMAKE|AC_CONFIG_AUX_DIR(.)\nAM_INIT_AUTOMAKE|" 
configure.ac && \
+  sed -i "s/__SOCKADDR_COMMON (sxenargo_)/sa_family_t sxenargo_family/" 
src/libargo.h && \
+  sed -i "s/__SOCKADDR_COMMON_SIZE/(sizeof (unsigned short int))/" 
src/libargo.h && \
+  autoreconf --install && \
+  ./configure  --prefix="${COPYDIR}" CPPFLAGS="-I${PWD}/../argo-linux/include" 
&& \
+  make && \
+  make install && \
+  \
+  # Build Linux user program, modifying for xilinx argo test
+  cd "${BUILDDIR}" && \
+  wget 
"https://raw.githubusercontent.com/OpenXT/xenclient-oe/${ARGOEXEC_SHA}/recipes-openxt/argo-exec/argo-exec/argo-exec.c";
 && \
+  sed -i "s|#include <xen/xen.h>||" argo-exec.c && \
+  sed -i "s|ret = shuffle(s, fds\[0\], fds\[1\]);|ret = shuffle(s, 0, 1);|" 
argo-exec.c && \
+  gcc -I"${BUILDDIR}/linux-xen-argo/libargo/src" \
+      -I"${BUILDDIR}/linux-xen-argo/argo-linux/include" \
+      -L"${COPYDIR}/lib/" \
+      -o argo-exec argo-exec.c -largo && \
+  cp argo-exec "${COPYDIR}" && \
+  \
+  # Clean up
+  cd /build && \
+  rm -fr linux-"$LINUX_VERSION"* linux-xen-argo argo-exec.c && \
+  \
+  apk del \
+  \
+  musl-dev  \
+  build-base \
+  libc6-compat \
+  linux-headers \
+  bash \
+  git \
+  curl \
+  flex \
+  bison \
+  elfutils-dev \
+  autoconf \
+  automake \
+  libtool
--
2.25.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.