From 0c58711fcde3bfa980ccd7951c59601358031871 Mon Sep 17 00:00:00 2001 From: Bruno Wolff III Date: Sep 27 2010 04:01:16 +0000 Subject: Fix relabel of live image when composing on a host wtih selinux disabled. --- diff --git a/livecd-tools.spec b/livecd-tools.spec index 2f815a9..4a92f74 100644 --- a/livecd-tools.spec +++ b/livecd-tools.spec @@ -5,7 +5,7 @@ Summary: Tools for building live CDs Name: livecd-tools Version: 034 -Release: 10%{?dist} +Release: 11%{?dist} License: GPLv2 Group: System Environment/Base URL: http://git.fedorahosted.org/git/livecd @@ -21,6 +21,7 @@ Patch2: menulabel.patch Patch3: devloop.patch Patch4: livecd-tools-034-newpath.patch Patch5: lzo.patch +Patch6: selinux.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires: python-imgcreate = %{version}-%{release} Requires: mkisofs @@ -71,6 +72,7 @@ like live image or appliances. %patch3 -p1 %patch4 -p1 %patch5 -p1 +%patch6 -p1 %build make @@ -103,6 +105,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/imgcreate/*.pyc %changelog +* Sun Sep 26 2010 Bruno Wolff III - 034-11 +- Fix live image relabel when compose host has selinux disabled. + * Tue Sep 21 2010 Bruno Wolff III - 034-10 - Document the lzo compressor. diff --git a/selinux.patch b/selinux.patch new file mode 100644 index 0000000..fbf6ba7 --- /dev/null +++ b/selinux.patch @@ -0,0 +1,13 @@ +diff --git a/imgcreate/kickstart.py b/imgcreate/kickstart.py +index aa2cff0..9a2145a 100644 +--- a/imgcreate/kickstart.py ++++ b/imgcreate/kickstart.py +@@ -420,7 +420,7 @@ class SelinuxConfig(KickstartConfig): + if not os.path.exists(self.path("/sbin/setfiles")): + return + +- self.call(["/sbin/setfiles", "/etc/selinux/targeted/contexts/files/file_contexts", "-e", "/proc", "-e", "/sys", "-e", "/dev", "-e", "/selinux", "/"]) ++ self.call(["/sbin/setfiles", "-e", "/proc", "-e", "/sys", "-e", "/dev", "-e", "/selinux", "/etc/selinux/targeted/contexts/files/file_contexts", "/"]) + + def apply(self, ksselinux): + if os.path.exists(self.path("/usr/sbin/lokkit")):