Skip to content

Commit f5dbdcd

Browse files
committed
builder: Use virt-sysprep --selinux-relabel when preparing templates.
Don't need to be clever now.
1 parent 8184857 commit f5dbdcd

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

builder/website/compress.sh

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,11 @@ output=$1
2323
relabel_args=()
2424

2525
if [ -n "$DO_RELABEL" ]; then
26-
os_arch=$(uname -m)
27-
guest_arch=$(virt-inspector -a "$output" | virt-inspector --xpath "string(/operatingsystems/operatingsystem/arch)")
28-
29-
if [ "$os_arch" = "$guest_arch" ] || [ "$os_arch" = "x86_64" -a "$guest_arch" = "i386" ]; then
30-
# this is what --selinux-relabel should really do, but do it ourselves
31-
# in the meanwhile -- see RHBZ#1089100.
32-
relabel_args+=(--run-command "setfiles /etc/selinux/targeted/contexts/files/file_contexts /")
33-
else
34-
relabel_args+=(--selinux-relabel)
35-
fi
26+
relabel_args="--selinux-relabel"
3627
fi
3728

3829
# Sysprep (removes logfiles and so on).
39-
# Note this also touches /.autorelabel so the further installation
40-
# changes that we make will be labelled properly at first boot.
41-
virt-sysprep -a $output "${relabel_args[@]}"
30+
virt-sysprep -a $output $relabel_args
4231

4332
# Sparsify.
4433
mv $output $output.old

0 commit comments

Comments
 (0)