diff --git a/5001-Add-OpenCloudOS-runners.patch b/5001-Add-OpenCloudOS-runners.patch new file mode 100644 index 0000000000000000000000000000000000000000..2f42deef601f2cd69dd9ead7d5288ace175c74e3 --- /dev/null +++ b/5001-Add-OpenCloudOS-runners.patch @@ -0,0 +1,80 @@ +diff --git a/runners/org.osbuild.opencloudos8 b/runners/org.osbuild.opencloudos8 +new file mode 100644 +index 0000000..7e3ccb8 +--- /dev/null ++++ b/runners/org.osbuild.opencloudos8 +@@ -0,0 +1,22 @@ ++#!/usr/libexec/platform-python ++# osbuild runner for OpenCloudOS 8.x. ++ ++import subprocess ++import sys ++ ++from osbuild import api ++from osbuild.util import runners ++ ++if __name__ == "__main__": ++ with api.exception_handler(): ++ runners.ldconfig() ++ runners.sysusers() ++ with runners.create_machine_id_if_needed(): ++ runners.tmpfiles() ++ runners.nsswitch() ++ runners.sequoia() ++ runners.python_alternatives() ++ env = runners.quirks() ++ r = subprocess.run(sys.argv[1:], env=env, check=False) ++ ++ sys.exit(r.returncode) +diff --git a/runners/org.osbuild.opencloudos9 b/runners/org.osbuild.opencloudos9 +new file mode 100644 +index 0000000..c341854 +--- /dev/null ++++ b/runners/org.osbuild.opencloudos9 +@@ -0,0 +1,21 @@ ++#!/usr/bin/python3 ++# osbuild runner for OpenCloudOS 9.x. ++# ++ ++import subprocess ++import sys ++ ++from osbuild import api ++from osbuild.util import runners ++ ++if __name__ == "__main__": ++ with api.exception_handler(): ++ runners.ldconfig() ++ runners.sysusers() ++ with runners.create_machine_id_if_needed(): ++ runners.tmpfiles() ++ runners.nsswitch() ++ runners.sequoia() ++ r = subprocess.run(sys.argv[1:], check=False) ++ ++ sys.exit(r.returncode) +diff --git a/runners/org.osbuild.opencloudosstream b/runners/org.osbuild.opencloudosstream +new file mode 100644 +index 0000000..2d0b819 +--- /dev/null ++++ b/runners/org.osbuild.opencloudosstream +@@ -0,0 +1,19 @@ ++#!/usr/bin/python3 ++ ++import subprocess ++import sys ++ ++from osbuild import api ++from osbuild.util import runners ++ ++if __name__ == "__main__": ++ with api.exception_handler(): ++ runners.ldconfig() ++ runners.sysusers() ++ with runners.create_machine_id_if_needed(): ++ runners.tmpfiles() ++ runners.nsswitch() ++ runners.sequoia() ++ r = subprocess.run(sys.argv[1:], check=False) ++ ++ sys.exit(r.returncode) diff --git a/osbuild.spec b/osbuild.spec index 75b8262965384df2d717f3fa52cd2322a8851ce3..f5facf3b2878192405532c4641ec35a35cff3139 100644 --- a/osbuild.spec +++ b/osbuild.spec @@ -1,29 +1,50 @@ +%global forgeurl https://github.com/osbuild/osbuild %global selinuxtype targeted + +Version: 183 +%global osbuild_initrd_version 0.1 + +%forgemeta + %global pypi_name osbuild %global pkgdir %{_prefix}/lib/%{pypi_name} -%global __requires_exclude_from ^%{pkgdir}/(runners)/.*$ -%global __brp_mangle_shebangs_exclude_from ^%{pkgdir}/(assemblers|runners|stages)/.*$ +%global debug_package %{nil} -Summary: A build system for OS images Name: %{pypi_name} -Version: 115 -Release: 3%{?dist} +Release: 1%{?dist} License: Apache-2.0 -URL: https://github.com/osbuild/osbuild/archive/refs/tags/v%{version}.tar.gz +URL: %{forgeurl} + +Source0: %{forgesource} +Source1: https://github.com/osbuild/initrd/releases/download/%{osbuild_initrd_version}/osbuild-initrd-%{osbuild_initrd_version}.tar.gz + +# OpenCloudOS runner files — one runner per major/product line: +# runners/org.osbuild.opencloudos8 (OCS 8.x) +# runners/org.osbuild.opencloudos9 (OCS 9.x) +# runners/org.osbuild.opencloudosstream (OCS Stream) +# Required by osbuild-composer >= 165 to drive OCS image composes. +Patch5001: 5001-Add-OpenCloudOS-runners.patch -Source0: osbuild-%{version}.tar.gz -BuildArch: noarch +Summary: A build system for OS images + +ExcludeArch: i686 BuildRequires: make BuildRequires: python3-devel BuildRequires: python3-docutils +BuildRequires: python3-setuptools BuildRequires: systemd +BuildRequires: python3-iniparse +BuildRequires: python3-jsonschema +BuildRequires: python3-kickstart +BuildRequires: python3-mako +BuildRequires: python3-PyYAML +BuildRequires: python3-pytest Requires: bash Requires: bubblewrap Requires: coreutils Requires: curl -Requires: dnf Requires: e2fsprogs Requires: glibc Requires: policycoreutils @@ -34,8 +55,15 @@ Requires: tar Requires: util-linux Requires: python3-%{pypi_name} = %{version}-%{release} Requires: (%{name}-selinux if selinux-policy-%{selinuxtype}) +Requires: python3-librepo +Requires: %{name}-initrd = %{version}-%{release} +# Turn off dependency generators for runners — runner shebangs are tailored +# to the platform of the image being built, not the build host. %global __requires_exclude_from ^%{pkgdir}/(runners)/.*$ + +# Turn off shebang mangling for runners, stages and assemblers — these run +# inside osbuild build roots and must keep the shebang of the target image. %global __brp_mangle_shebangs_exclude_from ^%{pkgdir}/(assemblers|runners|stages)/.*$ %{?python_enable_dependency_generator} @@ -78,11 +106,18 @@ Requires: rpm-ostree Contains the necessary stages, assembler and source to build OSTree based images. +%package initrd +Summary: osbuild initrd for vm support +BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang} + +%description initrd +Osbuild initrd used for in-vm support. + %package selinux Summary: SELinux policies Requires: %{name} = %{version}-%{release} -Requires: selinux-policy-%{selinuxtype} -Requires(post): selinux-policy-%{selinuxtype} +Requires: selinux-policy-%{selinuxtype} >= %{_selinux_policy_version} +Requires(post): selinux-policy-%{selinuxtype} >= %{_selinux_policy_version} BuildRequires: selinux-policy-devel %{?selinux_requires} @@ -91,10 +126,24 @@ Contains the necessary SELinux policies that allows osbuild to use labels unknown to the host inside the containers it uses to build OS artifacts. +%package container-selinux +Summary: SELinux container policies +Requires: selinux-policy-%{selinuxtype} >= %{_selinux_policy_version} +Requires: container-selinux +Requires(post): selinux-policy-%{selinuxtype} >= %{_selinux_policy_version} +Requires(post): container-selinux +BuildRequires: selinux-policy-devel +%{?selinux_requires} + +%description container-selinux +Contains the necessary SELinux policies that allows +running osbuild in a container. + %package tools Summary: Extra tools and utilities Requires: %{name} = %{version}-%{release} Requires: python3-pyyaml +Requires: python3-dnf %description tools Contains additional tools and utilities for development of @@ -103,30 +152,52 @@ manifests and osbuild. %package depsolve-dnf Summary: Dependency solving support for DNF Requires: %{name} = %{version}-%{release} +Requires: python3-dnf -Requires: python3-libdnf +# osbuild 125 added a new "solver" field and osbuild-composer only +# supports this since 116 +Conflicts: osbuild-composer <= 115 + +# XXX: remove this once the osbuild-dnf-json V1 API is removed (osbuild/solver/api/v1.py) +Provides: osbuild-dnf-json-api = 8 %description depsolve-dnf Contains depsolving capabilities for package managers. +%package virt-deps +Summary: Dependencies required for running osbuild pipelines in a VM. +Requires: %{name} = %{version}-%{release} +Requires: qemu-kvm +Requires: virtiofsd + +%description virt-deps +Dependencies required for running osbuild pipelines in a VM. + %prep -%autosetup -n %{name}-%{version} -# patch for opencloudos -ln -rs %{_builddir}/%{name}-%{version}/runners/org.osbuild.linux %{_builddir}/%{name}-%{version}/runners/org.osbuild.opencloudos90 -ln -rs %{_builddir}/%{name}-%{version}/runners/org.osbuild.linux %{_builddir}/%{name}-%{version}/runners/org.osbuild.opencloudos -ln -rs %{_builddir}/%{name}-%{version}/runners/org.osbuild.rhel82 %{_builddir}/%{name}-%{version}/runners/org.osbuild.opencloudos86 -ln -rs %{_builddir}/%{name}-%{version}/runners/org.osbuild.rhel82 %{_builddir}/%{name}-%{version}/runners/org.osbuild.opencloudos88 +%forgeautosetup -p1 +tar xf %SOURCE1 %build %py3_build make man +(cd osbuild-initrd-%{osbuild_initrd_version}; make build) # SELinux make -f /usr/share/selinux/devel/Makefile osbuild.pp bzip2 -9 osbuild.pp +make -f /usr/share/selinux/devel/Makefile osbuild-container.pp +bzip2 -9 osbuild-container.pp + +%pre selinux +%selinux_relabel_pre -s %{selinuxtype} + %install %py3_install +(cd osbuild-initrd-%{osbuild_initrd_version}; %make_install) + +# Ensure vm.py is executable which is needed to run in with init= in the vm +chmod 0755 %{buildroot}%{python3_sitelib}/%{pypi_name}/vm.py mkdir -p %{buildroot}%{pkgdir}/stages install -p -m 0755 $(find stages -type f -not -name "test_*.py") %{buildroot}%{pkgdir}/stages/ @@ -165,31 +236,80 @@ install -p -m 0644 -t %{buildroot}%{_mandir}/man5/ docs/*.5 # SELinux install -D -m 0644 -t %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype} %{name}.pp.bz2 +install -D -m 0644 -t %{buildroot}%{_datadir}/selinux/packages/%{selinuxtype} %{name}-container.pp.bz2 install -D -m 0644 -t %{buildroot}%{_mandir}/man8 selinux/%{name}_selinux.8 install -D -p -m 0644 selinux/osbuild.if %{buildroot}%{_datadir}/selinux/devel/include/distributed/%{name}.if # Udev rules mkdir -p %{buildroot}%{_udevrulesdir} -install -p -m 0755 data/10-osbuild-inhibitor.rules %{buildroot}%{_udevrulesdir} -mkdir -p %{buildroot}%{_libexecdir} -install -p -m 0755 tools/osbuild-depsolve-dnf %{buildroot}%{_libexecdir}/osbuild-depsolve-dnf +install -p -m 0644 data/10-osbuild-inhibitor.rules %{buildroot}%{_udevrulesdir} -%check -exit 0 +# osbuild-dev is an upstream developer-only helper; not shipped. +rm %{buildroot}%{_bindir}/osbuild-dev -%pre selinux -%selinux_relabel_pre -s %{selinuxtype} -%post selinux -%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 +# Install `osbuild-depsolve-dnf` into libexec +mkdir -p %{buildroot}%{_libexecdir} +install -p -m 0755 tools/osbuild-depsolve-dnf %{buildroot}%{_libexecdir}/osbuild-depsolve-dnf -%postun selinux -if [ $1 -eq 0 ]; then - %selinux_modules_uninstall -s %{selinuxtype} %{name} -fi +# Install `osbuild-store` into libexec +install -p -m 0755 tools/osbuild-store %{buildroot}%{_libexecdir}/osbuild-store -%posttrans selinux -%selinux_relabel_post -s %{selinuxtype} +# Configure the DNF solver +mkdir -p %{buildroot}%{_datadir}/osbuild +install -p -m 0644 tools/solver-dnf.json %{buildroot}%{pkgdir}/solver.json +%check +# Pipeline tests under test/run/ need root and are not run here. +ignore_files=(test/run) +skip_tests=() + +# x86_64-specific tests: +# test/mod/test_util_sbom_spdx.py +# test/mod/test_util_sbom_dnf.py +# test/mod/test_testutil_dnf4.py +# test/mod/test_solver_implementations.py +%ifnarch x86_64 +ignore_files+=( + test/mod/test_util_sbom_spdx.py + test/mod/test_util_sbom_dnf.py + test/mod/test_testutil_dnf4.py + test/mod/test_solver_implementations.py +) +%endif + +# fails on ppc64le and aarch64: +# test_cache_full_behavior +%ifarch ppc64le || aarch64 +skip_tests+=( + test_cache_full_behavior +) +%endif + +# fails on OCS 9 (no python3-tomli-w in build roots): +# tools/test/test_depsolve.py +# test_dnf4_pkg_to_package - https://github.com/osbuild/osbuild/issues/2339 +ignore_files+=( + tools/test/test_depsolve.py +) +skip_tests+=( + test_dnf4_pkg_to_package +) + +ignore_args=() +for file in "${ignore_files[@]}"; do + ignore_args+=(--ignore "$file") +done + +skip_test_expr="" +for test in "${skip_tests[@]}"; do + if [ "$skip_test_expr" != "" ]; then + skip_test_expr+=" and not $test" + else + skip_test_expr+="not $test" + fi +done + +%pytest -v -m "not tomlwrite" ${ignore_args[@]} -k "${skip_test_expr}" %files %license LICENSE @@ -198,6 +318,7 @@ fi %{_mandir}/man5/%{name}-manifest.5* %{_datadir}/osbuild/schemas %{pkgdir} +%exclude %{pkgdir}/initrd %{_udevrulesdir}/*.rules # the following files are in the lvm2 sub-package %exclude %{pkgdir}/devices/org.osbuild.lvm2* @@ -213,6 +334,8 @@ fi %exclude %{pkgdir}/stages/org.osbuild.ostree* %exclude %{pkgdir}/stages/org.osbuild.experimental.ostree* %exclude %{pkgdir}/stages/org.osbuild.rpm-ostree +# the following file is in the depsolve-dnf sub-package +%exclude %{pkgdir}/solver.json %files -n python3-%{pypi_name} %license LICENSE @@ -220,6 +343,9 @@ fi %{python3_sitelib}/%{pypi_name}-*.egg-info/ %{python3_sitelib}/%{pypi_name}/ +%files initrd +%{pkgdir}/initrd + %files lvm2 %{pkgdir}/devices/org.osbuild.lvm2* %{pkgdir}/stages/org.osbuild.lvm2* @@ -243,14 +369,47 @@ fi %{_datadir}/selinux/devel/include/distributed/%{name}.if %ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name} +%post selinux +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}.pp.bz2 + +%postun selinux +if [ $1 -eq 0 ]; then + %selinux_modules_uninstall -s %{selinuxtype} %{name} +fi + +%posttrans selinux +%selinux_relabel_post -s %{selinuxtype} + +%files container-selinux +%{_datadir}/selinux/packages/%{selinuxtype}/%{name}-container.pp.bz2 +%ghost %verify(not md5 size mode mtime) %{_sharedstatedir}/selinux/%{selinuxtype}/active/modules/200/%{name}-container + +%post container-selinux +%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/%{selinuxtype}/%{name}-container.pp.bz2 + +%postun container-selinux +if [ $1 -eq 0 ]; then + %selinux_modules_uninstall -s %{selinuxtype} %{name}-container +fi + %files tools +%{_bindir}/osbuild-image-info %{_bindir}/osbuild-mpp -%{_bindir}/osbuild-dev +%{_libexecdir}/osbuild-store %files depsolve-dnf %{_libexecdir}/osbuild-depsolve-dnf +%{pkgdir}/solver.json + +%files virt-deps %changelog +* Mon Jun 01 2026 zeyouliu - 183-1 +- [Type] sync +- [DESC] Upgrade osbuild from v115 to upstream v183. +- Add OpenCloudOS anchor runner files via 5001-Add-OpenCloudOS-runners.patch +- New sub-packages introduced by upstream since v115: initrd, depsolve-dnf, virt-deps, tools, container-selinux. + * Mon May 11 2026 bbrucezhang - 115-3 - [Type] sync - [DESC] Rebuilt @@ -266,4 +425,3 @@ fi * Wed Mar 13 2024 Fanjun Kong - 81-1 - Add support for OpenCloudOS Stream - diff --git a/sources b/sources index 93986bbdfaca1763e59e83828ee6cd7b0bf339e2..302d2448829f53e76bc1a3f2c97ba1c32e08114a 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (osbuild-115.tar.gz) = b7bc9f94a0067aa55af5068a4a8cecff0c4aaf897c74adfa42cb468d2f5e418f6fe7119f3faa889d9d358144acf1f98a059aca1159f4c6a4a07e4fcb3f18d7d9 +SHA512 (osbuild-183.tar.gz) = 09fbbd62aa6c87611ac4e366a6d55687055fa92e60fd39b4ec4c5da8af4a68dc0e242f7cc9faa96082b7f1466a499d8706d4b897031b75d5e41780160c8c7a63 +SHA512 (osbuild-initrd-0.1.tar.gz) = af8fd6b3b84f4f0ffca9847d8cef49322d75a03fc60743c8bf697a21df019666778e826bc0a8e9f5faca59151bf91f12d65d2a5e820ca9d0bd840ff92d33054a