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:
parent
c2a3b7dbf3
commit
68c26bf87b
@ -255,9 +255,6 @@ def rebuild_initrds_for_live(opts, sys_root_dir, results_dir):
|
|||||||
if not kernels:
|
if not kernels:
|
||||||
raise Exception("No initrds found, cannot rebuild_initrds")
|
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:
|
if opts.ostree:
|
||||||
# Dracut assumes to have some dirs in disk image
|
# Dracut assumes to have some dirs in disk image
|
||||||
# /var/tmp for temp files
|
# /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)
|
shutil.copy2(joinpaths(sys_root_dir, kernel.path), results_dir)
|
||||||
umount(joinpaths(sys_root_dir, "var/tmp"), delete=False)
|
umount(joinpaths(sys_root_dir, "var/tmp"), delete=False)
|
||||||
umount(joinpaths(sys_root_dir, "results"), 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):
|
def create_pxe_config(template, images_dir, live_image_name, add_args = None):
|
||||||
"""
|
"""
|
||||||
|
@ -308,8 +308,6 @@ class TreeBuilder(object):
|
|||||||
if not self.kernels:
|
if not self.kernels:
|
||||||
raise Exception("No kernels found, cannot rebuild_initrds")
|
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:
|
for kernel in self.kernels:
|
||||||
if prefix:
|
if prefix:
|
||||||
idir = os.path.dirname(kernel.path)
|
idir = os.path.dirname(kernel.path)
|
||||||
@ -328,8 +326,6 @@ class TreeBuilder(object):
|
|||||||
cmd = dracut + [outfile, kernel.version]
|
cmd = dracut + [outfile, kernel.version]
|
||||||
runcmd(cmd, root=self.vars.inroot)
|
runcmd(cmd, root=self.vars.inroot)
|
||||||
|
|
||||||
os.unlink(joinpaths(self.vars.inroot,"/proc/modules"))
|
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
templatefile = templatemap[self.vars.arch.basearch]
|
templatefile = templatemap[self.vars.arch.basearch]
|
||||||
for tmpl in self.add_templates:
|
for tmpl in self.add_templates:
|
||||||
|
Loading…
Reference in New Issue
Block a user