[lorax] bind-mount /proc when rebuilding initrd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Recently rpm started [1] to look at /proc/self/auxv so it's probably time to
bind-mount real /proc instead of only creating /proc/modules to silence dracut.

[1] http://rpm.org/gitweb?p=rpm.git;a=commitdiff;h=280494cce023f3938023b9b2b1173405601e4ddf
---
 src/pylorax/treebuilder.py |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/pylorax/treebuilder.py b/src/pylorax/treebuilder.py
index 1d4a24c..50062a3 100644
--- a/src/pylorax/treebuilder.py
+++ b/src/pylorax/treebuilder.py
@@ -176,8 +176,8 @@ class TreeBuilder(object):
         if not backup:
             dracut.append("--force")
 
-        # Hush some dracut warnings. TODO: bind-mount proc in place?
-        open(joinpaths(self.vars.inroot,"/proc/modules"),"w")
+        # bind-mount proc in place - hush some dracut and rpm warnings
+        check_call(["mount", "-o", "bind", "/proc", joinpaths(self.vars.inroot,"/proc")])
         for kernel in self.kernels:
             logger.info("rebuilding %s", kernel.initrd.path)
             if backup:
@@ -185,7 +185,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"))
+        check_call(["umount", joinpaths(self.vars.inroot,"/proc")])
 
     def build(self):
         templatefile = templatemap[self.vars.arch.basearch]
-- 
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux