Skip to content

Commit

Permalink
Add a SL Micro 6.0 GA kernel module development container
Browse files Browse the repository at this point in the history
  • Loading branch information
dirkmueller committed Nov 15, 2024
1 parent 50e6110 commit 1941568
Showing 1 changed file with 57 additions and 4 deletions.
61 changes: 57 additions & 4 deletions src/bci_build/package/basecontainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,13 @@
]


def _get_asset_script(baseurl: str, binaries: list[str]) -> str:
return "".join(
f"#!RemoteAssetUrl: {baseurl}{binary}\nCOPY {os.path.basename(binary)} .\n"
for binary in binaries
).strip()


def _get_fips_base_custom_end(os_version: OsVersion) -> str:
bins: list[str] = []
custom_set_fips_mode: str = (
Expand All @@ -131,10 +138,7 @@ def _get_fips_base_custom_end(os_version: OsVersion) -> str:
)

return (
"".join(
f"#!RemoteAssetUrl: {_FIPS_ASSET_BASEURL}{binary}\nCOPY {os.path.basename(binary)} .\n"
for binary in bins
).strip()
_get_asset_script(_FIPS_ASSET_BASEURL, bins)
+ (custom_install_bins if bins else "")
+ (custom_set_fips_mode if os_version not in (OsVersion.SP3,) else "")
)
Expand Down Expand Up @@ -330,6 +334,55 @@ def _get_minimal_kwargs(os_version: OsVersion):
)


# SL Micro 6.0 GA kernel container devel
_SLM60_BASEURL = "https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/"
_SLM60_KERNEL_PACKAGES = [
"kernel-devel-6.4.0-17.1.noarch.rpm",
"kernel-macros-6.4.0-17.1.noarch.rpm",
"kernel-syms-6.4.0-17.1.x86_64.rpm",
"kernel-default-devel-6.4.0-17.1.x86_64.rpm",
"kernel-syms-6.4.0-17.1.aarch64.rpm",
"kernel-default-devel-6.4.0-17.1.aarch64.rpm",
"kernel-syms-6.4.0-17.1.s390x.rpm",
"kernel-default-devel-6.4.0-17.1.s390x.rpm",
]
KERNEL_MODULE_CONTAINERS.append(
OsContainer(
name="slm60-kernel-module-devel",
pretty_name="SUSE Linux Micro 6.0 Kernel module development",
logo_url="https://opensource.suse.com/bci/SLE_BCI_logomark_green.svg",
os_version=OsVersion.SLE16_0,
supported_until=_SUPPORTED_UNTIL_SLE.get(os_version),
is_latest=OsVersion.SLE16_0 in CAN_BE_LATEST_OS_VERSION,
package_list=(
[
"gcc",
"kmod",
"make",
"patch",
"gawk",
"pesign-obs-integration",
"dwarves",
"libelf-utils",
*OsVersion.SLE16_0.release_package_names,
]
),
exclusive_arch=[Arch.X86_64, Arch.S390X, Arch.AARCH64],
extra_files={"_constraints": generate_disk_size_constraints(8)},
custom_end=_get_asset_script(_SLM60_BASEURL, _SLM60_KERNEL_PACKAGES)
+ textwrap.dedent(
f"""
{DOCKERFILE_RUN} \\
[ $(LC_ALL=C rpm --checksig -v *rpm | \\
grep -c -E "^ *V3.*key ID 09d9ea69: OK") = {len(_SLM60_KERNEL_PACKAGES)} ] \\
&& rpm -Uvh --oldpackage --force *.$(uname -m).rpm *.noarch.rpm \\
&& rm -vf *.rpm \\
&& rpmqpack | grep -E '^kernel-' | xargs zypper -n addlock\n"""
),
)
)


OSC_CHECKOUT = (Path(__file__).parent / "gitea-runner" / "osc_checkout").read_bytes()

GITEA_RUNNER_CONTAINER = OsContainer(
Expand Down

0 comments on commit 1941568

Please sign in to comment.