From 51060f07f6d042cd53ce39494517e780771bcb37 Mon Sep 17 00:00:00 2001 From: Will Woods Date: Wed, 6 Jul 2011 12:22:49 -0400 Subject: [PATCH] hacklet to hush dracut warnings about /proc/modules We just touch ${inroot}/proc/modules before the chroot, and remove it afterward. --- src/pylorax/treebuilder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py index da033b2a..2ebe6525 100644 --- a/src/pylorax/treebuilder.py +++ b/src/pylorax/treebuilder.py @@ -144,6 +144,8 @@ class TreeBuilder(object): dracut = ["/sbin/dracut", "--nomdadmconf", "--nolvmconf"] + add_args if not backup: dracut.append("--force") + # Hush some dracut warnings. TODO: bind-mount proc in place? + open(joinpaths(self.vars.inroot,"/proc/modules"),"w") # XXX FIXME: add anaconda dracut module! for kernel in self.kernels: logger.info("rebuilding %s", kernel.initrd.path) @@ -152,6 +154,7 @@ class TreeBuilder(object): os.rename(initrd, initrd + backup) check_call(["chroot", self.vars.inroot] + \ dracut + [kernel.initrd.path, kernel.version]) + os.unlink(joinpaths(self.vars.inroot,"/proc/modules")) def build(self): templatefile = templatemap[self.vars.arch.basearch]