diff mbox series

[1/2] automation: build 6.1.19 kernel for x86-64 dom0

Message ID 59ced41c97daac93abe4a2794af289d59808f0ac.1679023966.git-series.marmarek@invisiblethingslab.com (mailing list archive)
State Superseded
Headers show
Series automation: add another Gitlab-CI test, x86-64 S3 this time | expand

Commit Message

Marek Marczykowski-Górecki March 17, 2023, 3:34 a.m. UTC
It will be used in tests added in subsequent patches.
Enable config options needed for those tests.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
 automation/gitlab-ci/build.yaml                     | 11 ++++-
 automation/tests-artifacts/kernel/6.1.19.dockerfile | 40 ++++++++++++++-
 2 files changed, 51 insertions(+)
 create mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile

Comments

Stefano Stabellini March 17, 2023, 10:01 p.m. UTC | #1
On Fri, 17 Mar 2023, Marek Marczykowski-Górecki wrote:
> It will be used in tests added in subsequent patches.
> Enable config options needed for those tests.

Thanks for the patch! Looks great.

Can you also remove the old 5.10.74 Dockerfile
(automation/tests-artifacts/kernel/5.10.74.dockerfile), the
kernel-5.10.74-export job as well and replace kernel-5.10.74-export with
kernel-6.1.19-export as dependency for the qemu-alpine-x86_64-gcc test
job?

I think it makes sense to just keep kernel-6.1.19-export. I tested the
below already and it works fine.

diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml
index 2e1a6886df..f28c01fe0e 100644
--- a/automation/gitlab-ci/test.yaml
+++ b/automation/gitlab-ci/test.yaml
@@ -269,7 +269,7 @@ qemu-alpine-x86_64-gcc:
   needs:
     - alpine-3.12-gcc
     - alpine-3.12-rootfs-export
-    - kernel-5.10.74-export
+    - kernel-6.1.19-export



> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
>  automation/gitlab-ci/build.yaml                     | 11 ++++-
>  automation/tests-artifacts/kernel/6.1.19.dockerfile | 40 ++++++++++++++-
>  2 files changed, 51 insertions(+)
>  create mode 100644 automation/tests-artifacts/kernel/6.1.19.dockerfile
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index 38bb22d8609b..e1799d454c76 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -790,3 +790,14 @@ kernel-5.10.74-export:
>        - binaries/bzImage
>    tags:
>      - x86_64
> +
> +kernel-6.1.19-export:
> +  extends: .test-jobs-artifact-common
> +  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
> +  script:
> +    - mkdir binaries && cp /bzImage binaries/bzImage
> +  artifacts:
> +    paths:
> +      - binaries/bzImage
> +  tags:
> +    - x86_64
> diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
> new file mode 100644
> index 000000000000..c2171555a0a6
> --- /dev/null
> +++ b/automation/tests-artifacts/kernel/6.1.19.dockerfile
> @@ -0,0 +1,40 @@
> +FROM debian:unstable
> +LABEL maintainer.name="The Xen Project" \
> +      maintainer.email="xen-devel@lists.xenproject.org"
> +
> +ENV DEBIAN_FRONTEND=noninteractive
> +ENV LINUX_VERSION=6.1.19
> +ENV USER root
> +
> +RUN mkdir /build
> +WORKDIR /build
> +
> +# build depends
> +RUN apt-get update && \
> +    apt-get --quiet --yes install \
> +        build-essential \
> +        libssl-dev \
> +        bc \
> +        curl \
> +        flex \
> +        bison \
> +        libelf-dev \
> +        && \
> +    apt-get autoremove -y && \
> +    apt-get clean && \
> +    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
> +
> +# Build the kernel
> +RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
> +    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
> +    cd linux-"$LINUX_VERSION" && \
> +    make defconfig && \
> +    make xen.config && \
> +    scripts/config --enable BRIDGE && \
> +    scripts/config --enable IGC && \
> +    cp .config .config.orig && \
> +    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
> +    make -j$(nproc) bzImage && \
> +    cp arch/x86/boot/bzImage / && \
> +    cd /build && \
> +    rm -rf linux-"$LINUX_VERSION"*
> -- 
> git-series 0.9.1
>
Marek Marczykowski-Górecki March 25, 2023, 3:55 p.m. UTC | #2
On Fri, Mar 17, 2023 at 03:01:14PM -0700, Stefano Stabellini wrote:
> On Fri, 17 Mar 2023, Marek Marczykowski-Górecki wrote:
> > It will be used in tests added in subsequent patches.
> > Enable config options needed for those tests.
> 
> Thanks for the patch! Looks great.
> 
> Can you also remove the old 5.10.74 Dockerfile
> (automation/tests-artifacts/kernel/5.10.74.dockerfile), the
> kernel-5.10.74-export job as well and replace kernel-5.10.74-export with
> kernel-6.1.19-export as dependency for the qemu-alpine-x86_64-gcc test
> job?
> 
> I think it makes sense to just keep kernel-6.1.19-export. I tested the
> below already and it works fine.

I'll adjust this patch as suggested, but generally, I think it's worth
keeping some tests on older kernel to detect regressions (for example in
API not used anymore by newer kernels). That said, it's probably more
beneficial to "simply" test specific older (but still supported)
distribution [kernel], not a custom build of an older version. And
adding that would be a separate patch.
diff mbox series

Patch

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index 38bb22d8609b..e1799d454c76 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -790,3 +790,14 @@  kernel-5.10.74-export:
       - binaries/bzImage
   tags:
     - x86_64
+
+kernel-6.1.19-export:
+  extends: .test-jobs-artifact-common
+  image: registry.gitlab.com/xen-project/xen/tests-artifacts/kernel:6.1.19
+  script:
+    - mkdir binaries && cp /bzImage binaries/bzImage
+  artifacts:
+    paths:
+      - binaries/bzImage
+  tags:
+    - x86_64
diff --git a/automation/tests-artifacts/kernel/6.1.19.dockerfile b/automation/tests-artifacts/kernel/6.1.19.dockerfile
new file mode 100644
index 000000000000..c2171555a0a6
--- /dev/null
+++ b/automation/tests-artifacts/kernel/6.1.19.dockerfile
@@ -0,0 +1,40 @@ 
+FROM debian:unstable
+LABEL maintainer.name="The Xen Project" \
+      maintainer.email="xen-devel@lists.xenproject.org"
+
+ENV DEBIAN_FRONTEND=noninteractive
+ENV LINUX_VERSION=6.1.19
+ENV USER root
+
+RUN mkdir /build
+WORKDIR /build
+
+# build depends
+RUN apt-get update && \
+    apt-get --quiet --yes install \
+        build-essential \
+        libssl-dev \
+        bc \
+        curl \
+        flex \
+        bison \
+        libelf-dev \
+        && \
+    apt-get autoremove -y && \
+    apt-get clean && \
+    rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
+
+# Build the kernel
+RUN curl -fsSLO https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-"$LINUX_VERSION".tar.xz && \
+    tar xvJf linux-"$LINUX_VERSION".tar.xz && \
+    cd linux-"$LINUX_VERSION" && \
+    make defconfig && \
+    make xen.config && \
+    scripts/config --enable BRIDGE && \
+    scripts/config --enable IGC && \
+    cp .config .config.orig && \
+    cat .config.orig | grep XEN | grep =m |sed 's/=m/=y/g' >> .config && \
+    make -j$(nproc) bzImage && \
+    cp arch/x86/boot/bzImage / && \
+    cd /build && \
+    rm -rf linux-"$LINUX_VERSION"*