From 5d5f9429feda8f5689bd049e63f0c89ad169f413 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 4 Jun 2026 17:00:37 +0200 Subject: [PATCH 1/2] ukify: deal with non-list values in config_list_prepend `ConfigItem.config_list_prepend` assumed that the passed value was a list. This just happens to be the case for the `--initrd` and `--devicetree-auto` parameters, as those get special treatment in `ConfigItem.apply_config` as they use space separated lists. However, this is not generally the case: When trying to set `UKI/Firmware` the following error occurred: Traceback (most recent call last): File "/usr/bin/ukify", line 2565, in main() ~~~~^^ File "/usr/bin/ukify", line 2548, in main opts = UkifyConfig.from_namespace(parse_args()) ~~~~~~~~~~^^ File "/usr/bin/ukify", line 2542, in parse_args apply_config(opts) ~~~~~~~~~~~~^^^^^^ File "/usr/bin/ukify", line 2295, in apply_config item.apply_config(namespace, section_name, group, key, value) ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/ukify", line 1892, in apply_config self.config_push(namespace, group, dest, value) ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/bin/ukify", line 1765, in config_list_prepend setattr(namespace, dest, value + old) ~~~~~~^~~~~ TypeError: unsupported operand type(s) for +: 'PosixPath' and 'list' Since we can thus get both lists and strings, check the type and convert non-list values to `[value]`. Signed-off-by: Wolfgang Bumiller --- src/ukify/ukify.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 0377c57ea7..59078c98aa 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -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 From 345acde398611a24910fefa80c957fcbb6fc61d0 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Thu, 4 Jun 2026 17:07:22 +0200 Subject: [PATCH 2/2] ukify: honor UKI/SBAT from config files `UkifyConfig.sbat` is an optional list, so the default of `config_set_if_unset` would only accept a single value. Further, it is defined with an empty list as a default, causing configuration values to always be ignored, as the default is not `None`. Set its `config_push` to `ConfigItem.config_list_prepend` to collect the `SBAT` lines from the config. Signed-off-by: Wolfgang Bumiller --- src/ukify/ukify.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ukify/ukify.py b/src/ukify/ukify.py index 59078c98aa..7e3dd9038c 100755 --- a/src/ukify/ukify.py +++ b/src/ukify/ukify.py @@ -2018,6 +2018,7 @@ CONFIG_ITEMS = [ default=[], action='append', config_key='UKI/SBAT', + config_push=ConfigItem.config_list_prepend, ), ConfigItem( '--pcrpkey',