On 9/4/07, Jeremy Katz <[EMAIL PROTECTED]> wrote:
>
> On Mon, 2007-09-03 at 19:15 -0400, Colin Walters wrote:
> > I'm building them on Fedora 7, git head livecd-tools.  This used to
> > work, so something regressed recently, and I have no idea what =)  How
> > would one go about debugging this?
>
> If you're running git HEAD, are you running git HEAD mayflower (ie, have
> it installed in /usr/lib/livecd-tools) as well?


Indeed, that was the problem, thanks.  This seemed like it was just waiting
to bite other unaware contributors (periodic sudo cp mayflower
/usr/lib/livecd-creator is not obvious), so patch in my git repository, and
also attached.
commit a280168c1efbe09cb8c6afe91e71dae2a10b4b01
Author: Colin Walters <[EMAIL PROTECTED]>
Date:   Tue Sep 4 11:51:13 2007 -0400

    autodetect libexecdir, use mayflower from git if available by default

diff --git a/creator/livecd-creator b/creator/livecd-creator
index e8b8669..5b090d1 100755
--- a/creator/livecd-creator
+++ b/creator/livecd-creator
@@ -820,12 +820,12 @@ class ImageCreator(object):
 
         return kernels[0]
 
-    def createInitramfs(self):
+    def createInitramfs(self, libexecdir):
         # Create initramfs
-        if not os.path.isfile("/usr/lib/livecd-creator/mayflower"):
-            raise InstallationError("livecd-creator not correctly installed : "+
-                                    "/usr/lib/livecd-creator/mayflower not found")
-        shutil.copy("/usr/lib/livecd-creator/mayflower",
+        mayflowerpath = os.path.join(libexecdir, 'mayflower')
+        if not os.path.isfile(mayflowerpath):
+            raise InstallationError("livecd-creator not correctly installed : %s not found" % (mayflowerpath,))
+        shutil.copy(mayflowerpath,
                         "%s/install_root/sbin/mayflower" %(self.build_dir,))
         # modules we want to support for booting
         mcfg = open(self.build_dir + "/install_root/etc/mayflower.conf", "w")
@@ -854,7 +854,7 @@ class ImageCreator(object):
     def launchShell(self):
         subprocess.call(["/bin/bash"], preexec_fn=self.run_in_root)
 
-    def install(self):
+    def install(self, libexecdir):
         for repo in self.ksparser.handler.repo.repoList:
             yr = self.ayum.addRepository(repo.name, repo.baseurl, repo.mirrorlist)
             if hasattr(repo, "includepkgs"):
@@ -872,7 +872,7 @@ class ImageCreator(object):
             raise InstallationError("Error configuring live image: %s" %(e,))
         self.configureNetwork()
         self.relabelSystem()
-        self.createInitramfs()
+        self.createInitramfs(libexecdir)
         self.configureBootloader()
         self.runPost()
 
@@ -1254,6 +1254,8 @@ def parse_options(args):
                       help="File system label (default based on config name)")
     parser.add_option("-b", "--base-on", type="string", dest="base_on",
                       help="Add packages to an existing live CD iso9660 image.")
+    parser.add_option("--libexecdir", type="string", dest="libexecdir",
+                      help="Directory containing helper programs.")
 
     # options related to the config of your system
     parser.add_option("-t", "--tmpdir", type="string",
@@ -1282,7 +1284,7 @@ def parse_options(args):
 
     return options
 
-def main():
+def main(libexecdir=None):
     try:
         options = parse_options(sys.argv[1:])
     except Usage, (msg, no_error):
@@ -1332,7 +1334,7 @@ def main():
 
         target.setup(options.base_on, options.cachedir)
 
-        target.install()
+        target.install(options.libexecdir or libexecdir or '/usr/lib/livecd-creator/')
 
         if options.give_shell:
             print "Launching shell. Exit to continue."
@@ -1358,4 +1360,11 @@ def main():
     return 0
 
 if __name__ == "__main__":
-    sys.exit(main())
+    kwargs={}
+    if globals().has_key('__file__'):
+        basepath = os.path.abspath(os.path.dirname(__file__))
+        if os.path.isfile(os.path.join(basepath, 'mayflower')) and os.path.isfile(os.path.join(basepath, '..', 'Makefile')):
+            kwargs['libexecdir']=basepath
+            print "Using libexecdir=%s" % (basepath,)
+    sys.exit(main(**kwargs))
+
--
Fedora-livecd-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/fedora-livecd-list

Reply via email to