The number of config files is encoded in the header. So far this was hardcoded to 4. Fix this to include the actual number of config files instead.
Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de> --- scripts/ti-board-config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/ti-board-config.py b/scripts/ti-board-config.py index 4b6214c299d7bf000a56d90dcdf9120d438f58ff..24731c66d017837ab66a78faa41f7c310644e79d 100755 --- a/scripts/ti-board-config.py +++ b/scripts/ti-board-config.py @@ -36,8 +36,6 @@ class Entry_ti_board_config: self._sw_rev = 1 self._devgrp = 0 self.cfgentries = [] - self.header = struct.pack('<BB', 4, 1) - self._binary_offset = len(self.header) self._schema_file = schema def _convert_to_byte_chunk(self, val, data_type): @@ -149,6 +147,9 @@ class Entry_ti_board_config: return data def save(self, filename): + print(len(self.cfgentries)) + self.header = struct.pack('<BB', len(self.cfgentries), 1) + self._binary_offset = len(self.header) with open(filename, "wb") as binary_file: binary_file.write(self.header) for i in self.cfgentries: -- 2.39.5