Turns out we were kickstart parsing errors, so parsing of the given command was not interrupted, but the error message was instead added to the output file. This garbage then caused shlex to throw an exception when parsing the file.
So I've set errorsAreFatal to True - with this errors end up in Journal, the boot option file has only correctly parsed options and Anaconda will abort the installation as usual when it re-parses the file on startup and gets the same error.
If the kickstart error prevents stage2 from startup, the error is in the system log and can be debugged.
Martin Kolman (1): Prevent kickstart parsing errors from ending up in boot options (#1060184)
dracut/parse-kickstart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
If errorsAreFatal is set to False, pykickstart only outputs the error message but does not interrupt parsing. This results in the kickstart parsing error message being included in the boot options file that is generated by the parse-kickstart Dracut module.
By setting errorsAreFatal to True, parsing is interrupted on error, the error message is correctly forwarded to the system log and the boot options include only output of correctly parsed kickstart commands.
Signed-off-by: Martin Kolman mkolman@redhat.com --- dracut/parse-kickstart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dracut/parse-kickstart b/dracut/parse-kickstart index 29e6e6f..7f873c0 100755 --- a/dracut/parse-kickstart +++ b/dracut/parse-kickstart @@ -458,7 +458,9 @@ def write_ifcfg(filename, ifcfg): def process_kickstart(ksfile): handler = DracutHandler() handler.ksdevice = os.environ.get('ksdevice') - parser = KickstartParser(handler, missingIncludeIsFatal=False, errorsAreFatal=False) + # we need to use errorsAreFatal, otherwise kickstart parsing errors + # will end up in the output file + parser = KickstartParser(handler, missingIncludeIsFatal=False, errorsAreFatal=True) log.info("processing kickstart file %s", ksfile) processed_file = preprocessKickstart(ksfile) try:
Turns out we were kickstart parsing errors, so parsing of the given command was not interrupted, but the error message was instead added to the output file. This garbage then caused shlex to throw an exception when parsing the file.
So I've set errorsAreFatal to True - with this errors end up in Journal, the boot option file has only correctly parsed options and Anaconda will abort the installation as usual when it re-parses the file on startup and gets the same error.
If the kickstart error prevents stage2 from startup, the error is in the system log and can be debugged.
Looks like a good fix to me.
- Chris
anaconda-patches@lists.fedorahosted.org