stages/dracut: add dracut omit drivers option

Add option to exclude specific kernel modules from the initramfs that's
generated by dracut.

Signed-off-by: Brian Masney <bmasney@redhat.com>
This commit is contained in:
Brian Masney 2023-08-25 11:47:30 -04:00 committed by Ondřej Budai
parent 6c4e5c5378
commit e7fb2e1117
2 changed files with 22 additions and 0 deletions

View file

@ -72,6 +72,14 @@ SCHEMA = """
"description": "A kernel module without the .ko extension"
}
},
"omit_drivers": {
"description": "Omit specific kernel modules.",
"type": "array",
"items": {
"type": "string",
"description": "A kernel module without the .ko extension."
}
},
"force_drivers": {
"description": "Add driver and ensure that they are tried to be loaded.",
"type": "array",
@ -138,6 +146,7 @@ def main(tree, options):
omit_modules = options.get("omit_modules", [])
drivers = options.get("drivers", []) # kernel modules
add_drivers = options.get("add_drivers", [])
omit_drivers = options.get("omit_drivers", [])
force_drivers = options.get("force_drivers", [])
filesystems = options.get("filesystems", [])
include = options.get("include", [])
@ -172,6 +181,9 @@ def main(tree, options):
if add_drivers:
opts += ["--add-drivers", " ".join(add_drivers)]
if omit_drivers:
opts += ["--omit-drivers", " ".join(omit_drivers)]
if force_drivers:
opts += ["--force-drivers", " ".join(force_drivers)]

View file

@ -17,6 +17,7 @@ Supported configuration options:
- omit_dracutmodules
- drivers
- add_drivers
- omit_drivers
- force_drivers
- filesystems
- install_items
@ -87,6 +88,14 @@ SCHEMA = r"""
"description": "A kernel module without the .ko extension."
}
},
"omit_drivers": {
"description": "Omit specific kernel modules.",
"type": "array",
"items": {
"type": "string",
"description": "A kernel module without the .ko extension."
}
},
"force_drivers": {
"description": "Add driver and ensure that they are tried to be loaded.",
"type": "array",
@ -163,6 +172,7 @@ def main(tree, options):
"omit_dracutmodules": list_option_writer,
"drivers": list_option_writer,
"add_drivers": list_option_writer,
"omit_drivers": list_option_writer,
"force_drivers": list_option_writer,
"filesystems": list_option_writer,
"install_items": list_option_writer,