diff options
-rw-r--r-- | src/arch/i386/Makefile.inc | 2 | ||||
-rw-r--r-- | util/cbfstool/cbfstool.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/arch/i386/Makefile.inc b/src/arch/i386/Makefile.inc index 2459af102b..e2f464d285 100644 --- a/src/arch/i386/Makefile.inc +++ b/src/arch/i386/Makefile.inc @@ -14,7 +14,7 @@ ifdef POST_EVALUATION $(obj)/coreboot.rom: $(obj)/coreboot.bootblock $(obj)/coreboot_ram $(CBFSTOOL) rm -f $@ - $(CBFSTOOL) $@ create $(shell expr 1024 \* $(CONFIG_COREBOOT_ROMSIZE_KB)) $(obj)/coreboot.bootblock + $(CBFSTOOL) $@ create $(CONFIG_COREBOOT_ROMSIZE_KB)K $(obj)/coreboot.bootblock if [ -f fallback/coreboot_apc ]; \ then \ $(CBFSTOOL) $@ add-stage fallback/coreboot_apc fallback/coreboot_apc $(CBFS_COMPRESS_FLAG); \ diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c index 26e443364f..3c6db6f231 100644 --- a/util/cbfstool/cbfstool.c +++ b/util/cbfstool/cbfstool.c @@ -192,7 +192,14 @@ static int cbfs_create(int argc, char **argv) return 1; } - uint32_t size = strtoul(argv[3], NULL, 0); + char* suffix; + uint32_t size = strtoul(argv[3], &suffix, 0); + if (tolower(suffix[0])=='k') { + size *= 1024; + } + if (tolower(suffix[0])=='m') { + size *= 1024 * 1024; + } char *bootblock = argv[4]; uint32_t align = 0; |