Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmd-build
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ for itype in "${IMAGE_TYPES[@]}"; do
/usr/lib/coreos-assembler/gf-oemid "$(pwd)"/"${img_base}" "$(pwd)"/"${img_qemu}" qemu
# Clear the MCS SELinux labels
# See https://github.com/coreos/coreos-assembler/issues/292
chcon -vl s0 "${img_qemu}"
chcon -vl s0 "${img_qemu}" || echo "chcon failed. This is expected if SELinux is not enabled"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like:

if [[ $(getenforce || :) == Enforcing ]]; then
  chcon ...
fi

?

That way, we make sure we still fail if SELinux is enabled and we're missing perms or something.

# make a version-less symlink to have a stable path
# TODO: Remove this, things should be parsing the metadata
ln -s "${img_qemu}" "${name}"-qemu.qcow2
Expand Down