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