From 6a4d4a4a56396cd60e15834d26c1e8aca8c5bed5 Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Tue, 30 Mar 2010 14:44:19 +0200 Subject: [PATCH] Don't run modlist on module-info Running modlist is not needed anymore, because the module-info we create does not contain any modules, that are not scsi or eth, so modlist does not make any changes to it. --- src/pylorax/images.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/pylorax/images.py b/src/pylorax/images.py index 38921a1d..61011d98 100644 --- a/src/pylorax/images.py +++ b/src/pylorax/images.py @@ -268,25 +268,15 @@ export PS1 PATH info = info.format(modname, modtype, desc) modlist[modname] = info - # write the source module-info - moduleinfo = os.path.join(self.workdir, self.const.MODULEINFO) + # write the module-info + moduleinfo = os.path.join(os.path.dirname(dst_moddir), + self.const.MODULEINFO) + with open(moduleinfo, "w") as f: f.write("Version 0\n") for modname in sorted(modlist.keys()): f.write(modlist[modname]) - # create the final module-info - dst = os.path.join(os.path.dirname(dst_moddir), self.const.MODULEINFO) - modlist = os.path.join(self.srctree, self.const.MODLIST) - cmd = "{0} --modinfo-file {1} --ignore-missing --modinfo {2} > {3}" - cmd = cmd.format(modlist, moduleinfo, " ".join(list(modules)), dst) - err, stdout = commands.getstatusoutput(cmd) - if err: - self.perror(stdout) - - # remove the source module-info - #os.unlink(moduleinfo) - # compress modules for root, dirs, files in os.walk(dst_moddir): for file in filter(lambda f: f.endswith(".ko"), files):