Fix windows compilation
Path concatenation was wrong. Layout path was received as full path
and was concatenated to script directory path
Fix: do not prepend script directory path in case full path is received.
Issue reproduced on MSYS2
Change-Id: I5f627b5befcc56f4487dbfaaa1e2d9e1dd655103
Signed-off-by: Alexander Zilberkant <alexander.zilberkant@arm.com>
diff --git a/bl2/ext/mcuboot/scripts/imgtool.py b/bl2/ext/mcuboot/scripts/imgtool.py
index 80009c8..b984ce2 100644
--- a/bl2/ext/mcuboot/scripts/imgtool.py
+++ b/bl2/ext/mcuboot/scripts/imgtool.py
@@ -26,8 +26,13 @@
def find_load_address(args):
load_address_re = re.compile(r"^#define\sIMAGE_LOAD_ADDRESS\s+(0x[0-9a-fA-F]+)")
- scriptsDir = os.path.dirname(os.path.abspath(__file__))
- configFile = os.path.join(scriptsDir, args.layout)
+
+ if os.path.isabs(args.layout):
+ configFile = args.layout
+ else:
+ scriptsDir = os.path.dirname(os.path.abspath(__file__))
+ configFile = os.path.join(scriptsDir, args.layout)
+
ramLoadAddress = None
with open(configFile, 'r') as flash_layout_file:
for line in flash_layout_file: