Fix handling of UKI/SBAT and UKI/Firmware config entries. (#42478)

This fixes 2 issues with `ukify`:

`config_list_prepend` needs a list. The 2 more used entries are
specially treated (parsed into a list) and therefore happen to work, but
trying to set `UKI/Firmware` throws a type error, as it is passed as
just a string.

The `UKI/SBAT` config entry is a list but used the default `config_push`
value which sets it if unset (which also failed since its default of
`[]` is not `None`) - change this to `config_list_prepend`.

I did consider adding a `config_list_append`, but as far as I'm aware,
the order of sbat entries should not change the outcome anyway.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2026-06-19 15:16:30 +02:00
committed by GitHub
+3
View File
@@ -1762,6 +1762,8 @@ class ConfigItem:
old = getattr(namespace, dest, [])
if old is None:
old = []
if not isinstance(value, list):
value = [value]
setattr(namespace, dest, value + old)
@staticmethod
@@ -2016,6 +2018,7 @@ CONFIG_ITEMS = [
default=[],
action='append',
config_key='UKI/SBAT',
config_push=ConfigItem.config_list_prepend,
),
ConfigItem(
'--pcrpkey',