diff --git a/0001-Run-setfiles-after-chroot.patch b/0001-Run-setfiles-after-chroot.patch new file mode 100644 index 0000000..df6c479 --- /dev/null +++ b/0001-Run-setfiles-after-chroot.patch @@ -0,0 +1,32 @@ +From 2ccd4160ebcbfa0bd8262901dfc3b90b815c8376 Mon Sep 17 00:00:00 2001 +From: notok +Date: Sat, 8 Dec 2018 14:21:54 +0900 +Subject: [PATCH] Run setfiles after chroot + +SELinux context is not properly set because setfiles command is not run after chroot. +Fixes #106 + +Backport of upstream commit c6dd265af7ccb3c51c37dcd89839f178832518ea to v21.1 +Fixes https://bugs.centos.org/view.php?id=15589 and https://github.com/livecd-tools/livecd-tools/issues/106 + +Signed-off-by: Mikhail Novosyolov +--- + imgcreate/kickstart.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py +index 2273cd5..bf2211f 100644 +--- a/imgcreate/kickstart.py ++++ b/imgcreate/kickstart.py +@@ -445,7 +445,7 @@ class SelinuxConfig(KickstartConfig): + if not os.path.exists(self.path("/sbin/setfiles")): + return + +- self.call(["/sbin/setfiles", "-p", "-e", "/proc", "-e", "/sys", "-e", "/dev", selinux.selinux_file_context_path(), "/"]) ++ subprocess.call(["/sbin/setfiles", "-p", "-e", "/proc", "-e", "/sys", "-e", "/dev", selinux.selinux_file_context_path(), "/"], preexec_fn=self.chroot) + + def apply(self, ksselinux): + selinux_config = "/etc/selinux/config" +-- +2.17.1 + diff --git a/livecd-tools.spec b/livecd-tools.spec index 2164018..ff01a21 100644 --- a/livecd-tools.spec +++ b/livecd-tools.spec @@ -3,7 +3,7 @@ Summary: Tools for building live CDs Name: livecd-tools Version: 21.1 -Release: 56 +Release: 58 Epoch: 1 License: GPLv2+ Group: System/Base @@ -33,6 +33,7 @@ Patch19: livecd-tools-21.1.support.efi32.patch Patch21: livecd-tools-21.1.use.add_drivers.patch Patch22: livecd-tools-21.1.no.vga.opts.patch Patch23: livecd-tools-21.1-genisoimage.patch +Patch24: 0001-Run-setfiles-after-chroot.patch Requires: python-imgcreate = %{EVRD} Requires: dosfstools