[coreboot] buildrom accountability

Jordan Crouse jordan.crouse at amd.com
Mon Feb 11 21:37:39 CET 2008


On 11/02/08 14:56 -0500, Ward Vandewege wrote:
> The attached patch stores build information in a new deploy/config directory,
> which can be saved with a generated image to help with potential
> reconstruction of that image at a later point in time.
> 
> There's probably some more information that could be stored - suggestions
> welcome.
> 
> THanks,
> Ward.

Awesome work 

Acked-by: Jordan Crouse <jordan.crouse at amd.com>

> -- 
> Ward Vandewege <ward at fsf.org>
> Free Software Foundation - Senior System Administrator

> 
> This patch aims to store as much information about the build environment as
> possible during the building of a coreboot image, in order to make it easy to
> recreate coreboot images at a later point in time.
> 
> It logs a number of things in the new deploy/config directory:
> * the buildrom .config file
> * config files used for compiling various packages (filo, kernel, uclibc, busybox)
> * the output of 'svn diff', 'svn info', 'svn status'
> * the output of 'uname -a'
> * a copy of /etc/lsb-release, /etc/debian-version, /etc/redhat-version if they exist
> * the output of '$(CC) --version', '$(MAKE) --version', '$(LD) --version'
> 
> The logging of SVN output can be disabled in kconfig because it means internet
> access must be available on the machine used for building the coreboot image.
> This setting defaults to on because we already try to download a lot of code if
> we don't have the necessary source packages in sources/.
> 
> Signed-off-by: Ward Vandewege <ward at gnu.org>
> 
> Index: Config.in
> ===================================================================
> --- Config.in	(revision 111)
> +++ Config.in	(working copy)
> @@ -32,6 +32,16 @@
>  	  See the entire build output on stdout. Otherwise, it will
>  	  be saved off in a series of logs
>  
> +config STORE_SVN_INFO
> +	bool "Store svn tree information in deployment directory."
> +	default y
> +	help
> +	  Store the output of 'svn diff', 'svn status' and 'svn info' in the
> +	  deploy/config/svn/ directory. This means the machine used to build 
> +	  the coreboot image will need to have internet access during the build.
> +		
> +	  If you are not sure, say yes.
> +
>  config MAKE_JOBS
>  	int "Number of make jobs to run simultaneously (experimental)"
>  	default 1
> Index: packages/kernel/kernel.inc
> ===================================================================
> --- packages/kernel/kernel.inc	(revision 111)
> +++ packages/kernel/kernel.inc	(working copy)
> @@ -63,6 +63,8 @@
>  endif
>  	@ $(MAKE) $(PARALLEL_MAKE) -C $(KERNEL_SRC_DIR) ARCH=$(KERNEL_BUILD_ARCH) \
>  	KERNEL_CC="$(CC)" KERNEL_LD="$(LD)" > $(KERNEL_BUILD_LOG) 2>&1
> +	@ mkdir -p $(OUTPUT_DIR)/config/kernel
> +	@ cp $(KERNEL_SRC_DIR)/.config $(OUTPUT_DIR)/config/kernel/
>  
>  $(OUTPUT_DIR)/bzImage: $(KERNEL_BZIMAGE)
>  	@ install -d $(OUTPUT_DIR)
> Index: packages/filo/filo.mk
> ===================================================================
> --- packages/filo/filo.mk	(revision 111)
> +++ packages/filo/filo.mk	(working copy)
> @@ -56,6 +56,8 @@
>  	@ echo "Using custom config $(PACKAGE_DIR)/filo/conf/$(FILO_CONFIG)"
>  endif
>  	@ make -C $(FILO_SRC_DIR) filo.elf > $(FILO_BUILD_LOG) 2>&1
> +	@ mkdir -p $(OUTPUT_DIR)/config/filo
> +	@ cp $(FILO_SRC_DIR)/Config $(OUTPUT_DIR)/config/filo/
>  
>  $(FILO_STAMP_DIR) $(FILO_LOG_DIR):
>  	@ mkdir -p $@
> Index: packages/busybox/busybox.mk
> ===================================================================
> --- packages/busybox/busybox.mk	(revision 111)
> +++ packages/busybox/busybox.mk	(working copy)
> @@ -51,7 +51,10 @@
>  	export LDFLAGS="$(LDFLAGS_orig)";\
>  	$(MAKE) -C $(BUSYBOX_SRC_DIR) VERBOSE=y \
>  	LIBRARIES="$(LIBS)" all > $(BUSYBOX_BUILD_LOG) 2>&1)
> +	@ mkdir -p $(OUTPUT_DIR)/config/busybox
> +	@ cp $(BUSYBOX_SRC_DIR)/.config $(OUTPUT_DIR)/config/busybox/
>  
> +
>  $(INITRD_DIR)/bin/busybox: $(BUSYBOX_SRC_DIR)/busybox | $(BUSYBOX_LOG_DIR)
>  	@ $(MAKE) -C $(BUSYBOX_SRC_DIR) \
>  	PREFIX=$(INITRD_DIR) install > $(BUSYBOX_INSTALL_LOG) 2>&1
> Index: packages/coreboot-v2/coreboot.inc
> ===================================================================
> --- packages/coreboot-v2/coreboot.inc	(revision 111)
> +++ packages/coreboot-v2/coreboot.inc	(working copy)
> @@ -81,6 +81,30 @@
>  	@ echo "Building coreboot..."
>  	@ (export CPU_OPT="$(STACKPROTECT)"; \
>  	make -C $(CBV2_BUILD_DIR) > $(CBV2_BUILD_LOG) 2>&1)
> +	@ mkdir -p $(OUTPUT_DIR)/config/coreboot-v2/
> +	@ cp $(CBV2_BUILD_DIR)/../$(CBV2_CONFIG) $(OUTPUT_DIR)/config/coreboot-v2/
> +	@ cp $(BASE_DIR)/.config $(OUTPUT_DIR)/config/
> +	@ mkdir -p $(OUTPUT_DIR)/config/system/
> +	@ uname -a >$(OUTPUT_DIR)/config/system/uname-a
> +	@ if [ -f /etc/lsb-release ]; then \
> +	cp /etc/lsb-release $(OUTPUT_DIR)/config/system/; \
> +	fi	
> +	@ if [ -f /etc/debian-version ]; then \
> +	cp /etc/debian-version $(OUTPUT_DIR)/config/system/; \
> +	fi
> +	@ if [ -f /etc/redhat-version ]; then \
> +	cp /etc/redhat-version $(OUTPUT_DIR)/config/system/; \
> +	fi
> +	@ mkdir -p $(OUTPUT_DIR)/config/toolchain/
> +	@ $(MAKE) --version >$(OUTPUT_DIR)/config/toolchain/$(MAKE)-version
> +	@ $(CC) --version >$(OUTPUT_DIR)/config/toolchain/$(CC)-version
> +	@ $(LD) --version >$(OUTPUT_DIR)/config/toolchain/$(LD)-version
> +ifeq ($(CONFIG_STORE_SVN_INFO),y)
> +	@ mkdir -p $(OUTPUT_DIR)/config/svn/
> +	@ svn diff > $(OUTPUT_DIR)/config/svn/svn.diff
> +	@ svn info > $(OUTPUT_DIR)/config/svn/svn.info
> +	@ svn status > $(OUTPUT_DIR)/config/svn/svn.status
> +endif
>  
>  generic-coreboot-clean:
>  	@ echo "Cleaning coreboot..."
> Index: packages/uclibc/uclibc.mk
> ===================================================================
> --- packages/uclibc/uclibc.mk	(revision 111)
> +++ packages/uclibc/uclibc.mk	(working copy)
> @@ -56,6 +56,8 @@
>  	SHARED_LIB_LOADER_PATH="/lib" \
>  	SHARED_LIB_LOADER_PREFIX="/lib" \
>  	all > $(UCLIBC_BUILD_LOG) 2>&1)
> +	@ mkdir -p $(OUTPUT_DIR)/config/uclibc
> +	@ cp $(UCLIBC_SRC_DIR)/.config $(OUTPUT_DIR)/config/uclibc/
>  
>  $(STAGING_DIR)/lib/libc.a: $(UCLIBC_SRC_DIR)/lib/libc.a
>  	@ $(MAKE) -C $(UCLIBC_SRC_DIR) \

> -- 
> coreboot mailing list
> coreboot at coreboot.org
> http://www.coreboot.org/mailman/listinfo/coreboot

-- 
Jordan Crouse
Systems Software Development Engineer 
Advanced Micro Devices, Inc.






More information about the coreboot mailing list