@@ -400,52 +400,52 @@ define define_module =
400
400
# module-specific cleanup action to get rid of it.
401
401
$(build ) /$($1_base_dir ) /.canary: FORCE
402
402
if [ ! -e "$$@ " ]; then \
403
- echo "INFO: .canary file not found. Cloning repository $($1_repo ) into $(build ) /$($1_base_dir ) "; \
404
- git clone $($1_repo ) "$(build ) /$($1_base_dir ) "; \
405
- echo "INFO: Resetting repository to commit $($1_commit_hash ) "; \
406
- git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) ; \
407
- echo "INFO: Creating .canary file with repo and commit hash"; \
408
- echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ "; \
403
+ echo "INFO: .canary file not found. Cloning repository $($1_repo ) into $(build ) /$($1_base_dir ) " && \
404
+ git clone $($1_repo ) "$(build ) /$($1_base_dir ) " && \
405
+ echo "INFO: Resetting repository to commit $($1_commit_hash ) " && \
406
+ git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) && \
407
+ echo "INFO: Creating .canary file with repo and commit hash" && \
408
+ echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ " ; \
409
409
elif [ "$$$$(cat "$$@ " ) " != '$($1_repo ) |$($1_commit_hash ) ' ]; then \
410
- echo "INFO: Canary file differs. Switching $1 to $($1_repo ) at $($1_commit_hash ) "; \
410
+ echo "INFO: Canary file differs. Switching $1 to $($1_repo ) at $($1_commit_hash ) " && \
411
411
git -C "$(build ) /$($1_base_dir ) " reset --hard HEAD^ && \
412
- echo "INFO: Fetching commit $($1_commit_hash ) from $($1_repo ) (without recursing submodules)"; \
412
+ echo "INFO: Fetching commit $($1_commit_hash ) from $($1_repo ) (without recursing submodules)" && \
413
413
git -C "$(build ) /$($1_base_dir ) " fetch $($1_repo ) $($1_commit_hash ) --recurse-submodules=no && \
414
- echo "INFO: Resetting repository to commit $($1_commit_hash ) "; \
415
- git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) ; \
416
- echo "INFO: Cleaning repository directory (including payloads and util/cbmem)"; \
414
+ echo "INFO: Resetting repository to commit $($1_commit_hash ) " && \
415
+ git -C "$(build ) /$($1_base_dir ) " reset --hard $($1_commit_hash ) && \
416
+ echo "INFO: Cleaning repository directory (including payloads and util/cbmem)" && \
417
417
git -C "$(build ) /$($1_base_dir ) " clean -df && \
418
418
git -C "$(build ) /$($1_base_dir ) " clean -dffx payloads util/cbmem && \
419
- echo "INFO: Synchronizing submodules"; \
419
+ echo "INFO: Synchronizing submodules" && \
420
420
git -C "$(build ) /$($1_base_dir ) " submodule sync && \
421
- echo "INFO: Updating submodules (init and checkout)"; \
421
+ echo "INFO: Updating submodules (init and checkout)" && \
422
422
git -C "$(build ) /$($1_base_dir ) " submodule update --init --checkout && \
423
- echo "INFO: Updating .canary file with new repo info"; \
424
- echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ "; \
423
+ echo "INFO: Updating .canary file with new repo info" && \
424
+ echo -n '$($1_repo ) |$($1_commit_hash ) ' > "$$@ " ; \
425
425
fi
426
426
if [ ! -e "$(build ) /$($1_base_dir ) /.patched" ]; then \
427
- echo "INFO: .patched file not found. Beginning patch application for $1"; \
427
+ echo "INFO: .patched file not found. Beginning patch application for $1" && \
428
428
if [ -r patches/$($1_patch_name ) .patch ]; then \
429
- echo "INFO: Found patch file patches/$($1_patch_name ) .patch. Applying patch..."; \
429
+ echo "INFO: Found patch file patches/$($1_patch_name ) .patch. Applying patch..." && \
430
430
if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ); then \
431
- echo "ERROR: Failed to apply patch patches/$($1_patch_name ) .patch. Reversing and reapplying."; \
432
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true; \
433
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1; \
434
- fi; \
431
+ echo "ERROR: Failed to apply patch patches/$($1_patch_name ) .patch. Reversing and reapplying." && \
432
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true && \
433
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1 ; \
434
+ fi ; \
435
435
fi && \
436
436
if [ -d patches/$($1_patch_name ) ] && \
437
437
[ -r patches/$($1_patch_name ) ] || [ -n "$$(ls patches/$($1_patch_name ) /*.patch 2>/dev/null ) " ]; then \
438
438
for patch in patches/$($1_patch_name ) /*.patch ; do \
439
- echo "Applying patch file : $$$$patch " ; \
439
+ echo "Applying patch file : $$$$patch " && \
440
440
if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ); then \
441
- echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \
442
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true; \
443
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1; \
444
- fi; \
441
+ echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \
442
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true && \
443
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1 ; \
444
+ fi ; \
445
445
done ; \
446
446
fi && \
447
- echo "INFO: Patches applied successfully. Creating .patched file"; \
448
- touch "$(build ) /$($1_base_dir ) /.patched"; \
447
+ echo "INFO: Patches applied successfully. Creating .patched file" && \
448
+ touch "$(build ) /$($1_base_dir ) /.patched" ; \
449
449
fi
450
450
else
451
451
# Versioned modules (each version a separate module) don't need to include
@@ -469,40 +469,40 @@ define define_module =
469
469
mkdir -p "$$(dir $$@ ) "
470
470
tar -xf "$(packages ) /$($1_tar ) " $(or $($1_tar_opt ) ,--strip 1) -C "$$(dir $$@ ) "
471
471
if [ -r patches/$($1_patch_name ) .patch ]; then \
472
- echo "INFO: Applying single patch file patches/$($1_patch_name ) .patch"; \
472
+ echo "INFO: Applying single patch file patches/$($1_patch_name ) .patch" && \
473
473
if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ); then \
474
- echo "ERROR: Failed to apply patch patches/$($1_patch_name ) .patch. Reversing and reapplying."; \
475
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true; \
476
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1; \
477
- fi; \
478
- fi
474
+ echo "ERROR: Failed to apply patch patches/$($1_patch_name ) .patch. Reversing and reapplying." && \
475
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true && \
476
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1 ; \
477
+ fi ; \
478
+ fi ; \
479
479
if [ -d patches/$($1_patch_name ) ]; then \
480
480
for patch in patches/$($1_patch_name ) /*.patch; do \
481
- echo "INFO: Applying patch file: $$$$patch"; \
481
+ echo "INFO: Applying patch file: $$$$patch" && \
482
482
if ! ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ); then \
483
- echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying."; \
484
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true; \
485
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1; \
486
- fi; \
487
- done; \
483
+ echo "ERROR: Failed to apply patch $$$$patch. Reversing and reapplying." && \
484
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true && \
485
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1 ; \
486
+ fi ; \
487
+ done ; \
488
488
fi
489
489
if [ ! -e "$$@ " ] && [ -e "$(build ) /$($1_base_dir ) /.patched" ]; then \
490
- echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1"; \
490
+ echo "INFO: .canary file not found but .patched exists. Reversing and reapplying patches for $1" && \
491
491
if [ -r patches/$($1_patch_name ) .patch ]; then \
492
- echo "INFO: Reversing single patch file patches/$($1_patch_name ) .patch."; \
493
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true; \
494
- echo "INFO: Reapplying single patch file patches/$($1_patch_name ) .patch."; \
495
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1; \
496
- fi; \
492
+ echo "INFO: Reversing single patch file patches/$($1_patch_name ) .patch." && \
493
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || true && \
494
+ echo "INFO: Reapplying single patch file patches/$($1_patch_name ) .patch." && \
495
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < patches/$($1_patch_name ) .patch ) || exit 1 ; \
496
+ fi ; \
497
497
if [ -d patches/$($1_patch_name ) ]; then \
498
498
for patch in patches/$($1_patch_name ) /*.patch; do \
499
- echo "INFO: Reversing patch file: $$$$patch"; \
500
- ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true; \
501
- echo "INFO: Reapplying patch file: $$$$patch"; \
502
- ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1; \
503
- done; \
504
- fi; \
505
- rm -f "$(build ) /$($1_base_dir ) /.patched"; \
499
+ echo "INFO: Reversing patch file: $$$$patch" && \
500
+ ( git apply --reverse --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || true && \
501
+ echo "INFO: Reapplying patch file: $$$$patch" && \
502
+ ( git apply --verbose --reject --binary --directory build/$(CONFIG_TARGET_ARCH ) /$($1_base_dir ) < $$$$patch ) || exit 1 ; \
503
+ done ; \
504
+ fi ; \
505
+ rm -f "$(build ) /$($1_base_dir ) /.patched" ; \
506
506
fi
507
507
touch "$$@ "
508
508
endif
@@ -929,22 +929,22 @@ define overwrite_canary_if_coreboot_git
929
929
@echo "Checking for coreboot directory: build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) "
930
930
if [ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) " ] && \
931
931
[ -d "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) /.git" ]; then \
932
- echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) ' with placeholder."; \
933
- echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) /.canary"; \
934
- echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts."; \
935
- echo "INFO: Reversing patches dynamically in reverse order."; \
932
+ echo "INFO: Recreating .canary file for 'build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) ' with placeholder." && \
933
+ echo BOGUS_COMMIT_ID > "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) /.canary" && \
934
+ echo "NOTE: If a patch fails to apply, some files might need to be deleted manually to resolve conflicts." && \
935
+ echo "INFO: Reversing patches dynamically in reverse order." && \
936
936
for patch in $$(ls patches/coreboot-$(CONFIG_COREBOOT_VERSION ) /*.patch 2>/dev/null | sort -r ) ; do \
937
- echo "INFO: Reversing patch file: $$patch"; \
938
- ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) < $$patch ) || true; \
939
- done; \
937
+ echo "INFO: Reversing patch file: $$patch" && \
938
+ ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) < $$patch ) || true ; \
939
+ done && \
940
940
if [ -r patches/coreboot-$(CONFIG_COREBOOT_VERSION ) .patch ]; then \
941
- echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION ) .patch."; \
942
- ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) < patches/coreboot-$(CONFIG_COREBOOT_VERSION ) .patch ) || true; \
943
- fi; \
944
- echo "INFO: Removing .patched file to allow reapplication of patches."; \
945
- rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) /.patched"; \
941
+ echo "INFO: Reversing main patch file patches/coreboot-$(CONFIG_COREBOOT_VERSION ) .patch." && \
942
+ ( git apply --reverse --verbose --reject --binary --directory build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) < patches/coreboot-$(CONFIG_COREBOOT_VERSION ) .patch ) || true ; \
943
+ fi && \
944
+ echo "INFO: Removing .patched file to allow reapplication of patches." && \
945
+ rm -f "build/${CONFIG_TARGET_ARCH}/coreboot-$(CONFIG_COREBOOT_VERSION ) /.patched" ; \
946
946
else \
947
- echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite."; \
947
+ echo "INFO: Coreboot directory or .git not found, skipping .canary overwrite." ; \
948
948
fi
949
949
endef
950
950
@@ -955,8 +955,8 @@ real.clean:
955
955
$(kernel_headers ) \
956
956
; do \
957
957
if [ ! -z " $$ dir" ]; then \
958
- rm -rf " build/${CONFIG_TARGET_ARCH} /$$ dir" ; \
959
- fi ; \
958
+ rm -rf " build/${CONFIG_TARGET_ARCH} /$$ dir" ; \
959
+ fi ; \
960
960
done
961
961
cd install && rm -rf -- *
962
962
$(call overwrite_canary_if_coreboot_git)
0 commit comments