diff --git a/.obs/workflows.yml b/.obs/workflows.yml index ba9fc0072..240926ed1 100644 --- a/.obs/workflows.yml +++ b/.obs/workflows.yml @@ -33,6 +33,10 @@ staging_build: source_project: home:defolos:BCI:CR:16.0 source_package: sle16-kernel-module-devel-image target_project: home:defolos:BCI:CR:16.0:Staging + - branch_package: + source_project: home:defolos:BCI:CR:16.0 + source_package: slm60-kernel-module-devel-image + target_project: home:defolos:BCI:CR:16.0:Staging filters: event: pull_request @@ -74,6 +78,9 @@ refresh_devel_BCI: - trigger_services: project: devel:BCI:16.0 package: sle16-kernel-module-devel-image + - trigger_services: + project: devel:BCI:16.0 + package: slm60-kernel-module-devel-image filters: event: push branches: diff --git a/slm60-kernel-module-devel-image/Dockerfile b/slm60-kernel-module-devel-image/Dockerfile new file mode 100644 index 000000000..41cd18e85 --- /dev/null +++ b/slm60-kernel-module-devel-image/Dockerfile @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: MIT + +# Copyright (c) 2024 SUSE LLC + +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. + +# The content of THIS FILE IS AUTOGENERATED and should not be manually modified. +# It is maintained by the BCI team and generated by +# https://github.com/SUSE/BCI-dockerfile-generator + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# You can contact the BCI team via https://github.com/SUSE/bci/discussions + +#!UseOBSRepositories +#!ExclusiveArch: x86_64 s390x aarch64 +#!BuildTag: bci/bci-slm60-kernel-module-devel:%OS_VERSION_ID_SP%-%RELEASE% +#!BuildTag: bci/bci-slm60-kernel-module-devel:%OS_VERSION_ID_SP% + +FROM bci/bci-base:16.0 + +RUN set -euo pipefail; \ + zypper -n install --no-recommends gcc kmod make patch gawk pesign-obs-integration dwarves libelf-devel SLES-release; \ + zypper -n clean; \ + rm -rf {/target,}/var/log/{alternatives.log,lastlog,tallylog,zypper.log,zypp/history,YaST2} + +# Define labels according to https://en.opensuse.org/Building_derived_containers +# labelprefix=com.suse.bci.slm60-kernel-module-devel +LABEL org.opencontainers.image.authors="https://github.com/SUSE/bci/discussions" +LABEL org.opencontainers.image.title="SLE BCI SUSE Linux Micro 6.0 Kernel module development" +LABEL org.opencontainers.image.description="SUSE Linux Micro 6.0 Kernel module development container based on the SLE Base Container Image." +LABEL org.opencontainers.image.version="%OS_VERSION_ID_SP%-%RELEASE%" +LABEL org.opencontainers.image.url="https://www.suse.com/products/base-container-images/" +LABEL org.opencontainers.image.created="%BUILDTIME%" +LABEL org.opencontainers.image.vendor="SUSE LLC" +LABEL org.opencontainers.image.source="%SOURCEURL%" +LABEL org.opencontainers.image.ref.name="%OS_VERSION_ID_SP%-%RELEASE%" +LABEL org.opensuse.reference="registry.suse.com/bci/bci-slm60-kernel-module-devel:%OS_VERSION_ID_SP%-%RELEASE%" +LABEL org.openbuildservice.disturl="%DISTURL%" +LABEL com.suse.supportlevel="techpreview" +LABEL com.suse.eula="sle-bci" +LABEL com.suse.lifecycle-url="https://www.suse.com/lifecycle" +LABEL com.suse.release-stage="beta" +# endlabelprefix +LABEL io.artifacthub.package.readme-url="%SOURCEURL%/README.md" +LABEL io.artifacthub.package.logo-url="https://opensource.suse.com/bci/SLE_BCI_logomark_green.svg" +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/kernel-devel-6.4.0-17.1.noarch.rpm +COPY kernel-devel-6.4.0-17.1.noarch.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/kernel-macros-6.4.0-17.1.noarch.rpm +COPY kernel-macros-6.4.0-17.1.noarch.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/kernel-syms-6.4.0-17.1.x86_64.rpm +COPY kernel-syms-6.4.0-17.1.x86_64.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/kernel-default-devel-6.4.0-17.1.x86_64.rpm +COPY kernel-default-devel-6.4.0-17.1.x86_64.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/aarch64/patchinfo.ga/kernel-syms-6.4.0-17.1.aarch64.rpm +COPY kernel-syms-6.4.0-17.1.aarch64.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/aarch64/patchinfo.ga/kernel-default-devel-6.4.0-17.1.aarch64.rpm +COPY kernel-default-devel-6.4.0-17.1.aarch64.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/aarch64/patchinfo.ga/kernel-64kb-devel-6.4.0-17.1.aarch64.rpm +COPY kernel-64kb-devel-6.4.0-17.1.aarch64.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/s390x/patchinfo.ga/kernel-syms-6.4.0-17.1.s390x.rpm +COPY kernel-syms-6.4.0-17.1.s390x.rpm . +#!RemoteAssetUrl: https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/s390x/patchinfo.ga/kernel-default-devel-6.4.0-17.1.s390x.rpm +COPY kernel-default-devel-6.4.0-17.1.s390x.rpm . +RUN set -euo pipefail; \ + [ $(LC_ALL=C rpm --checksig -v *rpm | \ + grep -c -E "^ *V3.*key ID 09d9ea69:") = 9 ] \ + && rpm -Uvh --oldpackage --force *.$(uname -m).rpm *.noarch.rpm \ + && rm -vf *.rpm \ + && rpmqpack | grep -E '^kernel-' | xargs zypper -n addlock diff --git a/slm60-kernel-module-devel-image/README.md b/slm60-kernel-module-devel-image/README.md new file mode 100644 index 000000000..8a9fe74e1 --- /dev/null +++ b/slm60-kernel-module-devel-image/README.md @@ -0,0 +1,67 @@ +# SUSE Linux Micro 6.0 GA Kernel Module Development Container +![Redistributable](https://img.shields.io/badge/Redistributable-Yes-green)![Support Level](https://img.shields.io/badge/Support_Level-techpreview-blue) +[![SLSA](https://img.shields.io/badge/SLSA_(v0.1)-Level_4-Green)](https://documentation.suse.com/sbp/server-linux/html/SBP-SLSA4/) +[![Provenance: Available](https://img.shields.io/badge/Provenance-Available-Green)](https://documentation.suse.com/container/all/html/Container-guide/index.html#container-verify) + +## Description + +Th Kernel Module Development Container Image includes all necessary tools to build kernel +modules for SUSE Linux Micro 6.0. It is intended to be used for building out-of-tree kernel +modules in restricted environments. + + +## Usage + +The image can be used to launch a container and build a kernel +module. The following example below shows how to do this for the DRBD kernel module: +```ShellSession +$ podman run --rm -it --name drbd-build registry.suse.com/bci/bci-slm60-kernel-module-devel:16.0 +# zypper -n in coccinelle tar +# curl -Lsf -o - https://pkg.linbit.com/downloads/drbd/9/drbd-9.2.11.tar.gz | tar xzf - +# cd drbd-9.2.11/ +# make -C drbd all KDIR=/usr/src/linux-obj/$(uname -m)/default +``` + +The built kernel module is then available in +`/drbd-9.2.11/drbd/build-current/drbd.ko`. It can be copied to the host system +as follows: +```ShellSession +$ podman cp drbd-build:/drbd-9.2.11/drbd/build-current/drbd.ko . +$ sudo modprobe drbd.ko +``` + +Alternatively, the kernel module can be built as part of a container build using +a `Dockerfile`: + +```Dockerfile +FROM registry.suse.com/bci/bci-slm60-kernel-module-devel:16.0 +ENV DRBD_VERSION=9.2.11 +WORKDIR /src/ +RUN zypper -n in coccinelle tar + +RUN set -euxo pipefail; \ + curl -Lsf -o - https://pkg.linbit.com/downloads/drbd/9/drbd-${DRBD_VERSION}.tar.gz | tar xzf - ; \ + cd drbd-${DRBD_VERSION}; \ + make -C drbd all KDIR=/usr/src/linux-obj/$(uname -m)/default +``` + +Build the container image, launch the container, and copy the kernel module to +the local machine: +```ShellSession +$ buildah bud --layers -t drbd-ko . +$ podman run --name drbd drbd-ko +$ podman cp drbd:/src/drbd-9.2.11/drbd/build-current/drbd.ko . +$ podman rm drbd +``` + +## Licensing + +`SPDX-License-Identifier: MIT` + +This documentation and the build recipe are licensed as MIT. +The container itself contains various software components under various open source licenses listed in the associated +Software Bill of Materials (SBOM). + +This image is a tech preview. Do not use it for production. +Your feedback is welcome. +Please report any issues to the [SUSE Bugzilla](https://bugzilla.suse.com/enter_bug.cgi?product=SUSE%20Linux%20Enterprise%20Base%20Container%20Images). diff --git a/slm60-kernel-module-devel-image/_constraints b/slm60-kernel-module-devel-image/_constraints new file mode 100644 index 000000000..6213041ce --- /dev/null +++ b/slm60-kernel-module-devel-image/_constraints @@ -0,0 +1,7 @@ + + + + 8 + + + diff --git a/slm60-kernel-module-devel-image/_service b/slm60-kernel-module-devel-image/_service new file mode 100644 index 000000000..053a4f4f8 --- /dev/null +++ b/slm60-kernel-module-devel-image/_service @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/slm60-kernel-module-devel-image/slm60-kernel-module-devel-image.changes b/slm60-kernel-module-devel-image/slm60-kernel-module-devel-image.changes new file mode 100644 index 000000000..7967dba7d --- /dev/null +++ b/slm60-kernel-module-devel-image/slm60-kernel-module-devel-image.changes @@ -0,0 +1,4 @@ +------------------------------------------------------------------- +Fri Nov 15 16:41:17 UTC 2024 - SUSE Update Bot + +- First version of the SUSE Linux Micro 6.0 Kernel module development BCI