diff --git a/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate b/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate index a756d8b6..89bf9d84 100755 --- a/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate +++ b/diskimage_builder/elements/dracut-regenerate/finalise.d/50-dracut-regenerate @@ -71,7 +71,18 @@ def main(): kernel_version = "%s" % kernel_search.groups(1) ramdisk_path = "/boot/%s" % kernel_set[1].strip() + # list installed modules of dracut + cmdline = ['dracut', '--list-modules'] + logging.debug("Calling: %s" % cmdline) + subp = subprocess.Popen(cmdline, stdout=subprocess.PIPE) + out, err = subp.communicate() + if subp.returncode: + e = subprocess.CalledProcessError(subp.returncode, cmdline) + e.output = out + raise e + cmdline = ['dracut', '--force'] + if modules_to_boot: modules_to_boot = ' ' .join(modules_to_boot) cmdline += ['--add', modules_to_boot]