From ddfc918a2285e2247ba1337072cf908ed9719169 Mon Sep 17 00:00:00 2001
From: Alan Pevec <apevec@redhat.com>
Date: Tue, 23 Sep 2008 11:54:00 +0200
Subject: [PATCH ovirt-node-image] Node image build requires SELinux enabled

Signed-off-by: Alan Pevec <apevec@redhat.com>
---
 ovirt-node-image.spec.in |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/ovirt-node-image.spec.in b/ovirt-node-image.spec.in
index 33fd78d..d352850 100644
--- a/ovirt-node-image.spec.in
+++ b/ovirt-node-image.spec.in
@@ -59,12 +59,11 @@ mkdir -p %{ovirt_cache_dir}/node-image-tmp
 mkdir -p %{ovirt_cache_dir}/yum
 
 sudo su - -c "cd $(pwd) &&
-              if [ $(cat /selinux/enforce) = 1 ]; then
-                enforcing=1
-                setenforce 0
-              else
-                enforcing=0
-              fi
+              case $(cat /selinux/enforce 2>/dev/null) in
+                  1) enforcing=1 ; setenforce 0 ;;
+                  0) enforcing=0 ;;
+                  *) echo "SELinux must be enabled"; exit 1 ;;
+              esac
               livecd-creator --skip-minimize -c %{name}.ks -f %{name} \
                --tmpdir='%{ovirt_cache_dir}/node-image-tmp' \
                --cache='%{ovirt_cache_dir}/yum'
-- 
1.5.5.1

