[PATCH] tools: qcom: mkmbn: fix Elf constructor

Casey Connolly casey.connolly at linaro.org
Thu Oct 30 13:34:22 CET 2025



On 30/10/2025 09:42, Neil Armstrong wrote:
> On 10/28/25 12:13, Casey Connolly wrote:
>> The Elf class constructor was missing two optional parameters: the Ehdr
>> object and a list of Phdr's to populate the Elf.
>>
>> Add these back so that the parse() method will work correctly.
>>
>> Fixes: 9fe658c97f5e ("tools: qcom: add mkmbn.py")
>> Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
>> ---
>>   tools/qcom/mkmbn/elf.py | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/tools/qcom/mkmbn/elf.py b/tools/qcom/mkmbn/elf.py
>> index 86f12d1f4e5d..7737adc6a4e2 100644
>> --- a/tools/qcom/mkmbn/elf.py
>> +++ b/tools/qcom/mkmbn/elf.py
>> @@ -171,11 +171,11 @@ def _align(i: int, alignment: int) -> int:
>>   class Elf:
>>       ehdr: Ehdr
>>       phdrs: List[Phdr]
>>   -    def __init__(self):
>> -        self.ehdr = Ehdr()
>> -        self.phdrs: List[Phdr] = []
>> +    def __init__(self, ehdr: Ehdr | None = None, phdrs: List[Phdr] |
>> None = None):
>> +        self.ehdr = ehdr or Ehdr()
>> +        self.phdrs: List[Phdr] = phdrs or []
>>         def total_header_size(self):
>>           return self.ehdr.e_phoff + len(self.phdrs) *
>> self.ehdr.e_phentsize
>>   
> 
> This patch is required to finalize the Qcom PR, I guess it's fine, so LGTM
> 
> Reviewed-by: Neil Armstrong <neil.armstrong at linaro.org>

Even with this I kept running into issues with that series so it's
really not ready to go yet, dropped it and this patch from the PR. I'll
try and find some time to respin it soon and figure out the remaining
quirks.

Conceptually where I'm stuck is how to make the mbn stuff optional, we
want to have a list of soc/board compatible strings where we create it
and for other boards simply skip it, but binman doesn't have the concept
of optional binaries afaict?

A little lost in general with this one.

-- 
// Casey (she/her)



More information about the U-Boot mailing list