diff --git a/stages/org.osbuild.kickstart b/stages/org.osbuild.kickstart index 3994aa042..c3286a1fb 100755 --- a/stages/org.osbuild.kickstart +++ b/stages/org.osbuild.kickstart @@ -198,6 +198,10 @@ SCHEMA = r""" } } }] + }, + "display_mode": { + "description": "Perform the Kickstart installation in the given display mode", + "enum": ["text", "graphical", "cmdline"] } } """ @@ -342,6 +346,9 @@ def main(tree, options): clearpart = make_clearpart(options) if clearpart: config += [clearpart] + display_mode = options.get("display_mode") + if display_mode: + config += [display_mode] reboot = make_reboot(options) if reboot: diff --git a/stages/test/test_kickstart.py b/stages/test/test_kickstart.py index 60c31fda6..ff2d3856f 100644 --- a/stages/test/test_kickstart.py +++ b/stages/test/test_kickstart.py @@ -98,13 +98,15 @@ }, "lang en_US.UTF-8\nkeyboard us\ntimezone UTC\nzerombr\nclearpart --all --drives=sd*|hd*|vda,/dev/vdc", ), - # no reboot for an empty dict ({"reboot": True}, "reboot"), ({"reboot": {"eject": False}}, "reboot"), ({"reboot": {"eject": True}}, "reboot --eject"), ({"reboot": {"kexec": False}}, "reboot"), ({"reboot": {"kexec": True}}, "reboot --kexec"), ({"reboot": {"eject": True, "kexec": True}}, "reboot --eject --kexec"), + ({"display_mode": "text"}, "text"), + ({"display_mode": "graphical"}, "graphical"), + ({"display_mode": "cmdline"}, "cmdline"), ] @@ -183,6 +185,7 @@ def test_kickstart_valid(tmp_path, test_input, expected): # pylint: disable=unu ({"reboot": {}}, "{} is not valid under any of the given schemas"), ({"reboot": "random-string"}, "'random-string' is not valid "), ({"reboot": {"random": "option"}}, "{'random': 'option'} is not valid "), + ({"display_mode": "invalid-mode"}, "'invalid-mode' is not one of "), ], ) def test_schema_validation_bad_apples(test_data, expected_err):