From 15432ea611e637872afd743e0261c087ccd5768a Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Sat, 22 Jul 2023 00:14:44 +0530 Subject: 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 [n-francis@ti.com: Added support for test output dir and testcase] Signed-off-by: Neha Malcom Francis --- tools/binman/image.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'tools/binman/image.py') 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): -- cgit v1.2.3