Skip to content

Commit 372da42

Browse files
committed
Add a SL Micro 6.0 GA kernel module development container
1 parent 50e6110 commit 372da42

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

src/bci_build/package/basecontainers.py

+48-4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@
105105
]
106106

107107

108+
def _get_asset_script(baseurl: str, binaries: list[str]) -> str:
109+
return "".join(
110+
f"#!RemoteAssetUrl: {baseurl}{binary}\nCOPY {os.path.basename(binary)} .\n"
111+
for binary in binaries
112+
).strip()
113+
114+
108115
def _get_fips_base_custom_end(os_version: OsVersion) -> str:
109116
bins: list[str] = []
110117
custom_set_fips_mode: str = (
@@ -131,10 +138,7 @@ def _get_fips_base_custom_end(os_version: OsVersion) -> str:
131138
)
132139

133140
return (
134-
"".join(
135-
f"#!RemoteAssetUrl: {_FIPS_ASSET_BASEURL}{binary}\nCOPY {os.path.basename(binary)} .\n"
136-
for binary in bins
137-
).strip()
141+
_get_asset_script(_FIPS_ASSET_BASEURL, bins)
138142
+ (custom_install_bins if bins else "")
139143
+ (custom_set_fips_mode if os_version not in (OsVersion.SP3,) else "")
140144
)
@@ -330,6 +334,46 @@ def _get_minimal_kwargs(os_version: OsVersion):
330334
)
331335

332336

337+
# SL Micro 6.0 GA kernel container devel
338+
_SLM60_BASEURL = "https://api.opensuse.org/public/build/SUSE:ALP:Source:Standard:Core:1.0:Build/standard/x86_64/patchinfo.ga/"
339+
_SLM60_KERNEL_PACKAGES = [
340+
"kernel-syms-6.4.0-17.1.x86_64.rpm",
341+
"kernel-devel-6.4.0-17.1.noarch.rpm",
342+
]
343+
KERNEL_MODULE_CONTAINERS.append(
344+
OsContainer(
345+
name="slm60-kernel-module-devel",
346+
pretty_name="SUSE Linux Micro 6.0 Kernel module development",
347+
logo_url="https://opensource.suse.com/bci/SLE_BCI_logomark_green.svg",
348+
os_version=OsVersion.SLE16_0,
349+
supported_until=_SUPPORTED_UNTIL_SLE.get(os_version),
350+
is_latest=os_version in CAN_BE_LATEST_OS_VERSION,
351+
package_list=(
352+
[
353+
"gcc",
354+
"kmod",
355+
"make",
356+
"patch",
357+
"gawk",
358+
"rpm-build",
359+
*os_version.release_package_names,
360+
]
361+
),
362+
extra_files={"_constraints": generate_disk_size_constraints(8)},
363+
custom_end=_get_asset_script(_SLM60_BASEURL, _SLM60_KERNEL_PACKAGES)
364+
+ textwrap.dedent(
365+
f"""
366+
{DOCKERFILE_RUN} \\
367+
[ $(LC_ALL=C rpm --checksig -v *rpm | \\
368+
grep -c -E "^ *V3.*key ID 39db7c82: OK") = {len(_SLM60_KERNEL_PACKAGES)} ] \\
369+
&& rpm -Uvh --oldpackage --force *.rpm \\
370+
&& rm -vf *.rpm \\
371+
&& rpmqpack | grep -E '^kernel-' | xargs zypper -n addlock\n"""
372+
),
373+
)
374+
)
375+
376+
333377
OSC_CHECKOUT = (Path(__file__).parent / "gitea-runner" / "osc_checkout").read_bytes()
334378

335379
GITEA_RUNNER_CONTAINER = OsContainer(

0 commit comments

Comments
 (0)