Skip creating empty /proc/modules for dracut

Creating /proc/modules just quiets one dracut warning, it doesn't
actually effect the initrd that is created.

Now that mock is being run with netsharedpath set to exclude /proc is
causes problems for running lorax inside a mock, so just remove this to
prevent a crash when it doesn't exist.

Related: rhbz#1848201
This commit is contained in:
Brian C. Lane 2020-06-22 16:07:21 -07:00
parent c2a3b7dbf3
commit 68c26bf87b
2 changed files with 0 additions and 8 deletions

View File

@ -255,9 +255,6 @@ def rebuild_initrds_for_live(opts, sys_root_dir, results_dir):
if not kernels:
raise Exception("No initrds found, cannot rebuild_initrds")
# Hush some dracut warnings. TODO: bind-mount proc in place?
open(joinpaths(sys_root_dir,"/proc/modules"),"w")
if opts.ostree:
# Dracut assumes to have some dirs in disk image
# /var/tmp for temp files
@ -294,7 +291,6 @@ def rebuild_initrds_for_live(opts, sys_root_dir, results_dir):
shutil.copy2(joinpaths(sys_root_dir, kernel.path), results_dir)
umount(joinpaths(sys_root_dir, "var/tmp"), delete=False)
umount(joinpaths(sys_root_dir, "results"), delete=False)
os.unlink(joinpaths(sys_root_dir,"/proc/modules"))
def create_pxe_config(template, images_dir, live_image_name, add_args = None):
"""

View File

@ -308,8 +308,6 @@ class TreeBuilder(object):
if not self.kernels:
raise Exception("No kernels found, cannot rebuild_initrds")
# Hush some dracut warnings. TODO: bind-mount proc in place?
open(joinpaths(self.vars.inroot,"/proc/modules"),"w")
for kernel in self.kernels:
if prefix:
idir = os.path.dirname(kernel.path)
@ -328,8 +326,6 @@ class TreeBuilder(object):
cmd = dracut + [outfile, kernel.version]
runcmd(cmd, root=self.vars.inroot)
os.unlink(joinpaths(self.vars.inroot,"/proc/modules"))
def build(self):
templatefile = templatemap[self.vars.arch.basearch]
for tmpl in self.add_templates: