From 2291f5b40cca88a305fbe822bebffb6aeecf681c Mon Sep 17 00:00:00 2001
From: "Richard W.M. Jones" <rjones@redhat.com>
Date: Wed, 13 Jul 2016 20:16:23 +0100
Subject: [PATCH] builder: Use virt-sysprep --selinux-relabel when preparing
templates.
Don't need to be clever now.
(cherry picked from commit b6e92b1100b4ca462a35549bd36322f0510739bc)
---
builder/website/compress.sh | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/builder/website/compress.sh b/builder/website/compress.sh
index bb5500c..1036a60 100644
--- a/builder/website/compress.sh
+++ b/builder/website/compress.sh
@@ -23,22 +23,11 @@ output=$1
relabel_args=()
if [ -n "$DO_RELABEL" ]; then
- os_arch=$(uname -m)
- guest_arch=$(virt-inspector -a "$output" | virt-inspector --xpath "string(/operatingsystems/operatingsystem/arch)")
-
- if [ "$os_arch" = "$guest_arch" ] || [ "$os_arch" = "x86_64" -a "$guest_arch" = "i386" ]; then
- # this is what --selinux-relabel should really do, but do it ourselves
- # in the meanwhile -- see RHBZ#1089100.
- relabel_args+=(--run-command "setfiles /etc/selinux/targeted/contexts/files/file_contexts /")
- else
- relabel_args+=(--selinux-relabel)
- fi
+ relabel_args="--selinux-relabel"
fi
# Sysprep (removes logfiles and so on).
-# Note this also touches /.autorelabel so the further installation
-# changes that we make will be labelled properly at first boot.
-virt-sysprep -a $output "${relabel_args[@]}"
+virt-sysprep -a $output $relabel_args
# Sparsify.
mv $output $output.old
--
1.8.3.1