From f5c2f253a7dc8eced1c616ff9c79c6d196c86350 Mon Sep 17 00:00:00 2001 From: Patrik Tesarik Date: Sat, 11 Jun 2022 21:47:21 +0200 Subject: [PATCH] external/LinuxBoot: Fix cleanup mechanism `make clean` never thoroughly removed LinuxBoot build artifacts. This change checks for kernel directories present in the project directory and deletes all of them, if found. Signed-off-by: Patrik Tesarik Change-Id: Ia056ac6608e3631dfc270ba5c2f32216c3e1ac50 Reviewed-on: https://review.coreboot.org/c/coreboot/+/65098 Reviewed-by: Arthur Heymans Tested-by: build bot (Jenkins) --- payloads/external/LinuxBoot/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/payloads/external/LinuxBoot/Makefile b/payloads/external/LinuxBoot/Makefile index c91b1d43da..afe9c9e22c 100644 --- a/payloads/external/LinuxBoot/Makefile +++ b/payloads/external/LinuxBoot/Makefile @@ -1,7 +1,7 @@ ## SPDX-License-Identifier: GPL-2.0-only project_dir=linuxboot -kernel_dir=$(project_dir)/kernel +kernel_names=$(shell ls $(project_dir) | grep kernel) unexport $(COREBOOT_EXPORTS) @@ -52,9 +52,12 @@ endif linuxboot: kernel initramfs_compressed clean: - if [ -d "$(kernel_dir)" ]; then rm -rf $(kernel_dir); fi + if [ ! -z "$(kernel_names)" ]; then \ + rm -rf $(project_dir)/kernel*; \ + fi rm -f $(project_dir)/u-root rm -f $(project_dir)/initramfs* + rm -f $(project_dir)/bzImage distclean: rm -rf $(project_dir)