diff options
author | Andrew Davis <afd@ti.com> | 2023-07-22 00:14:44 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2023-07-21 19:36:59 -0400 |
commit | 15432ea611e637872afd743e0261c087ccd5768a (patch) | |
tree | 978418e3e29f248fa3698b56d9d61499db7aba57 /tools/binman/image.py | |
parent | 1ee652ab2f356c8a775bc4878f32f26f29a4c941 (diff) |
binman: Overwrite symlink if it already exists
Without this re-building will fail with an error when trying to create
the symlink for the second time with an already exists error.
Signed-off-by: Andrew Davis <afd@ti.com>
[n-francis@ti.com: Added support for test output dir and testcase]
Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Diffstat (limited to 'tools/binman/image.py')
-rw-r--r-- | tools/binman/image.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py index 8ebf71d61a8..e77b5d0d97c 100644 --- a/tools/binman/image.py +++ b/tools/binman/image.py @@ -182,6 +182,8 @@ class Image(section.Entry_section): # Create symlink to file if symlink given if self._symlink is not None: sname = tools.get_output_filename(self._symlink) + if os.path.islink(sname): + os.remove(sname) os.symlink(fname, sname) def WriteMap(self): |