[libvirt] [PATCH] Fix location of SELinux mount during RPM builds

From: "Daniel P. Berrange" <berrange@redhat.com> When building RPMs the host kernel cannot be assumed to match the target OS kernel. Thus auto-detecting /selinux vs /sys/fs/selinux based on the host kernel can result in the wrong choice (eg F18 builds on a RHEL6 host kernel) --- libvirt.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libvirt.spec.in b/libvirt.spec.in index 044b00f..fb35934 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1222,6 +1222,15 @@ of recent versions of Linux (and other OSes). %if 0%{?enable_autotools} autoreconf -if %endif + +%if %{with_selinux} +%if %{?fedora} >= 17 || %{?rhel} >= 7 +%define with_selinux_mount --with-selinux-mount="/sys/fs/cgroup" +%else +%define with_selinux_mount --with-selinux-mount="/selinux" +%endif +%endif + %configure %{?_without_xen} \ %{?_without_qemu} \ %{?_without_openvz} \ @@ -1254,6 +1263,7 @@ autoreconf -if %{?_without_capng} \ %{?_without_netcf} \ %{?_without_selinux} \ + %{?_with_selinux_mount} \ %{?_without_hal} \ %{?_without_udev} \ %{?_without_yajl} \ -- 1.7.11.2

On 09/06/2012 08:24 AM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
When building RPMs the host kernel cannot be assumed to match the target OS kernel. Thus auto-detecting /selinux vs /sys/fs/selinux based on the host kernel can result in the wrong choice (eg F18 builds on a RHEL6 host kernel) --- libvirt.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+)
ACK. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 09/06/2012 04:24 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
When building RPMs the host kernel cannot be assumed to match the target OS kernel. Thus auto-detecting /selinux vs /sys/fs/selinux based on the host kernel can result in the
This line ...
wrong choice (eg F18 builds on a RHEL6 host kernel) --- libvirt.spec.in | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in index 044b00f..fb35934 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -1222,6 +1222,15 @@ of recent versions of Linux (and other OSes). %if 0%{?enable_autotools} autoreconf -if %endif + +%if %{with_selinux} +%if %{?fedora} >= 17 || %{?rhel} >= 7 +%define with_selinux_mount --with-selinux-mount="/sys/fs/cgroup"
... and this line say something else, did you mean "/sys/fs/selinux" in here by any chance as well? :) Martin
participants (3)
-
Daniel P. Berrange
-
Eric Blake
-
Martin Kletzander