[PATCH 1/1] tools/imximage: accept // as comment line start

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Apr 12 16:58:40 CEST 2020


arch/arm/mach-imx/spl_sd.cfg contains comments. These cannot be parsed by
'mkimage -T imximage'. We cannot use '#' in spl_sd.cfg as this leads to
a build error. So let's use "//" to mark comment lines.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 arch/arm/mach-imx/spl_qspi.cfg | 14 +++++++-------
 arch/arm/mach-imx/spl_sd.cfg   | 14 +++++++-------
 tools/imximage.c               |  7 +++++--
 3 files changed, 19 insertions(+), 16 deletions(-)

diff --git a/arch/arm/mach-imx/spl_qspi.cfg b/arch/arm/mach-imx/spl_qspi.cfg
index 88956e626f..6e79adb0da 100644
--- a/arch/arm/mach-imx/spl_qspi.cfg
+++ b/arch/arm/mach-imx/spl_qspi.cfg
@@ -1,7 +1,7 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+//

 #define __ASSEMBLY__
 #include <config.h>
@@ -9,9 +9,9 @@
 IMAGE_VERSION	2
 BOOT_FROM	qspi

-/*
- * Secure boot support
- */
+//
+// Secure boot support
+//
 #ifdef CONFIG_SECURE_BOOT
 CSF CONFIG_CSF_SIZE
 #endif
diff --git a/arch/arm/mach-imx/spl_sd.cfg b/arch/arm/mach-imx/spl_sd.cfg
index dbaee81535..b14becc2ce 100644
--- a/arch/arm/mach-imx/spl_sd.cfg
+++ b/arch/arm/mach-imx/spl_sd.cfg
@@ -1,7 +1,7 @@
-/* SPDX-License-Identifier: GPL-2.0+ */
-/*
- * Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
- */
+// SPDX-License-Identifier: GPL-2.0+
+//
+// Copyright (C) 2014, Compulab Ltd - http://compulab.co.il/
+//

 #define __ASSEMBLY__
 #include <config.h>
@@ -9,9 +9,9 @@
 IMAGE_VERSION	2
 BOOT_FROM	sd

-/*
- * Secure boot support
- */
+//
+// Secure boot support
+//
 #ifdef CONFIG_IMX_HAB
 CSF CONFIG_CSF_SIZE
 #endif
diff --git a/tools/imximage.c b/tools/imximage.c
index d7edd3c52f..4f62d57790 100644
--- a/tools/imximage.c
+++ b/tools/imximage.c
@@ -772,8 +772,11 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name)
 			if (token == NULL)
 				break;

-			/* Drop all text starting with '#' as comments */
-			if (token[0] == '#')
+			/*
+			 * Drop all text starting with '#' or "//" as comments
+			 */
+			if (token[0] == '#' ||
+			    (token[0] == '/' && token[1] == '/'))
 				break;

 			parse_cfg_fld(imxhdr, &cmd, token, name,
--
2.25.1



More information about the U-Boot mailing list