-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spec: Adjust selinux requirement for stable upstream releases #4
base: master
Are you sure you want to change the base?
Conversation
c0bf711
to
652ca76
Compare
What does the build command make -f /usr/share/selinux/devel/Makefile -C selinux-ovirt_vmconsole do? Can it happen that something gets processed/created and put into the rpm that is compatible only with the new policy and then it would break when installed on a system with an older policy (not permitting something that should be permitted, permitting something that shouldn't be permitted, or not working at all)? |
Not sure if this is the answer you expected, but it compiles the selinux policy.
This is a bigger problem unfortunately and the PR is (hopefully) a temporary workaround until we have chroots with stable releases or a broader solution. Any binary blob is prone to this issue - using newer packages for building and then installing on a release with older, stable packages may not work as expected. |
Maybe another comment here is needed - this was one of two things that was blocking basic suite run from being successful on Alma 9 images, so things don't look so dire either ;) |
And this is what dependencies are for. Before intentionally breaking them for the purpose of compiling once and then running on different incompatible distributions:
In practice, the overall impact of this change may be positive:
So I'm not against it if there is no better solution at the moment. |
652ca76
to
897251e
Compare
I've added a |
This is a bold statement, basically telling the dependency on the newer version is completely unnecessary. But if you stay behind it and are ready to handle the contingent problems... :-)
Oh, no, what I meant with
was wondering whether there is an option to provide a newer selinux-policy for those stable systems in oVirt repos when needed. Not changing the build environment. |
We make official upstream releases from packages built either in CBS or COPR. Neither of these environments offers any of the upstream clones of RHEL (AlmaLinux, Rocky Linux) as chroot environments - only CentOS Stream is available. This fact, combined with how `%{?selinux_requires}` macro works, makes our lives complicated. As part of `selinux-policy` installation we get a `/usr/lib/rpm/macros.d/macros.selinux-policy` file that has among others i.e.: ``` %_selinux_policy_version 36.14-1.fc36 ... %selinux_requires \ Requires: selinux-policy >= %{_selinux_policy_version} \ ... ``` The `%_selinux_policy_version` expands to the version of the `selinux-policy` package *that is installed in the environment where the RPM is built*. On CentOS Stream these RPMs are usually slightly ahead than their counterparts on the stable releases. Since we only have CentOS Stream chroots available for building RPMs, when we try to install such a package on a stable release, 'dnf' resolves the conflicts by simply picking a package version that's old enough to meet the 'selinux-policy' requirement. Ideally, packages for stable releases should be built in chroots based on stable releases. Since we don't have that option for now, let's define the `%_selinux_policy_version` by ourselves to a value that matches the version from the latest stable release. This patch should not affect deployments on CentOS Stream 9 in a any way. It may affect deployments on stable distros, as the SELinux policy compiled with a newer version of 'selinux-policy' package may not be backwards compatible with an older version. In current tests however everything worked fine. An alternative for this approach would be to force-install an older version of 'selinux-policy' package in the environment where 'ovirt-console' is built. This might not be possible due to some 'ovirt-vmconsole's build dependencies requiring a newer version. Even if it would work today, it could still be broken by an update of the dependent packages. Signed-off-by: Marcin Sobczyk <[email protected]>
897251e
to
3057637
Compare
We make official upstream releases from packages built either in CBS or
COPR. Neither of these environments offers any of the upstream clones of
RHEL (AlmaLinux, Rocky Linux) as chroot environments - only CentOS
Stream is available. This fact, combined with how
%{?selinux_requires}
macro works, makes our lives complicated.
As part of
selinux-policy
installation we geta
/usr/lib/rpm/macros.d/macros.selinux-policy
file that has amongothers:
The
%_selinux_policy_version
expands to the version of theselinux-policy
package that is installed in the environment wherethe RPM is built. On CentOS Stream these RPMs are usually slightly
ahead than their counterparts on the stable releases.
Since we only have CentOS Stream chroots available for building RPMs,
when we try to install such a package on a stable release,
dnf
resolves the conflicts by simply picking a package version that's old
enough to meet the
selinux-policy
requirement.Ideally, packages for stable releases should be built in chroots based
on stable releases. Since we don't have that option for now, let's define
the
%_selinux_policy_version
by ourselves to a value that matchesthe version from the latest stable release.
This patch should not affect deployments on CentOS Stream 9 in a any
way. It may affect deployments on stable distros, as the SELinux policy
compiled with a newer version of 'selinux-policy' package may not
be backwards compatible with an older version. In current tests however
everything worked fine.
An alternative for this approach would be to force-install an older
version of 'selinux-policy' package in the environment where
'ovirt-console' is built. This might not be possible due to some
'ovirt-vmconsole's build dependencies requiring a newer version.
Even if it would work today, it could still be broken by an update
of the dependent packages.
Signed-off-by: Marcin Sobczyk [email protected]