From 0c40a550b1d141e63705fa6ce991ca90468a7aa4 Mon Sep 17 00:00:00 2001 From: ward Date: Mon, 11 Feb 2008 20:36:54 +0000 Subject: [PATCH] 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 Acked-by: Jordan Crouse git-svn-id: svn://coreboot.org/buildrom@113 0fe3215d-741a-0410-bb5a-0d2cd39d948f --- buildrom-devel/Config.in | 10 ++++++++++ buildrom-devel/packages/busybox/busybox.mk | 3 +++ buildrom-devel/packages/coreboot-v2/coreboot.inc | 24 ++++++++++++++++++++++++ buildrom-devel/packages/filo/filo.mk | 2 ++ buildrom-devel/packages/kernel/kernel.inc | 2 ++ buildrom-devel/packages/uclibc/uclibc.mk | 2 ++ 6 files changed, 43 insertions(+) diff --git a/buildrom-devel/Config.in b/buildrom-devel/Config.in index 3a7195a..099b4f9 100644 --- a/buildrom-devel/Config.in +++ b/buildrom-devel/Config.in @@ -32,6 +32,16 @@ config VERBOSE 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 diff --git a/buildrom-devel/packages/busybox/busybox.mk b/buildrom-devel/packages/busybox/busybox.mk index 1a4aa1a..8e6daac 100644 --- a/buildrom-devel/packages/busybox/busybox.mk +++ b/buildrom-devel/packages/busybox/busybox.mk @@ -51,6 +51,9 @@ endif 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) \ diff --git a/buildrom-devel/packages/coreboot-v2/coreboot.inc b/buildrom-devel/packages/coreboot-v2/coreboot.inc index 0a414b6..1066657 100644 --- a/buildrom-devel/packages/coreboot-v2/coreboot.inc +++ b/buildrom-devel/packages/coreboot-v2/coreboot.inc @@ -81,6 +81,30 @@ $(CBV2_OUTPUT): $(CBV2_STAMP_DIR) $(CBV2_LOG_DIR) $(CBV2_DIR_TARGET) $(CBV2_PAYL @ 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..." diff --git a/buildrom-devel/packages/filo/filo.mk b/buildrom-devel/packages/filo/filo.mk index 89aa731..7873437 100644 --- a/buildrom-devel/packages/filo/filo.mk +++ b/buildrom-devel/packages/filo/filo.mk @@ -56,6 +56,8 @@ ifeq ($(findstring customconfig,$(FILO_CONFIG)),customconfig) @ 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 $@ diff --git a/buildrom-devel/packages/kernel/kernel.inc b/buildrom-devel/packages/kernel/kernel.inc index 0592e2a..57844fe 100644 --- a/buildrom-devel/packages/kernel/kernel.inc +++ b/buildrom-devel/packages/kernel/kernel.inc @@ -63,6 +63,8 @@ ifneq ($(findstring defconfig,$(KERNEL_CONFIG)),defconfig) 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) diff --git a/buildrom-devel/packages/uclibc/uclibc.mk b/buildrom-devel/packages/uclibc/uclibc.mk index 9280119..a71a4e5 100644 --- a/buildrom-devel/packages/uclibc/uclibc.mk +++ b/buildrom-devel/packages/uclibc/uclibc.mk @@ -56,6 +56,8 @@ endif 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) \ -- 2.11.4.GIT