aboutsummaryrefslogtreecommitdiff
diff refs
from: back
to: back
| flip
diff options
context:
space:
mode:
-rwxr-xr-xkiwi-build14
1 files changed, 14 insertions, 0 deletions
diff --git a/kiwi-build b/kiwi-build
index 163565c..0479f42 100755
--- a/kiwi-build
+++ b/kiwi-build
@@ -68,6 +68,13 @@ if [ "$image_type" = "oci" ]; then
kiwi_bundle_format="${kiwi_bundle_format}.%T"
fi
+if [ ! ${kiwi_isolated} ] && [ -e "/sys/fs/selinux/enforce" ]; then
+ # Disable SELinux enforcement during the image build if it's enforcing
+ selinux_enforcing="$(cat /sys/fs/selinux/enforce)"
+ if [ "$selinux_enforcing" = "1" ]; then
+ setenforce 0
+ fi
+fi
set +e
if [ ! ${kiwi_isolated} ]; then
@@ -78,6 +85,13 @@ fi
kiwi_status=$?
set -e
+if [ ! ${kiwi_isolated} ] && [ -e "/sys/fs/selinux/enforce" ]; then
+ # Re-enable SELinux enforcement now that image build is done
+ if [ "$selinux_enforcing" = "1" ]; then
+ setenforce 1
+ fi
+fi
+
if [ "${kiwi_status}" = "0" ] && [ -n "$image_release" ]; then
kiwi-ng ${debug} result bundle --bundle-format="${kiwi_bundle_format}" --target-dir "${output_dir}-build" --bundle-dir "${output_dir}" --id="${image_release}"
fi