summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAndrew Davis <afd@ti.com>2023-05-31 10:11:49 -0500
committerUdit Kumar <u-kumar1@ti.com>2023-05-31 21:32:37 +0530
commit62bc3d9ad9ff31309337ec67732cf6f8391992d2 (patch)
treec799bcfd9c271776940c8de44409cbae92a214f4 /tools
parente8337941984269917b4a1b591f5e067786a5d574 (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>
Diffstat (limited to 'tools')
-rw-r--r--tools/binman/image.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/binman/image.py b/tools/binman/image.py
index 8ebf71d61a..e77b5d0d97 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):