stages: add org.osbuild.anaconda
Add a stage to configure anaconda. For now only the enabled kickstart modules can be configured. This is done by dropping a file "90-osbuild.conf" in `/etc/anaconda/conf.d`.
This commit is contained in:
parent
6d52349370
commit
19b330eade
1 changed files with 58 additions and 0 deletions
58
stages/org.osbuild.anaconda
Executable file
58
stages/org.osbuild.anaconda
Executable file
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/python3
|
||||
"""
|
||||
Configure basic aspects of the anaconda installer
|
||||
|
||||
Create an anaconda configuration file `90-osbuild.conf` in
|
||||
the folder `/etc/anaconda/conf.d` to configure anaconda.
|
||||
|
||||
Currently only the list of enabled kickstart modules is
|
||||
configurable via the `kickstart-modules` option.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
||||
import osbuild.api
|
||||
|
||||
|
||||
SCHEMA = """
|
||||
"additionalProperties": true,
|
||||
"required": ["kickstart-modules"],
|
||||
"properties": {
|
||||
"kickstart-modules": {
|
||||
"type": "array",
|
||||
"description": "Kick start modules to enable",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
"""
|
||||
|
||||
CONFIG = """
|
||||
# osbuild customizations
|
||||
|
||||
[Anaconda]
|
||||
# List of enabled Anaconda DBus modules
|
||||
kickstart_modules =
|
||||
"""
|
||||
|
||||
|
||||
def main(tree, options):
|
||||
modules = options["kickstart-modules"]
|
||||
product_dir = os.path.join(tree, "etc/anaconda/conf.d")
|
||||
os.makedirs(product_dir, exist_ok=True)
|
||||
|
||||
with open(os.path.join(product_dir, "90-osbuild.conf"), "w") as f:
|
||||
f.write(CONFIG)
|
||||
for m in modules:
|
||||
f.write(f" {m}\n")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
stage_args = osbuild.api.arguments()
|
||||
r = main(stage_args["tree"],
|
||||
stage_args["options"])
|
||||
sys.exit(r)
|
||||
Loading…
Add table
Add a link
Reference in a new issue