Issue #591 has been reported by Oberon 4071.
---------------------------------------- Bug #591: Build error on lenovo/m920q due to removal of ##ROM_BASE## https://ticket.coreboot.org/issues/591
* Author: Oberon 4071 * Status: New * Priority: Normal * Category: userspace utilities * Start date: 2025-04-11 * Affected hardware: lenovo/m920q ---------------------------------------- The current coreboot sources (25.03-161-gf6d40a9564) will not build when specifying lenovo/m920q as the mainboard, regardless of which payload is used. The following error occurs during build:
``` IFDTOOL IFDTOOL -p cnl -F build/fmap-template.fmd 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin File 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin is 4096 bytes Wrote layout to build/fmap-template.fmd HOSTCC cbfstool/fmaptool.o HOSTCC cbfstool/cbfs_sections.o HOSTCC cbfstool/fmap_from_fmd.o HOSTCC cbfstool/fmd.o HOSTCC cbfstool/fmd_parser.o HOSTCC cbfstool/fmd_scanner.o HOSTCC cbfstool/fmap.o HOSTCC cbfstool/kv_pair.o HOSTCC cbfstool/valstr.o HOSTCC cbfstool/fmaptool (link) FMAP build/util/cbfstool/fmaptool -h build/fmap_config.h build/fmap.fmd build/fmap.fmap syntax error FATAL: Failed while processing provided descriptor make: *** [Makefile.mk:1263: build/fmap.fmap] Error 4 ```
It appears that this error is the result of the commit a7eb390796ef4ba7baaffca741664b816de12256 (mb/*/*/*.fmd: Start flash at 0). This commit appears to remove all references to the token ##ROM_BASE##, but ifdtool has not been updated to reflect this change.
The following patch appears to fix the issue on my end and allow coreboot to build for lenovo/m920q:
``` diff diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 94105efe52..b21a89c0e1 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1094,7 +1094,7 @@ static void create_fmap_template(char *image, int size, const char *layout_fname exit(EXIT_FAILURE); }
- char *bbuf = "FLASH@##ROM_BASE## ##ROM_SIZE## {\n"; + char *bbuf = "FLASH ##ROM_SIZE## {\n"; if (write(layout_fd, bbuf, strlen(bbuf)) < 0) { perror("Could not write to file"); exit(EXIT_FAILURE); ```
In case it is needed, I have attached my .config settings.
---Files-------------------------------- config_lenovo_m920q_20250411.txt (26.6 KB)
Issue #591 has been updated by Maximilian Brune.
Thanks for adding a ticket. You are right. I pushed a patch to: https://review.coreboot.org/c/coreboot/+/87288
---------------------------------------- Bug #591: Build error on lenovo/m920q due to removal of ##ROM_BASE## https://ticket.coreboot.org/issues/591#change-2062
* Author: Oberon 4071 * Status: New * Priority: Normal * Category: userspace utilities * Start date: 2025-04-11 * Affected hardware: lenovo/m920q ---------------------------------------- The current coreboot sources (25.03-161-gf6d40a9564) will not build when specifying lenovo/m920q as the mainboard, regardless of which payload is used. The following error occurs during build:
``` IFDTOOL IFDTOOL -p cnl -F build/fmap-template.fmd 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin File 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin is 4096 bytes Wrote layout to build/fmap-template.fmd HOSTCC cbfstool/fmaptool.o HOSTCC cbfstool/cbfs_sections.o HOSTCC cbfstool/fmap_from_fmd.o HOSTCC cbfstool/fmd.o HOSTCC cbfstool/fmd_parser.o HOSTCC cbfstool/fmd_scanner.o HOSTCC cbfstool/fmap.o HOSTCC cbfstool/kv_pair.o HOSTCC cbfstool/valstr.o HOSTCC cbfstool/fmaptool (link) FMAP build/util/cbfstool/fmaptool -h build/fmap_config.h build/fmap.fmd build/fmap.fmap syntax error FATAL: Failed while processing provided descriptor make: *** [Makefile.mk:1263: build/fmap.fmap] Error 4 ```
It appears that this error is the result of the commit a7eb390796ef4ba7baaffca741664b816de12256 (mb/*/*/*.fmd: Start flash at 0). This commit appears to remove all references to the token ##ROM_BASE##, but ifdtool has not been updated to reflect this change.
The following patch appears to fix the issue on my end and allow coreboot to build for lenovo/m920q:
``` diff diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 94105efe52..b21a89c0e1 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1094,7 +1094,7 @@ static void create_fmap_template(char *image, int size, const char *layout_fname exit(EXIT_FAILURE); }
- char *bbuf = "FLASH@##ROM_BASE## ##ROM_SIZE## {\n"; + char *bbuf = "FLASH ##ROM_SIZE## {\n"; if (write(layout_fd, bbuf, strlen(bbuf)) < 0) { perror("Could not write to file"); exit(EXIT_FAILURE); ```
In case it is needed, I have attached my .config settings.
---Files-------------------------------- config_lenovo_m920q_20250411.txt (26.6 KB)
Issue #591 has been updated by Oberon 4071.
Maximilian Brune wrote in #note-1:
Thanks for adding a ticket. You are right. I pushed a patch to: https://review.coreboot.org/c/coreboot/+/87288
Thank you for this change. After this change was merged, coreboot is now building successfully for lenovo/m920q on my end. This ticket can be closed.
---------------------------------------- Bug #591: Build error on lenovo/m920q due to removal of ##ROM_BASE## https://ticket.coreboot.org/issues/591#change-2066
* Author: Oberon 4071 * Status: New * Priority: Normal * Category: userspace utilities * Start date: 2025-04-11 * Affected hardware: lenovo/m920q ---------------------------------------- The current coreboot sources (25.03-161-gf6d40a9564) will not build when specifying lenovo/m920q as the mainboard, regardless of which payload is used. The following error occurs during build:
``` IFDTOOL IFDTOOL -p cnl -F build/fmap-template.fmd 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin File 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin is 4096 bytes Wrote layout to build/fmap-template.fmd HOSTCC cbfstool/fmaptool.o HOSTCC cbfstool/cbfs_sections.o HOSTCC cbfstool/fmap_from_fmd.o HOSTCC cbfstool/fmd.o HOSTCC cbfstool/fmd_parser.o HOSTCC cbfstool/fmd_scanner.o HOSTCC cbfstool/fmap.o HOSTCC cbfstool/kv_pair.o HOSTCC cbfstool/valstr.o HOSTCC cbfstool/fmaptool (link) FMAP build/util/cbfstool/fmaptool -h build/fmap_config.h build/fmap.fmd build/fmap.fmap syntax error FATAL: Failed while processing provided descriptor make: *** [Makefile.mk:1263: build/fmap.fmap] Error 4 ```
It appears that this error is the result of the commit a7eb390796ef4ba7baaffca741664b816de12256 (mb/*/*/*.fmd: Start flash at 0). This commit appears to remove all references to the token ##ROM_BASE##, but ifdtool has not been updated to reflect this change.
The following patch appears to fix the issue on my end and allow coreboot to build for lenovo/m920q:
``` diff diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 94105efe52..b21a89c0e1 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1094,7 +1094,7 @@ static void create_fmap_template(char *image, int size, const char *layout_fname exit(EXIT_FAILURE); }
- char *bbuf = "FLASH@##ROM_BASE## ##ROM_SIZE## {\n"; + char *bbuf = "FLASH ##ROM_SIZE## {\n"; if (write(layout_fd, bbuf, strlen(bbuf)) < 0) { perror("Could not write to file"); exit(EXIT_FAILURE); ```
In case it is needed, I have attached my .config settings.
---Files-------------------------------- config_lenovo_m920q_20250411.txt (26.6 KB)
Issue #591 has been updated by Matt DeVillier.
Status changed from New to Resolved
resolved by https://review.coreboot.org/c/coreboot/+/87288
---------------------------------------- Bug #591: Build error on lenovo/m920q due to removal of ##ROM_BASE## https://ticket.coreboot.org/issues/591#change-2067
* Author: Oberon 4071 * Status: Resolved * Priority: Normal * Category: userspace utilities * Start date: 2025-04-11 * Affected hardware: lenovo/m920q ---------------------------------------- The current coreboot sources (25.03-161-gf6d40a9564) will not build when specifying lenovo/m920q as the mainboard, regardless of which payload is used. The following error occurs during build:
``` IFDTOOL IFDTOOL -p cnl -F build/fmap-template.fmd 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin File 3rdparty/blobs/mainboard/lenovo/m920q/descriptor.bin is 4096 bytes Wrote layout to build/fmap-template.fmd HOSTCC cbfstool/fmaptool.o HOSTCC cbfstool/cbfs_sections.o HOSTCC cbfstool/fmap_from_fmd.o HOSTCC cbfstool/fmd.o HOSTCC cbfstool/fmd_parser.o HOSTCC cbfstool/fmd_scanner.o HOSTCC cbfstool/fmap.o HOSTCC cbfstool/kv_pair.o HOSTCC cbfstool/valstr.o HOSTCC cbfstool/fmaptool (link) FMAP build/util/cbfstool/fmaptool -h build/fmap_config.h build/fmap.fmd build/fmap.fmap syntax error FATAL: Failed while processing provided descriptor make: *** [Makefile.mk:1263: build/fmap.fmap] Error 4 ```
It appears that this error is the result of the commit a7eb390796ef4ba7baaffca741664b816de12256 (mb/*/*/*.fmd: Start flash at 0). This commit appears to remove all references to the token ##ROM_BASE##, but ifdtool has not been updated to reflect this change.
The following patch appears to fix the issue on my end and allow coreboot to build for lenovo/m920q:
``` diff diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 94105efe52..b21a89c0e1 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -1094,7 +1094,7 @@ static void create_fmap_template(char *image, int size, const char *layout_fname exit(EXIT_FAILURE); }
- char *bbuf = "FLASH@##ROM_BASE## ##ROM_SIZE## {\n"; + char *bbuf = "FLASH ##ROM_SIZE## {\n"; if (write(layout_fd, bbuf, strlen(bbuf)) < 0) { perror("Could not write to file"); exit(EXIT_FAILURE); ```
In case it is needed, I have attached my .config settings.
---Files-------------------------------- config_lenovo_m920q_20250411.txt (26.6 KB)