diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index b3b06a33..ddd047ae 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -189,7 +189,8 @@ class Lorax(BaseLoraxClass): buildstamp.write(joinpaths(self.inroot, ".buildstamp")) if self.debug: - rb.writepkglists(joinpaths(self.workdir, "pkglists")) + rb.writepkglists(joinpaths(logdir, "pkglists")) + rb.writepkgsizes(joinpaths(logdir, "original-pkgsizes.txt")) logger.info("doing post-install configuration") rb.postinstall() @@ -208,6 +209,9 @@ class Lorax(BaseLoraxClass): logger.info("cleaning unneeded files") rb.cleanup() + if self.debug: + rb.writepkgsizes(joinpaths(logdir, "final-pkgsizes.txt")) + logger.info("creating the runtime image") runtime = "images/install.img" compression = self.conf.get("compression", "type") diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 844d1de1..11491d0a 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -110,6 +110,14 @@ class RuntimeBuilder(object): removelocales = locales.difference(keeplocales) self._runner.run("runtime-cleanup.tmpl", removelocales=removelocales) + def writepkgsizes(self, pkgsizefile): + '''debugging data: write a big list of pkg sizes''' + fobj = open(pkgsizefile, "w") + getsize = lambda f: os.lstat(f).st_size if os.path.exists(f) else 0 + for p in sorted(self.yum.doPackageLists(pkgnarrow='installed').installed): + pkgsize = sum(getsize(joinpaths(self.vars.root,f)) for f in p.filelist) + fobj.write("{0.name}.{0.arch}: {1}\n".format(p, pkgsize)) + def generate_module_data(self): root = self.vars.root moddir = joinpaths(root, "lib/modules/")