Merge "Fix CentOS image build failure when dib runs on system where audit disabled"

This commit is contained in:
Zuul 2018-09-06 11:24:59 +00:00 committed by Gerrit Code Review
commit 9f93b2ce3d
1 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,10 @@ fi
IFS='|' read -ra SPLIT_MOUNTS <<< "$DIB_MOUNTPOINTS"
for MOUNTPOINT in "${SPLIT_MOUNTS[@]}"; do
if [ "${MOUNTPOINT}" != "/tmp/in_target.d" ] && [ "${MOUNTPOINT}" != "/dev" ] && [ "${MOUNTPOINT}" != "/boot/efi" ]; then
if ! pgrep kauditd >/dev/null; then
echo "*** kauditd not found, suggesting auditing support is disabled in the host kernel. setfiles will fail without this, please enable and rebuild"
exit 1
fi
sudo ${_runcon} chroot ${TARGET_ROOT} \
/usr/sbin/setfiles -F ${_dash_m} \
/etc/selinux/targeted/contexts/files/file_contexts ${MOUNTPOINT}