From d89f01af21d66a5724180b0394a841202392acfe Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Thu, 13 Feb 2014 09:29:26 -0800 Subject: [PATCH] Check initrd size on ppc64 and warn (#1060691) ppc64 initrd cannot be larger than 32MiB, so log a warning if it is too large. Related: rhbz#1060691 --- src/pylorax/treebuilder.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index 9020f6ae..d0fac4bb 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -214,6 +214,13 @@ class TreeBuilder(object): os.rename(initrd, initrd + backup) cmd = dracut + [outfile, kernel.version] runcmd(cmd, root=self.vars.inroot) + + # ppc64 cannot boot images > 32MiB, check size and warn + if self.vars.arch.basearch == "ppc64" and os.path.exists(outfile): + st = os.stat(outfile) + if st.st_size > 32 * 1024 * 1024: + logging.warning("ppc64 initrd %s is > 32MiB", outfile) + os.unlink(joinpaths(self.vars.inroot,"/proc/modules")) def build(self):