diff mbox series

[1/3] automation: add x86_64 alpine 3.12 test-artifact

Message ID 20211021230839.10794-1-sstabellini@kernel.org (mailing list archive)
State Superseded
Headers show
Series automation: introduce an x86_64 Dom0/DomU test | expand

Commit Message

Stefano Stabellini Oct. 21, 2021, 11:08 p.m. UTC
From: Stefano Stabellini <stefano.stabellini@xilinx.com>

It is the same as the existing ARM64 alpine 3.12 test-artifact. It is
used to export an Alpine rootfs for Dom0 used for testing.

Also add the exporting job to build.yaml so that the binaries can be
used during gitlab-ci runs.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
---
 automation/gitlab-ci/build.yaml               | 13 ++++
 .../tests-artifacts/alpine/3.12.dockerfile    | 68 +++++++++++++++++++
 2 files changed, 81 insertions(+)
 create mode 100644 automation/tests-artifacts/alpine/3.12.dockerfile

Comments

Anthony PERARD Oct. 22, 2021, 12:37 p.m. UTC | #1
On Thu, Oct 21, 2021 at 04:08:37PM -0700, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xilinx.com>
> 
> It is the same as the existing ARM64 alpine 3.12 test-artifact. It is
> used to export an Alpine rootfs for Dom0 used for testing.
> 
> Also add the exporting job to build.yaml so that the binaries can be
> used during gitlab-ci runs.
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xilinx.com>
> ---

Reviewed-by: Anthony PERARD <anthony.perard@citrix.com>

This feels weird to me that we have a container just to share a file,
but I guess that works :-).

Thanks,
Andrew Cooper Oct. 22, 2021, 12:54 p.m. UTC | #2
On 22/10/2021 00:08, Stefano Stabellini wrote:
> +RUN \
> +  # apk
> +  apk update && \
> +  \
> +  # xen runtime deps
> +  apk add musl && \
> +  apk add openrc && \
> +  apk add busybox && \
> +  apk add sudo && \
> +  apk add dbus && \
> +  apk add bash && \
> +  apk add python2 && \
> +  # gettext for Xen < 4.13
> +  apk add gettext && \

Unless we're planning on backporting this to staging-4.13, we can drop
gettext.  (That's the whole point of the comments highlighting version)

~Andrew
Stefano Stabellini Oct. 22, 2021, 8:01 p.m. UTC | #3
On Fri, 22 Oct 2021, Andrew Cooper wrote:
> On 22/10/2021 00:08, Stefano Stabellini wrote:
> > +RUN \
> > +  # apk
> > +  apk update && \
> > +  \
> > +  # xen runtime deps
> > +  apk add musl && \
> > +  apk add openrc && \
> > +  apk add busybox && \
> > +  apk add sudo && \
> > +  apk add dbus && \
> > +  apk add bash && \
> > +  apk add python2 && \
> > +  # gettext for Xen < 4.13
> > +  apk add gettext && \
> 
> Unless we're planning on backporting this to staging-4.13, we can drop
> gettext.  (That's the whole point of the comments highlighting version)

Good point, I'll make the change
diff mbox series

Patch

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index d177da1710..76b73beead 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -596,3 +596,16 @@  qemu-system-aarch64-5.2.0-arm64-export:
   tags:
     - arm64
 
+
+# x86_64 test artifacts
+
+alpine-3.12-rootfs-export:
+  stage: build
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/alpine:3.12
+  script:
+    - mkdir binaries && cp /initrd.tar.gz binaries/initrd.tar.gz
+  artifacts:
+    paths:
+      - binaries/initrd.tar.gz
+  tags:
+    - x86_64
diff --git a/automation/tests-artifacts/alpine/3.12.dockerfile b/automation/tests-artifacts/alpine/3.12.dockerfile
new file mode 100644
index 0000000000..fbc26b9e36
--- /dev/null
+++ b/automation/tests-artifacts/alpine/3.12.dockerfile
@@ -0,0 +1,68 @@ 
+FROM alpine:3.12
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+RUN \
+  # apk
+  apk update && \
+  \
+  # xen runtime deps
+  apk add musl && \
+  apk add openrc && \
+  apk add busybox && \
+  apk add sudo && \
+  apk add dbus && \
+  apk add bash && \
+  apk add python2 && \
+  # gettext for Xen < 4.13
+  apk add gettext && \
+  apk add zlib && \
+  apk add ncurses && \
+  apk add texinfo && \
+  apk add yajl && \
+  apk add libaio && \
+  apk add xz-dev && \
+  apk add util-linux && \
+  apk add argp-standalone && \
+  apk add libfdt && \
+  apk add glib && \
+  apk add pixman && \
+  apk add curl && \
+  apk add udev && \
+  \
+  # Xen
+  cd / && \
+  # Minimal ramdisk environment in case of cpio output
+  rc-update add udev && \
+  rc-update add udev-trigger && \
+  rc-update add udev-settle && \
+  rc-update add networking sysinit && \
+  rc-update add loopback sysinit && \
+  rc-update add bootmisc boot && \
+  rc-update add devfs sysinit && \
+  rc-update add dmesg sysinit && \
+  rc-update add hostname boot && \
+  rc-update add hwclock boot && \
+  rc-update add hwdrivers sysinit && \
+  rc-update add killprocs shutdown && \
+  rc-update add modloop sysinit && \
+  rc-update add modules boot && \
+  rc-update add mount-ro shutdown && \
+  rc-update add savecache shutdown && \
+  rc-update add sysctl boot && \
+  rc-update add local default && \
+  cp -a /sbin/init /init && \
+  echo "ttyS0" >> /etc/securetty && \
+  echo "hvc0" >> /etc/securetty && \
+  echo "ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100" >> /etc/inittab && \
+  echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt100" >> /etc/inittab && \
+  passwd -d "root" root && \
+  \
+  # Create rootfs
+  cd / && \
+  tar cvzf /initrd.tar.gz bin dev etc home init lib mnt opt root sbin usr var