From 8d86ff1beca9d1c622b9fddc9f36a85b37b73419 Mon Sep 17 00:00:00 2001
From: Nguyen Van Trung <trungnv@vn.fujitsu.com>
Date: Thu, 14 Jun 2018 09:40:31 +0700
Subject: [PATCH] Don't run setfiles on /boot/efi

setfiles isn't supported on the vfat /boot/efi partition.  Add it to
the skip list.

Tested on Fujitsu Server successfully.

Change-Id: Iab262c4bdb0ecc25ca6b77ee4aff1ce442c0c578
---
 .../elements/rpm-distro/cleanup.d/99-selinux-fixfiles-restore   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/diskimage_builder/elements/rpm-distro/cleanup.d/99-selinux-fixfiles-restore b/diskimage_builder/elements/rpm-distro/cleanup.d/99-selinux-fixfiles-restore
index a179ae9c0..b13e98f74 100755
--- a/diskimage_builder/elements/rpm-distro/cleanup.d/99-selinux-fixfiles-restore
+++ b/diskimage_builder/elements/rpm-distro/cleanup.d/99-selinux-fixfiles-restore
@@ -65,7 +65,7 @@ fi
 
 IFS='|' read -ra SPLIT_MOUNTS <<< "$DIB_MOUNTPOINTS"
 for MOUNTPOINT in "${SPLIT_MOUNTS[@]}"; do
-    if [ "${MOUNTPOINT}" != "/tmp/in_target.d" ] && [ "${MOUNTPOINT}" != "/dev" ]; then
+    if [ "${MOUNTPOINT}" != "/tmp/in_target.d" ] && [ "${MOUNTPOINT}" != "/dev" ] && [ "${MOUNTPOINT}" != "/boot/efi" ]; then
         sudo ${_runcon} chroot ${TARGET_ROOT} \
             /usr/sbin/setfiles -F ${_dash_m} \
             /etc/selinux/targeted/contexts/files/file_contexts ${MOUNTPOINT}