Add the coreboot config to CBFS
authorCristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>
Sun, 19 Jun 2011 01:03:28 +0000 (03:03 +0200)
committerMarc Jones <marcj303@gmail.com>
Wed, 22 Jun 2011 04:43:23 +0000 (06:43 +0200)
The CBFS will contain a new file, named 'config' of type 'raw' that is a
stripped-down version of the .config file that was used to build the
current coreboot image. For space savings, all the comments and empty
lines were removed from the original config, except for one that lists
the coreboot git revision that's built into the image.

This is done in order to easily reproduce the work of  someone else when
only having their ROM image. In theory the reproduce could even be
automated by a new dedicated make target.

This should work even with abuild now.

Change-Id: I784989aac0227d3679d30314b06dadaec402749e
Signed-off-by: Cristian Măgherușan-Stanciu <cristi.magherusan@gmail.com>
Reviewed-on: http://review.coreboot.org/46
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
src/Kconfig
src/arch/x86/Makefile.inc

index 9abbc2169da546a56dbd0830961875dbfd77ad85..7e6214a4996f67271899c6366986d6ecb1087c73 100644 (file)
@@ -106,6 +106,12 @@ config COMPRESS_RAMSTAGE
          that decompression might slow down booting if the boot flash
          is connected through a slow Link (i.e. SPI)
 
+config INCLUDE_CONFIG_FILE
+  bool "Include the coreboot config file into the ROM image"
+       default y
+  help
+    Include in CBFS the coreboot config file that was used to compile the ROM image
+
 endmenu
 
 source src/mainboard/Kconfig
index 8c1a8878f861db2489dcaac9b99ae292e0aed3b0..e9c00deac337ed06871077cf6fb6a9b3db709cc6 100644 (file)
@@ -98,6 +98,13 @@ ifeq ($(CONFIG_GEODE_VSA_FILE),y)
        $(OBJCOPY) --set-start 0x20 --adjust-vma 0x60000 -I binary -O elf32-i386 -B i386 $(CONFIG_VSA_FILENAME) $(obj)/vsa.o
        $(LD) -m elf_i386 -e 0x60020 --section-start .data=0x60000 $(obj)/vsa.o -o $(obj)/vsa.elf
        $(CBFSTOOL) $@.tmp add-stage $(obj)/vsa.elf vsa
+endif
+ifeq ($(CONFIG_INCLUDE_CONFIG_FILE),y)
+       @printf "    CONFIG     $(DOTCONFIG)\n"
+       if [ -f $(DOTCONFIG) ]; then \
+       echo "# This image was built using git revision" `git rev-parse HEAD` > $(obj)/config.tmp ; \
+       sed -e '/^#/d' -e '/^ *$$/d' $(DOTCONFIG) >> $(obj)/config.tmp ; \
+       $(CBFSTOOL) $@.tmp add $(obj)/config.tmp config raw; rm -f $(obj)/config.tmp ; fi
 endif
        mv $@.tmp $@
        @printf "    CBFSPRINT  $(subst $(obj)/,,$(@))\n\n"