Bug #591
closedBuild error on lenovo/m920q due to removal of ##ROM_BASE##
0%
Description
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 --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
Updated by Maximilian Brune 12 days ago
Thanks for adding a ticket.
You are right. I pushed a patch to: https://review.coreboot.org/c/coreboot/+/87288
Updated by Oberon 4071 11 days ago
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.
Updated by Matt DeVillier 11 days ago
- Status changed from New to Resolved
resolved by https://review.coreboot.org/c/coreboot/+/87288