From 74060163c97a6f1568535a507d64755fd8d6424f Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Mon, 8 Oct 2018 01:20:49 -0400 Subject: Consolidate R400/T400/T500/W500 Coreboot configs The goal here is to have fewer full configuration files. By consolidating the T400 board configs (and board variants such as the R400/T500/W500) into at most two base configs we can rely on separate target-specific configs (e.g., for different flash sizes) to override our default values given in projects/coreboot/configs/t400/config File contents of the new configs located at projects/coreboot/t400/variants/ are now supplied to make as command-line arguments, overriding the same configurations in the base config. The T400 file is included as an example of which configurations need to be overriden by a variant for a proper SMBIOS name to be used. Configs allowing for different ROM chip sizes other than the default are reimplemented in a subsequent commit. The following are no longer valid targets when building Coreboot: r400_16mb r400_8mb r400_4mb t400_16mb t400_8mb t400_4mb t500_16mb t500_8mb t500_4mb w500_16mb w500_8mb w500_4mb --- projects/coreboot/coreboot-helper | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'projects/coreboot/coreboot-helper') diff --git a/projects/coreboot/coreboot-helper b/projects/coreboot/coreboot-helper index 8a528fa5..ad696a16 100755 --- a/projects/coreboot/coreboot-helper +++ b/projects/coreboot/coreboot-helper @@ -29,6 +29,10 @@ coreboot_config_path() { project_file_path "$project" "$CONFIGS" "$CONFIG" "$@" } +coreboot_variant_config_path() { + project_file_path "$project" "$CONFIGS" "$VARIANTS/$board" "$@" +} + coreboot_ec_check() { project_file_test "$project" "$CONFIGS" "$EC" "$@" } -- cgit v1.2.3-70-g09d2 From 0fce215ebc61a162e95e745d42eb87849cd0b85d Mon Sep 17 00:00:00 2001 From: Andrew Robbins Date: Tue, 9 Oct 2018 18:32:12 -0400 Subject: Allow multiple config files when building Coreboot The base configuration for a given board can be overriden by config files (also named "config") placed into target-specific subdirectories. These additional configurations are read and passed to make as arguments, overriding their counterparts in the base config file; consquently, commented lines should not be added to these configs. R400/T400/T500/W500 ROMs may now be built for 4/8/16mb flash chip sizes. --- projects/coreboot/coreboot | 15 ++++++++++++--- projects/coreboot/coreboot-helper | 4 ++++ 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'projects/coreboot/coreboot-helper') diff --git a/projects/coreboot/coreboot b/projects/coreboot/coreboot index a8e13d8f..48da5939 100755 --- a/projects/coreboot/coreboot +++ b/projects/coreboot/coreboot @@ -66,7 +66,7 @@ build() { local sources_path=$(project_sources_path "$project" "$repository" "$board" "$@") local build_path=$(project_build_path "$project" "$board" "$@") - local config_path=$(coreboot_config_path "$board" "$@") + local base_config_path=$(coreboot_config_path "$board" "$@") local variant_config_path="$(coreboot_variant_config_path "$board" "$@")" local arch=$(coreboot_arch "$board" "$@") @@ -75,8 +75,17 @@ build() { local crossgcc_bin_path="$crossgcc_build_path/bin/" local vboot_sources_path=$(project_sources_path "vboot" "vboot" "devices") + local -i base_config_line_count="$(wc -l < "$base_config_path")" + local -a base_config_overrides local -a board_variant_config + # To only get overrides, trim out base config since + # we cannot skip it in project_file_contents_herit() + mapfile -t base_config_overrides \ + < <(tail -n +$(($base_config_line_count+1)) \ + < <(coreboot_config "$board" "$@") \ + 2>/dev/null) + mapfile -t board_variant_config < "$variant_config_path" if git_project_check "$repository" @@ -90,8 +99,8 @@ build() { mkdir -p "$build_path" - make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" KBUILD_DEFCONFIG="$config_path" "${board_variant_config[@]}" "defconfig" - make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" VBOOT_SOURCE="$vboot_sources_path" "${board_variant_config[@]}" -j$TASKS + make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" KBUILD_DEFCONFIG="$base_config_path" "${board_variant_config[@]}" "${base_config_overrides[@]}" "defconfig" + make -C "$sources_path" obj="$build_path" DOTCONFIG="$build_path/.config" XGCCPATH="$crossgcc_bin_path" BUILD_TIMELESS=1 KERNELVERSION="$VERSION" VBOOT_SOURCE="$vboot_sources_path" "${board_variant_config[@]}" "${base_config_overrides[@]}" -j$TASKS rm -f "$sources_path/.xcompile" } diff --git a/projects/coreboot/coreboot-helper b/projects/coreboot/coreboot-helper index ad696a16..d32ccb67 100755 --- a/projects/coreboot/coreboot-helper +++ b/projects/coreboot/coreboot-helper @@ -25,6 +25,10 @@ coreboot_arch() { project_file_contents "$project" "$CONFIGS" "$ARCH" "$@" } +coreboot_config() { + project_file_contents_herit "$project" "$CONFIGS" "$CONFIG" "$@" +} + coreboot_config_path() { project_file_path "$project" "$CONFIGS" "$CONFIG" "$@" } -- cgit v1.2.3-70-g09d2