Skip to contentSkip to conversation

binman: Fix extract command for using non-absolute image paths

PATCH In review Jan Kiszka 2 participants 4 messages Nov 11, 2021 – Nov 24, 2021

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 binman: Fix extract command for using non-absolute image paths

From: Jan Kiszka <[email protected]>

Otherwise the updated image will end up in the temporary folder that is purged after completion.

---
 tools/binman/control.py | 1 +
 1 file changed, 1 insertion(+)
tools/binman/control.py +1 -0
index 8b5085152a..c112b404ab 100644
@@ -355,6 +355,7 @@ def ReplaceEntries(image_fname, input_fname, indir, entry_paths,
     Returns:
         List of EntryInfo records that were written
     """
+    image_fname = os.path.abspath(image_fname)
     image = Image.FromFile(image_fname)
 
     # Replace an entry from a single file, as a special case
Signature · 1 line
2.31.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Jan,

Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Otherwise the updated image will end up in the temporary folder that is purged after completion.

I'd like to add a test for this.

Regards,
Simon

Quoted 20 lines
---
 tools/binman/control.py | 1 +
 1 file changed, 1 insertion(+)
tools/binman/control.py +1 -1
index 8b5085152a..c112b404ab 100644
@@ -355,6 +355,7 @@ def ReplaceEntries(image_fname, input_fname, indir, entry_paths,
     Returns:
         List of EntryInfo records that were written
     """
+    image_fname = os.path.abspath(image_fname)
     image = Image.FromFile(image_fname)
 
     # Replace an entry from a single file, as a special case
--

2.31.1

Reviewed-by
#3 lore raw

Hi Jan,

Quoted 5 lines · Jan Kiszka

From: Jan Kiszka <[email protected]>

Otherwise the updated image will end up in the temporary folder that is purged after completion.

I'd like to add a test for this.

Regards,
Simon

Quoted 6 lines
---
 tools/binman/control.py | 1 +
 1 file changed, 1 insertion(+)

Applied to u-boot-dm, thanks!
Applied to u-boot-dm/next, thanks!