From 2c13d63a854db64127eec3d362bc3bd9e1580cb9 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Tue, 8 Apr 2025 13:40:50 -0400 Subject: [PATCH 1/9] Makefiles: add overwrite_canary_if_coreboot_git function and use it in dev cycle helpers Signed-off-by: Thierry Laurion --- Makefile | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8f089db23..271dd4e87 100644 --- a/Makefile +++ b/Makefile @@ -894,8 +894,25 @@ $(board_build)/$(CB_OUTPUT_BASENAME)-gpg-injected.rom: $(board_build)/$(CB_OUTPU "$(board_build)/$(CB_OUTPUT_FILE_GPG_INJ)" "$(PUBKEY_ASC)" + #Dev cycles helpers: + +# Helper function to overwrite coreboot git repo's .canary file with a bogus commit (.canary checked for matching commit on build) +# TODO: Implement a cleaner solution to ensure files created by patches are properly deleted instead of requiring manual intervention. +define overwrite_canary_if_coreboot_git + @echo "Checking for coreboot directory: build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)" + if [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)" ] && \ + [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.git" ]; then \ + echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)' with placeholder."; \ + echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary"; \ + echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts."; \ + else \ + echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite."; \ + fi +endef + real.clean: + @echo "Cleaning build artifacts and install directories, leaving crossgcc intact." for dir in \ $(module_dirs) \ $(kernel_headers) \ @@ -905,15 +922,19 @@ real.clean: fi; \ done cd install && rm -rf -- * + $(call overwrite_canary_if_coreboot_git) + real.gitclean: @echo "Cleaning the repository using Git ignore file as a base..." @echo "This will wipe everything not in the Git tree, but keep downloaded coreboot forks (detected as Git repos)." git clean -fxd + $(call overwrite_canary_if_coreboot_git) real.gitclean_keep_packages: @echo "Cleaning the repository using Git ignore file as a base..." @echo "This will wipe everything not in the Git tree, but keep the 'packages' directory." git clean -fxd -e "packages" + $(call overwrite_canary_if_coreboot_git) real.remove_canary_files-extract_patch_rebuild_what_changed: @echo "Removing 'canary' files to force Heads to restart building board configurations..." @@ -925,9 +946,11 @@ real.remove_canary_files-extract_patch_rebuild_what_changed: @echo "Only a minimal time is needed for rebuilding, which is also good for your SSD." @echo "*** USE THIS APPROACH FIRST ***" find ./build/ -type f -name ".canary" -print -delete - find ./install/*/* -print -exec rm -rf {} + + find ./install/*/* -print -exec rm -rf {} + 2>/dev/null || true + $(call overwrite_canary_if_coreboot_git) real.gitclean_keep_packages_and_build: @echo "Cleaning the repository using Git ignore file as a base..." @echo "This will wipe everything not in the Git tree, but keep the 'packages' and 'build' directories." git clean -fxd -e "packages" -e "build" + $(call overwrite_canary_if_coreboot_git) From 039ec8ae7a35047cd4af1b08e4fe6367efa39708 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Tue, 8 Apr 2025 15:14:09 -0400 Subject: [PATCH 2/9] Makefiles: real.remove_canary_files-extract_patch_rebuild_what_changed updated so that it wipes things correctly Signed-off-by: Thierry Laurion --- Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Makefile b/Makefile index 271dd4e87..997640b72 100644 --- a/Makefile +++ b/Makefile @@ -906,6 +906,29 @@ define overwrite_canary_if_coreboot_git echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)' with placeholder."; \ echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary"; \ echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts."; \ + echo "INFO: Reversing patches dynamically in reverse order."; \ + failed_patches=""; \ + for patch in $(shell ls patches/coreboot-$(CONFIG_COREBOOT_VERSION)/*.patch | sort -r); do \ + echo "INFO: Reversing patch file: $$patch"; \ + if ! ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ); then \ + echo "WARNING: Failed to reverse patch file: $$patch"; \ + failed_patches="$$failed_patches $$patch"; \ + fi; \ + done; \ + if [ -r patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ]; then \ + echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch."; \ + if ! ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ); then \ + echo "WARNING: Failed to reverse main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch"; \ + failed_patches="$$failed_patches patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch"; \ + fi; \ + fi; \ + if [ -n "$$failed_patches" ]; then \ + echo "WARNING: The following patches failed to reverse: $$failed_patches"; \ + else \ + echo "INFO: All patches reversed successfully."; \ + fi; \ + echo "INFO: Removing .patched file to allow reapplication of patches."; \ + rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.patched"; \ else \ echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite."; \ fi From 5226db35bc7ffed139fadcae1725b0a32f64ae60 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Tue, 8 Apr 2025 16:36:20 -0400 Subject: [PATCH 3/9] modules/coreboot: make sure coreboot_dir artifacts (board coreboot's objdir) is wiped clean on each build so coreboot stages to be stitched are clean Signed-off-by: Thierry Laurion --- Makefile | 82 ++++++++++++++++++++++++++++-------------------- modules/coreboot | 1 + 2 files changed, 49 insertions(+), 34 deletions(-) diff --git a/Makefile b/Makefile index 997640b72..b1194995a 100644 --- a/Makefile +++ b/Makefile @@ -427,17 +427,21 @@ define define_module = echo "INFO: .patched file not found. Beginning patch application for $1"; \ if [ -r patches/$($1_patch_name).patch ]; then \ echo "INFO: Found patch file patches/$($1_patch_name).patch. Applying patch..."; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) ) \ - < patches/$($1_patch_name).patch \ - || exit 1 ; \ + if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ + echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying."; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ + fi; \ fi && \ if [ -d patches/$($1_patch_name) ] && \ - [ -r patches/$($1_patch_name) ] ; then \ + [ -r patches/$($1_patch_name) ] || [ -n "$$(ls patches/$($1_patch_name)/*.patch 2>/dev/null)" ]; then \ for patch in patches/$($1_patch_name)/*.patch ; do \ echo "Applying patch file : $$$$patch " ; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) ) \ - < $$$$patch \ - || exit 1 ; \ + if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ + echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ + fi; \ done ; \ fi && \ echo "INFO: Patches applied successfully. Creating .patched file"; \ @@ -465,20 +469,42 @@ define define_module = mkdir -p "$$(dir $$@)" tar -xf "$(packages)/$($1_tar)" $(or $($1_tar_opt),--strip 1) -C "$$(dir $$@)" if [ -r patches/$($1_patch_name).patch ]; then \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) ) \ - < patches/$($1_patch_name).patch \ - || exit 1 ; \ + echo "INFO: Applying single patch file patches/$($1_patch_name).patch"; \ + if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ + echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying."; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ + fi; \ fi - if [ -d patches/$($1_patch_name) ] && \ - [ -r patches/$($1_patch_name) ] ; then \ - for patch in patches/$($1_patch_name)/*.patch ; do \ - echo "Applying patch file : $$$$patch " ; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) ) \ - < $$$$patch \ - || exit 1 ; \ - done ; \ + if [ -d patches/$($1_patch_name) ]; then \ + for patch in patches/$($1_patch_name)/*.patch; do \ + echo "INFO: Applying patch file: $$$$patch"; \ + if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ + echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ + fi; \ + done; \ fi - @touch "$$@" + if [ ! -e "$$@" ] && [ -e "$(build)/$($1_base_dir)/.patched" ]; then \ + echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1"; \ + if [ -r patches/$($1_patch_name).patch ]; then \ + echo "INFO: Reversing single patch file patches/$($1_patch_name).patch."; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ + echo "INFO: Reapplying single patch file patches/$($1_patch_name).patch."; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ + fi; \ + if [ -d patches/$($1_patch_name) ]; then \ + for patch in patches/$($1_patch_name)/*.patch; do \ + echo "INFO: Reversing patch file: $$$$patch"; \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ + echo "INFO: Reapplying patch file: $$$$patch"; \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ + done; \ + fi; \ + rm -f "$(build)/$($1_base_dir)/.patched"; \ + fi + touch "$$@" endif # Allow the module to override the destination configuration file @@ -907,25 +933,13 @@ define overwrite_canary_if_coreboot_git echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary"; \ echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts."; \ echo "INFO: Reversing patches dynamically in reverse order."; \ - failed_patches=""; \ - for patch in $(shell ls patches/coreboot-$(CONFIG_COREBOOT_VERSION)/*.patch | sort -r); do \ + for patch in $$(ls patches/coreboot-$(CONFIG_COREBOOT_VERSION)/*.patch 2>/dev/null | sort -r); do \ echo "INFO: Reversing patch file: $$patch"; \ - if ! ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ); then \ - echo "WARNING: Failed to reverse patch file: $$patch"; \ - failed_patches="$$failed_patches $$patch"; \ - fi; \ + ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ) || true; \ done; \ if [ -r patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ]; then \ echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch."; \ - if ! ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ); then \ - echo "WARNING: Failed to reverse main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch"; \ - failed_patches="$$failed_patches patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch"; \ - fi; \ - fi; \ - if [ -n "$$failed_patches" ]; then \ - echo "WARNING: The following patches failed to reverse: $$failed_patches"; \ - else \ - echo "INFO: All patches reversed successfully."; \ + ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ) || true; \ fi; \ echo "INFO: Removing .patched file to allow reapplication of patches."; \ rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.patched"; \ diff --git a/modules/coreboot b/modules/coreboot index 84b9f5130..f3bda07f6 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -150,6 +150,7 @@ endif $(coreboot_module)_configure := \ mkdir -p "$(build)/$(coreboot_dir)"; \ + rm -rf $(build)/$(coreboot_dir)/*; \ $(call install_config,$(pwd)/$(CONFIG_COREBOOT_CONFIG),$(build)/$(coreboot_dir)/.config); \ sed -i '/^CONFIG_LOCALVERSION/d' $(build)/$(coreboot_dir)/.config; \ echo 'CONFIG_LOCALVERSION=$(CONFIG_COREBOOT_LOCALVERSION)' >> $(build)/$(coreboot_dir)/.config; \ From da38f7b98ef7acff56014d19e12acafe74d83e8e Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 11 Apr 2025 10:31:03 -0400 Subject: [PATCH 4/9] Makefile: fix code blocks that need to all be ran subsequently without failing Signed-off-by: Thierry Laurion --- Makefile | 136 +++++++++++++++++++++++++++---------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/Makefile b/Makefile index b1194995a..2d65bae68 100644 --- a/Makefile +++ b/Makefile @@ -400,52 +400,52 @@ define define_module = # module-specific cleanup action to get rid of it. $(build)/$($1_base_dir)/.canary: FORCE if [ ! -e "$$@" ]; then \ - echo "INFO: .canary file not found. Cloning repository $($1_repo) into $(build)/$($1_base_dir)"; \ - git clone $($1_repo) "$(build)/$($1_base_dir)"; \ - echo "INFO: Resetting repository to commit $($1_commit_hash)"; \ - git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash); \ - echo "INFO: Creating .canary file with repo and commit hash"; \ - echo -n '$($1_repo)|$($1_commit_hash)' > "$$@"; \ + echo "INFO: .canary file not found. Cloning repository $($1_repo) into $(build)/$($1_base_dir)" && \ + git clone $($1_repo) "$(build)/$($1_base_dir)" && \ + echo "INFO: Resetting repository to commit $($1_commit_hash)" && \ + git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && \ + echo "INFO: Creating .canary file with repo and commit hash" && \ + echo -n '$($1_repo)|$($1_commit_hash)' > "$$@" ; \ elif [ "$$$$(cat "$$@")" != '$($1_repo)|$($1_commit_hash)' ]; then \ - echo "INFO: Canary file differs. Switching $1 to $($1_repo) at $($1_commit_hash)"; \ + echo "INFO: Canary file differs. Switching $1 to $($1_repo) at $($1_commit_hash)" && \ git -C "$(build)/$($1_base_dir)" reset --hard HEAD^ && \ - echo "INFO: Fetching commit $($1_commit_hash) from $($1_repo) (without recursing submodules)"; \ + echo "INFO: Fetching commit $($1_commit_hash) from $($1_repo) (without recursing submodules)" && \ git -C "$(build)/$($1_base_dir)" fetch $($1_repo) $($1_commit_hash) --recurse-submodules=no && \ - echo "INFO: Resetting repository to commit $($1_commit_hash)"; \ - git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash); \ - echo "INFO: Cleaning repository directory (including payloads and util/cbmem)"; \ + echo "INFO: Resetting repository to commit $($1_commit_hash)" && \ + git -C "$(build)/$($1_base_dir)" reset --hard $($1_commit_hash) && \ + echo "INFO: Cleaning repository directory (including payloads and util/cbmem)" && \ git -C "$(build)/$($1_base_dir)" clean -df && \ git -C "$(build)/$($1_base_dir)" clean -dffx payloads util/cbmem && \ - echo "INFO: Synchronizing submodules"; \ + echo "INFO: Synchronizing submodules" && \ git -C "$(build)/$($1_base_dir)" submodule sync && \ - echo "INFO: Updating submodules (init and checkout)"; \ + echo "INFO: Updating submodules (init and checkout)" && \ git -C "$(build)/$($1_base_dir)" submodule update --init --checkout && \ - echo "INFO: Updating .canary file with new repo info"; \ - echo -n '$($1_repo)|$($1_commit_hash)' > "$$@"; \ + echo "INFO: Updating .canary file with new repo info" && \ + echo -n '$($1_repo)|$($1_commit_hash)' > "$$@" ; \ fi if [ ! -e "$(build)/$($1_base_dir)/.patched" ]; then \ - echo "INFO: .patched file not found. Beginning patch application for $1"; \ + echo "INFO: .patched file not found. Beginning patch application for $1" && \ if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Found patch file patches/$($1_patch_name).patch. Applying patch..."; \ + echo "INFO: Found patch file patches/$($1_patch_name).patch. Applying patch..." && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ - echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying."; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ - fi; \ + echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying." && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ + fi ; \ fi && \ if [ -d patches/$($1_patch_name) ] && \ [ -r patches/$($1_patch_name) ] || [ -n "$$(ls patches/$($1_patch_name)/*.patch 2>/dev/null)" ]; then \ for patch in patches/$($1_patch_name)/*.patch ; do \ - echo "Applying patch file : $$$$patch " ; \ + echo "Applying patch file : $$$$patch " && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ - echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ - fi; \ + echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1 ; \ + fi ; \ done ; \ fi && \ - echo "INFO: Patches applied successfully. Creating .patched file"; \ - touch "$(build)/$($1_base_dir)/.patched"; \ + echo "INFO: Patches applied successfully. Creating .patched file" && \ + touch "$(build)/$($1_base_dir)/.patched" ; \ fi else # Versioned modules (each version a separate module) don't need to include @@ -469,40 +469,40 @@ define define_module = mkdir -p "$$(dir $$@)" tar -xf "$(packages)/$($1_tar)" $(or $($1_tar_opt),--strip 1) -C "$$(dir $$@)" if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Applying single patch file patches/$($1_patch_name).patch"; \ + echo "INFO: Applying single patch file patches/$($1_patch_name).patch" && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ - echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying."; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ - fi; \ - fi + echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying." && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ + fi ; \ + fi ; \ if [ -d patches/$($1_patch_name) ]; then \ for patch in patches/$($1_patch_name)/*.patch; do \ - echo "INFO: Applying patch file: $$$$patch"; \ + echo "INFO: Applying patch file: $$$$patch" && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ - echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ - fi; \ - done; \ + echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1 ; \ + fi ; \ + done ; \ fi if [ ! -e "$$@" ] && [ -e "$(build)/$($1_base_dir)/.patched" ]; then \ - echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1"; \ + echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1" && \ if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Reversing single patch file patches/$($1_patch_name).patch."; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true; \ - echo "INFO: Reapplying single patch file patches/$($1_patch_name).patch."; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1; \ - fi; \ + echo "INFO: Reversing single patch file patches/$($1_patch_name).patch." && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ + echo "INFO: Reapplying single patch file patches/$($1_patch_name).patch." && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ + fi ; \ if [ -d patches/$($1_patch_name) ]; then \ for patch in patches/$($1_patch_name)/*.patch; do \ - echo "INFO: Reversing patch file: $$$$patch"; \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true; \ - echo "INFO: Reapplying patch file: $$$$patch"; \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1; \ - done; \ - fi; \ - rm -f "$(build)/$($1_base_dir)/.patched"; \ + echo "INFO: Reversing patch file: $$$$patch" && \ + ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ + echo "INFO: Reapplying patch file: $$$$patch" && \ + ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1 ; \ + done ; \ + fi ; \ + rm -f "$(build)/$($1_base_dir)/.patched" ; \ fi touch "$$@" endif @@ -929,22 +929,22 @@ define overwrite_canary_if_coreboot_git @echo "Checking for coreboot directory: build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)" if [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)" ] && \ [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.git" ]; then \ - echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)' with placeholder."; \ - echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary"; \ - echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts."; \ - echo "INFO: Reversing patches dynamically in reverse order."; \ + echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)' with placeholder." && \ + echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary" && \ + echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts." && \ + echo "INFO: Reversing patches dynamically in reverse order." && \ for patch in $$(ls patches/coreboot-$(CONFIG_COREBOOT_VERSION)/*.patch 2>/dev/null | sort -r); do \ - echo "INFO: Reversing patch file: $$patch"; \ - ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ) || true; \ - done; \ + echo "INFO: Reversing patch file: $$patch" && \ + ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ) || true ; \ + done && \ if [ -r patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ]; then \ - echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch."; \ - ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ) || true; \ - fi; \ - echo "INFO: Removing .patched file to allow reapplication of patches."; \ - rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.patched"; \ + echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch." && \ + ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ) || true ; \ + fi && \ + echo "INFO: Removing .patched file to allow reapplication of patches." && \ + rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.patched" ; \ else \ - echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite."; \ + echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite." ; \ fi endef @@ -955,8 +955,8 @@ real.clean: $(kernel_headers) \ ; do \ if [ ! -z "$$dir" ]; then \ - rm -rf "build/${CONFIG_TARGET_ARCH}/$$dir"; \ - fi; \ + rm -rf "build/${CONFIG_TARGET_ARCH}/$$dir" ; \ + fi ; \ done cd install && rm -rf -- * $(call overwrite_canary_if_coreboot_git) From d559fcfa1623f8d28daa55bb59c07edc52971758 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 11 Apr 2025 13:13:17 -0400 Subject: [PATCH 5/9] Makefile: overwrite_canary_if_coreboot_git helper; only inject coreboot git .canary with bogus commit, remove duplicated patches apply/reversal/reapply logic Signed-off-by: Thierry Laurion --- Makefile | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 2d65bae68..99f73fe58 100644 --- a/Makefile +++ b/Makefile @@ -931,18 +931,7 @@ define overwrite_canary_if_coreboot_git [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.git" ]; then \ echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)' with placeholder." && \ echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.canary" && \ - echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts." && \ - echo "INFO: Reversing patches dynamically in reverse order." && \ - for patch in $$(ls patches/coreboot-$(CONFIG_COREBOOT_VERSION)/*.patch 2>/dev/null | sort -r); do \ - echo "INFO: Reversing patch file: $$patch" && \ - ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < $$patch ) || true ; \ - done && \ - if [ -r patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ]; then \ - echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch." && \ - ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION) < patches/coreboot-$(CONFIG_COREBOOT_VERSION).patch ) || true ; \ - fi && \ - echo "INFO: Removing .patched file to allow reapplication of patches." && \ - rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION)/.patched" ; \ + echo "INFO: .canary file has been recreated." ; \ else \ echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite." ; \ fi From 96d2c2f814359911e299fbaf0f1e12fcc86be5fb Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 11 Apr 2025 14:06:02 -0400 Subject: [PATCH 6/9] Makefile: simplify patch application, reversal + reapplication if failed logic without subshell Signed-off-by: Thierry Laurion --- Makefile | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index 99f73fe58..aedeeb8d1 100644 --- a/Makefile +++ b/Makefile @@ -427,25 +427,24 @@ define define_module = echo "INFO: .patched file not found. Beginning patch application for $1" && \ if [ -r patches/$($1_patch_name).patch ]; then \ echo "INFO: Found patch file patches/$($1_patch_name).patch. Applying patch..." && \ - if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ + if ! git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch; then \ echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying." && \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ - fi ; \ - fi && \ - if [ -d patches/$($1_patch_name) ] && \ - [ -r patches/$($1_patch_name) ] || [ -n "$$(ls patches/$($1_patch_name)/*.patch 2>/dev/null)" ]; then \ - for patch in patches/$($1_patch_name)/*.patch ; do \ - echo "Applying patch file : $$$$patch " && \ - if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ + git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch || true && \ + git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch || exit 1; \ + fi; \ + fi; \ + if [ -d patches/$($1_patch_name) ]; then \ + for patch in patches/$($1_patch_name)/*.patch; do \ + echo "Applying patch file: $$$$patch" && \ + if ! git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch"; then \ echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \ - ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ - ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1 ; \ - fi ; \ - done ; \ - fi && \ + git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch" || true && \ + git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch" || exit 1; \ + fi; \ + done; \ + fi; \ echo "INFO: Patches applied successfully. Creating .patched file" && \ - touch "$(build)/$($1_base_dir)/.patched" ; \ + touch "$(build)/$($1_base_dir)/.patched"; \ fi else # Versioned modules (each version a separate module) don't need to include From 83c8947240ce05986f0a8d72862786a2d07e70b7 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 11 Apr 2025 14:17:22 -0400 Subject: [PATCH 7/9] Makefile: unify console output for unique patch application vs multiple ones under patches/* Signed-off-by: Thierry Laurion --- Makefile | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index aedeeb8d1..8fb3c10f8 100644 --- a/Makefile +++ b/Makefile @@ -426,24 +426,25 @@ define define_module = if [ ! -e "$(build)/$($1_base_dir)/.patched" ]; then \ echo "INFO: .patched file not found. Beginning patch application for $1" && \ if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Found patch file patches/$($1_patch_name).patch. Applying patch..." && \ + echo "INFO: Applying single patch file: patches/$($1_patch_name).patch" && \ if ! git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch; then \ - echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying." && \ + echo "ERROR: Failed to apply patch: patches/$($1_patch_name).patch. Reversing and reapplying." && \ git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch || true && \ git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch || exit 1; \ fi; \ fi; \ if [ -d patches/$($1_patch_name) ]; then \ + echo "INFO: Applying multiple patch files from directory: patches/$($1_patch_name)" && \ for patch in patches/$($1_patch_name)/*.patch; do \ - echo "Applying patch file: $$$$patch" && \ + echo "INFO: Applying patch file: $$$$patch" && \ if ! git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch"; then \ - echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \ + echo "ERROR: Failed to apply patch: $$$$patch. Reversing and reapplying." && \ git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch" || true && \ git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < "$$$$patch" || exit 1; \ fi; \ done; \ fi; \ - echo "INFO: Patches applied successfully. Creating .patched file" && \ + echo "INFO: Patches applied successfully. Creating .patched file." && \ touch "$(build)/$($1_base_dir)/.patched"; \ fi else @@ -468,19 +469,21 @@ define define_module = mkdir -p "$$(dir $$@)" tar -xf "$(packages)/$($1_tar)" $(or $($1_tar_opt),--strip 1) -C "$$(dir $$@)" if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Applying single patch file patches/$($1_patch_name).patch" && \ + echo "INFO: Applying single patch file: patches/$($1_patch_name).patch" && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ); then \ - echo "ERROR: Failed to apply patch patches/$($1_patch_name).patch. Reversing and reapplying." && \ + echo "ERROR: Failed to apply patch: patches/$($1_patch_name).patch. Reversing and reapplying." && \ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ fi ; \ fi ; \ if [ -d patches/$($1_patch_name) ]; then \ + echo "INFO: Applying multiple patch files from directory: patches/$($1_patch_name)" && \ for patch in patches/$($1_patch_name)/*.patch; do \ echo "INFO: Applying patch file: $$$$patch" && \ if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ); then \ - echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \ + echo "ERROR: Failed to apply patch: $$$$patch. Reversing and reapplying." && \ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ + echo "INFO: Reapplying patch file: $$$$patch" && \ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || exit 1 ; \ fi ; \ done ; \ @@ -488,12 +491,13 @@ define define_module = if [ ! -e "$$@" ] && [ -e "$(build)/$($1_base_dir)/.patched" ]; then \ echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1" && \ if [ -r patches/$($1_patch_name).patch ]; then \ - echo "INFO: Reversing single patch file patches/$($1_patch_name).patch." && \ + echo "INFO: Reversing single patch file: patches/$($1_patch_name).patch." && \ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || true && \ - echo "INFO: Reapplying single patch file patches/$($1_patch_name).patch." && \ + echo "INFO: Reapplying single patch file: patches/$($1_patch_name).patch." && \ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < patches/$($1_patch_name).patch ) || exit 1 ; \ fi ; \ if [ -d patches/$($1_patch_name) ]; then \ + echo "INFO: Reversing and reapplying multiple patch files from directory: patches/$($1_patch_name)" && \ for patch in patches/$($1_patch_name)/*.patch; do \ echo "INFO: Reversing patch file: $$$$patch" && \ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH)/$($1_base_dir) < $$$$patch ) || true && \ From 4981e7069d9fde3578704ef602a958f48a53a085 Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Sat, 12 Apr 2025 15:13:31 -0400 Subject: [PATCH 8/9] Makefile: Wipe coreboot_dir and board_dir cleanup in canary dev cycle helper for reproducible builds in dev cycles Otherwise qemu roms which injects distinct public key with entropy at each build are wiped. TODO : revisit approach when flashrom/flashprog/qemu supports 16MB SPI flash emulation so we can use flashprog to flash internally, which will require refactoring Signed-off-by: Thierry Laurion --- Makefile | 10 ++++++++-- modules/coreboot | 1 - 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8fb3c10f8..16db0e539 100644 --- a/Makefile +++ b/Makefile @@ -974,8 +974,14 @@ real.remove_canary_files-extract_patch_rebuild_what_changed: @echo "This approach economizes time since most build artifacts do not need to be rebuilt, as the file dates should be the same as when you originally built them." @echo "Only a minimal time is needed for rebuilding, which is also good for your SSD." @echo "*** USE THIS APPROACH FIRST ***" - find ./build/ -type f -name ".canary" -print -delete - find ./install/*/* -print -exec rm -rf {} + 2>/dev/null || true + @echo "Removing ./build .canary files..." + @find ./build/ -type f -name ".canary" -print -delete || true + @echo "Removing install/*/* content..." + @find ./install/*/* -print -exec rm -rf {} + 2>/dev/null || true + @echo "Removing coreboot board related artifact directory: $(build)/$(coreboot_dir)" + rm -rf "$(build)/$(coreboot_dir)" + @echo "Removing coreboot board related artifacts directory $(board_build)" + rm -rf "$(board_build)" $(call overwrite_canary_if_coreboot_git) real.gitclean_keep_packages_and_build: diff --git a/modules/coreboot b/modules/coreboot index f3bda07f6..84b9f5130 100644 --- a/modules/coreboot +++ b/modules/coreboot @@ -150,7 +150,6 @@ endif $(coreboot_module)_configure := \ mkdir -p "$(build)/$(coreboot_dir)"; \ - rm -rf $(build)/$(coreboot_dir)/*; \ $(call install_config,$(pwd)/$(CONFIG_COREBOOT_CONFIG),$(build)/$(coreboot_dir)/.config); \ sed -i '/^CONFIG_LOCALVERSION/d' $(build)/$(coreboot_dir)/.config; \ echo 'CONFIG_LOCALVERSION=$(CONFIG_COREBOOT_LOCALVERSION)' >> $(build)/$(coreboot_dir)/.config; \ From 46e6efea68fb29dd9fc47ef1945d2e7937433d2e Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Sun, 13 Apr 2025 10:34:15 -0400 Subject: [PATCH 9/9] CircleCI: Remove Makefile from save_Cache second layer (coreboot crossgcc reusable cache layer) from being reused to speed up rebuilds Signed-off-by: Thierry Laurion --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f6cf08e44..ec4607f41 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -68,7 +68,7 @@ jobs: - run: name: Creating coreboot (and associated patches) and musl-cross-make modules digest (musl-cross-make and coreboot cache digest) command: | - find .circleci/config.yml ./Makefile ./flake.lock ./modules/coreboot ./modules/musl-cross-make* ./patches/coreboot* -type f | sort -h | xargs sha256sum > ./tmpDir/coreboot_musl-cross-make.sha256sums + find .circleci/config.yml ./flake.lock ./modules/coreboot ./modules/musl-cross-make* ./patches/coreboot* -type f | sort -h | xargs sha256sum > ./tmpDir/coreboot_musl-cross-make.sha256sums - run: name: Creating musl-cross-make and musl-cross-make patches digest (musl-cross-make cache digest) command: |