From 8ee4ec9bf560dd511f3bfecd5df254fb6814ef67 Mon Sep 17 00:00:00 2001 From: Alper Nebi Yasak Date: Sun, 27 Mar 2022 18:31:45 +0300 Subject: binman: Collect bintools for images when replacing entries Binman entries can use other executables to compute their data, usually in their ObtainContents() methods. Subclasses of Entry_section would use bintools in their BuildSectionData() method instead, which is called from several places including their Pack(). These binary tools are resolved correctly while building an image from a device-tree description so that they can be used from these methods. However, this is not being done when replacing entries in an image, which can result in an error as the Pack() methods attempt to use them. Collect and resolve entries' bintools also when replacing entries to fix Pack() errors. Add a way to mock bintool usage in the testing entry type and tests that check bintools are being resolved for such an entry. Signed-off-by: Alper Nebi Yasak Reviewed-by: Simon Glass --- tools/binman/control.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tools/binman/control.py') diff --git a/tools/binman/control.py b/tools/binman/control.py index d4c8dc89201..e170aeae4fa 100644 --- a/tools/binman/control.py +++ b/tools/binman/control.py @@ -299,6 +299,7 @@ def BeforeReplace(image, allow_resize): """ state.PrepareFromLoadedData(image) image.LoadData() + image.CollectBintools() # If repacking, drop the old offset/size values except for the original # ones, so we are only left with the constraints. -- cgit v1.2.3