[Fedora-livecd-list] [PATCH] Fix filesystem SELinux labeling, remove unused code

Jeremy Katz katzj at redhat.com
Thu Mar 22 20:35:55 UTC 2007


* Use restorecon instead of fixfiles as fixfiles can't find out the filesystem
type from the chroot.
* Remove some dead code
* Don't leave the post scripts lingering on the ISO filesystem
---
 creator/livecd-creator |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/creator/livecd-creator b/creator/livecd-creator
index f34abb1..be4389d 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -263,10 +263,6 @@ class LiveCDYum(yum.YumBase):
         cb.filelog = False
         return self.runTransaction(cb)
 
-def touch(fn):
-    f = open(fn, "w+")
-    f.close()
-
 def get_kernel_version(root):
     # FIXME: this doesn't handle multiple kernels being installed
     kdir = os.listdir("%s/install_root/lib/modules" %(root,))
@@ -575,6 +571,7 @@ class InstallationTarget:
 
             subprocess.call([s.interp, "/tmp/%s" %(os.path.basename(path),)],
                             preexec_fn = self.run_in_root)
+            os.unlink(path)
             
 
     def createInitramfs(self):
@@ -601,8 +598,8 @@ class InstallationTarget:
     def relabelSystem(self):
         # finally relabel all files
         instroot = "%s/install_root" %(self.build_dir,)
-        if os.path.exists("%s/sbin/fixfiles" %(instroot,)):
-            subprocess.call(["/sbin/fixfiles", "restore", "/"],
+        if os.path.exists("%s/sbin/restorecon" %(instroot,)):
+            subprocess.call(["/sbin/restorecon", "-v", "-r", "/"],
                             preexec_fn=self.run_in_root)
         return True
 
-- 
1.5.0.2




More information about the Fedora-livecd-list mailing list