From patchwork Mon Jun 19 22:41:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796841 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=jKqGZ7pQ; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=YkP6vDGq; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPt553ssz20WT for ; Tue, 20 Jun 2023 08:42:53 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id F1B83862FA; Tue, 20 Jun 2023 00:42:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="jKqGZ7pQ"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="YkP6vDGq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D49538613D; Tue, 20 Jun 2023 00:41:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1EDEF860A9 for ; Tue, 20 Jun 2023 00:41:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kHMG+w9dTcR/rYujco5jmC6Uq7ILj5MlueBKVV4UC6Q=; b=jKqGZ7pQ3n9fGO7VkwfQOOQc2OBBTtUnFqU0qJbqVtWCESWjKE8GU4Op2XUmPm1JNu7GrD nSkSUhQciprf5v9dgRWVWIRysAVkyN3/9m99b7xbA55aTFJQmtfU1E/SE11zWo7QQUTvdB 03uP4foRqQ6QFalAAtV9wODI+XQ4yR/0XFNYQmsuky2t+JxonIsJg2g3OY9gsA5jnOxSiT 1XjdeUSM9chvb9tnkIvCkO58Ybf1QgH81Hx8PPZkdw8tyi/3tAL/R/ViS5EUxzOHKW25S7 zBg88iCNzc33+hlMA8jiVp8J4OSE2Kppn3SvOPTWiImdZZ3mCGp4FxXZlvfI7A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214476; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kHMG+w9dTcR/rYujco5jmC6Uq7ILj5MlueBKVV4UC6Q=; b=YkP6vDGqKdzVDlVYBCxyJNjYisJNbZ4J0Kw7L+DnQOD4y7w1rvC71W+YKc0lwXvt2Vjw5I e/6gOwxKI4NaxTDg== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 1/6] Kbuild: Fix cleanup of generated sources in tools Date: Tue, 20 Jun 2023 00:41:02 +0200 Message-Id: <20230619224107.284372-2-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On 'make clean', generated C files in tools/env/ and tools/boot/ are currently not removed, but they should. Auto-generation for shared sources was first introduced with ad80c4a3220b ("kbuild, tools: generate wrapper C sources automatically by Makefile"). Cleanup later regressed (see Fixes:), because shared files were moved out of lib/ and common/, but 'clean-dirs := lib common' was not adjusted accordingly. Further, the generated tools/env/embedded.c became a sibling to project files, which prevents directory-wise cleanup at all. To solve it, we establishe tools/generated/ as the sole place for generated sources. Wrappers are now generated as tools/generated//, and 'make clean' can remove tools/generated/ as a whole (Linux Makefile.asm-generic headers are cleaned similarly). This way we don't have to maintain separate clean-files or clean-dirs entries for each single added or moved wrapper file. Fixes: 0649cd0d4908 ("Move environment files from common/ to env/") Fixes: 19a91f2464a8 ("Create a new boot/ directory") Signed-off-by: Tobias Deiminger --- tools/Makefile | 64 +++++++++++++++++++++++++------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/tools/Makefile b/tools/Makefile index d793cf3bec..d6835b24b0 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -48,20 +48,20 @@ hostprogs-$(CONFIG_VIDEO_LOGO) += bmp_logo HOSTCFLAGS_bmp_logo.o := -pedantic hostprogs-$(BUILD_ENVCRC) += envcrc -envcrc-objs := envcrc.o lib/crc32.o env/embedded.o lib/sha1.o +envcrc-objs := envcrc.o generated/lib/crc32.o generated/env/embedded.o generated/lib/sha1.o hostprogs-$(CONFIG_CMD_NET) += gen_eth_addr HOSTCFLAGS_gen_eth_addr.o := -pedantic hostprogs-$(CONFIG_CMD_NET) += gen_ethaddr_crc -gen_ethaddr_crc-objs := gen_ethaddr_crc.o lib/crc8.o +gen_ethaddr_crc-objs := gen_ethaddr_crc.o generated/lib/crc8.o HOSTCFLAGS_gen_ethaddr_crc.o := -pedantic hostprogs-$(CONFIG_CMD_LOADS) += img2srec HOSTCFLAGS_img2srec.o := -pedantic hostprogs-y += mkenvimage -mkenvimage-objs := mkenvimage.o os_support.o lib/crc32.o +mkenvimage-objs := mkenvimage.o os_support.o generated/lib/crc32.o hostprogs-y += dumpimage mkimage hostprogs-$(CONFIG_TOOLS_LIBCRYPTO) += fit_info fit_check_sign @@ -71,30 +71,30 @@ ifneq ($(CONFIG_CMD_BOOTEFI_SELFTEST)$(CONFIG_FWU_MDATA_GPT_BLK),) hostprogs-y += file2include endif -FIT_OBJS-y := fit_common.o fit_image.o image-host.o boot/image-fit.o -FIT_SIG_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := image-sig-host.o boot/image-fit-sig.o -FIT_CIPHER_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := boot/image-cipher.o +FIT_OBJS-y := fit_common.o fit_image.o image-host.o generated/boot/image-fit.o +FIT_SIG_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := image-sig-host.o generated/boot/image-fit-sig.o +FIT_CIPHER_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := generated/boot/image-cipher.o # The following files are synced with upstream DTC. # Use synced versions from scripts/dtc/libfdt/. LIBFDT_OBJS := $(addprefix libfdt/, fdt.o fdt_ro.o fdt_wip.o fdt_sw.o fdt_rw.o \ fdt_strerror.o fdt_empty_tree.o fdt_addresses.o fdt_overlay.o) -RSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/rsa/, \ +RSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/rsa/, \ rsa-sign.o rsa-verify.o \ rsa-mod-exp.o) -ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/ecdsa/, ecdsa-libcrypto.o) +ECDSA_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/ecdsa/, ecdsa-libcrypto.o) -AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix lib/aes/, \ +AES_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := $(addprefix generated/lib/aes/, \ aes-encrypt.o aes-decrypt.o) # Cryptographic helpers and image types that depend on openssl/libcrypto LIBCRYPTO_OBJS-$(CONFIG_TOOLS_LIBCRYPTO) := \ - lib/fdt-libcrypto.o \ + generated/lib/fdt-libcrypto.o \ sunxi_toc0.o -ROCKCHIP_OBS = lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o +ROCKCHIP_OBS = generated/lib/rc4.o rkcommon.o rkimage.o rksd.o rkspi.o # common objs for dumpimage and mkimage dumpimage-mkimage-objs := aisimage.o \ @@ -102,20 +102,20 @@ dumpimage-mkimage-objs := aisimage.o \ $(FIT_OBJS-y) \ $(FIT_SIG_OBJS-y) \ $(FIT_CIPHER_OBJS-y) \ - boot/fdt_region.o \ - boot/bootm.o \ - lib/crc32.o \ + generated/boot/fdt_region.o \ + generated/boot/bootm.o \ + generated/lib/crc32.o \ default_image.o \ - lib/fdtdec_common.o \ - lib/fdtdec.o \ - boot/image.o \ - boot/image-host.o \ + generated/lib/fdtdec_common.o \ + generated/lib/fdtdec.o \ + generated/boot/image.o \ + generated/boot/image-host.o \ imagetool.o \ imximage.o \ imx8image.o \ imx8mimage.o \ kwbimage.o \ - lib/md5.o \ + generated/lib/md5.o \ lpc32xximage.o \ mxsimage.o \ omapimage.o \ @@ -128,12 +128,12 @@ dumpimage-mkimage-objs := aisimage.o \ $(ROCKCHIP_OBS) \ socfpgaimage.o \ sunxi_egon.o \ - lib/crc16-ccitt.o \ - lib/hash-checksum.o \ - lib/sha1.o \ - lib/sha256.o \ - lib/sha512.o \ - common/hash.o \ + generated/lib/crc16-ccitt.o \ + generated/lib/hash-checksum.o \ + generated/lib/sha1.o \ + generated/lib/sha256.o \ + generated/lib/sha512.o \ + generated/common/hash.o \ ublimage.o \ zynqimage.o \ zynqmpimage.o \ @@ -213,7 +213,7 @@ HOSTCFLAGS_mxsboot.o := -pedantic hostprogs-$(CONFIG_ARCH_SUNXI) += mksunxiboot hostprogs-$(CONFIG_ARCH_SUNXI) += sunxi-spl-image-builder -sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o lib/bch.o +sunxi-spl-image-builder-objs := sunxi-spl-image-builder.o generated/lib/bch.o hostprogs-$(CONFIG_NETCONSOLE) += ncb @@ -221,16 +221,16 @@ hostprogs-$(CONFIG_ARCH_KIRKWOOD) += kwboot hostprogs-$(CONFIG_ARCH_MVEBU) += kwboot hostprogs-y += proftool -proftool-objs = proftool.o lib/abuf.o +proftool-objs = proftool.o generated/lib/abuf.o hostprogs-$(CONFIG_STATIC_RELA) += relocate-rela hostprogs-$(CONFIG_RISCV) += prelink-riscv hostprogs-$(CONFIG_ARCH_OCTEON) += update_octeon_header -update_octeon_header-objs := update_octeon_header.o lib/crc32.o +update_octeon_header-objs := update_octeon_header.o generated/lib/crc32.o hostprogs-y += fdtgrep -fdtgrep-objs += $(LIBFDT_OBJS) boot/fdt_region.o fdtgrep.o +fdtgrep-objs += $(LIBFDT_OBJS) generated/boot/fdt_region.o fdtgrep.o ifneq ($(TOOLS_ONLY),y) hostprogs-y += spl_size_limit @@ -262,12 +262,12 @@ HOSTCFLAGS_sha256.o := -pedantic HOSTCFLAGS_sha512.o := -pedantic -DCONFIG_SHA512 -DCONFIG_SHA384 quiet_cmd_wrap = WRAP $@ -cmd_wrap = echo "\#include <../$(patsubst $(obj)/%,%,$@)>" >$@ +cmd_wrap = echo "\#include <../$(patsubst $(obj)/generated/%,%,$@)>" >$@ -$(obj)/boot/%.c $(obj)/common/%.c $(obj)/env/%.c $(obj)/lib/%.c: +$(obj)/generated/%.c: $(call cmd,wrap) -clean-dirs := lib common +clean-dirs := generated always := $(hostprogs-y) From patchwork Mon Jun 19 22:41:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796842 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=wU586fUX; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=FQrttHT2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPtH2wHKz20WT for ; Tue, 20 Jun 2023 08:43:03 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13AB586309; Tue, 20 Jun 2023 00:42:46 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="wU586fUX"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="FQrttHT2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B120C86024; Tue, 20 Jun 2023 00:41:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0A44C86043 for ; Tue, 20 Jun 2023 00:41:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MertZ/uZy66tkSmt9K9hiYNJQl3S+6EA49Fu89Lb/fI=; b=wU586fUX/tHCmxeYuvDzo1h+mp6EztWeZAcp9Mx+JyPKHLkK+EAyRtg2Y9MOjN0QjpZWJL Xvy5Uh+sHZgHjd3K/9T5bcdboCCtBO3mTBhivg5oy6KNm5TkjBA3FXT5ZEZriT0z+d9g5Q SlKJ6B2KWO7RlaHOxbuT6fV36tiJL7uUOD3GHPHRYGFJ6Nh09GTr8Dc3wfvuS4UJ/+dxSv itQjTvccxl0uzR2FUyOBCCOtuJRR7i8yEhmVYAxxIDDd9KnE9Yuc3F/pTp9IHDVFfXky4y NTlH7u4FMKYapolfKcHd3lKLd6Wk+Ha8vUtnS/1OAIFf3vBob7MqxaWl33jGpA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214480; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MertZ/uZy66tkSmt9K9hiYNJQl3S+6EA49Fu89Lb/fI=; b=FQrttHT2K4sWDl94TuuXyggeCEkUpZhpmQMSUbsJpoavopzrDDQqESCurwZhjV/5VuoSn1 mt5tFjAgAjUuVoBQ== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 2/6] Adjust gitignore for tools/generated/ Date: Tue, 20 Jun 2023 00:41:03 +0200 Message-Id: <20230619224107.284372-3-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Tell git that auto-generated C sources are now exclusively expected under tools/generated/. Signed-off-by: Tobias Deiminger --- tools/.gitignore | 1 + tools/env/.gitignore | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/.gitignore b/tools/.gitignore index cda3ea628c..941d38de21 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -34,6 +34,7 @@ /relocate-rela /spl_size_limit /sunxi-spl-image-builder +/tools/generated/**/*.c /update_octeon_header /version.h /xway-swap-bytes diff --git a/tools/env/.gitignore b/tools/env/.gitignore index 8d28b2b70b..804abacc6e 100644 --- a/tools/env/.gitignore +++ b/tools/env/.gitignore @@ -1,3 +1,2 @@ -embedded.c fw_printenv fw_printenv_unstripped From patchwork Mon Jun 19 22:41:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796843 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=PeVmHhTe; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=CdM5TWHK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPtT4kWGz20WT for ; Tue, 20 Jun 2023 08:43:13 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA92F86337; Tue, 20 Jun 2023 00:42:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="PeVmHhTe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="CdM5TWHK"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C616E861A1; Tue, 20 Jun 2023 00:41:28 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 337C286043 for ; Tue, 20 Jun 2023 00:41:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sJhL1JXJSLkS6C1Jet8JHBa1fK8xmvDswgCHkE/GxMY=; b=PeVmHhTegSNB9ZN6YPUoQuxQM4/MyNTat3gKp6zeNdDwdCC34jIgwKGA9E9tBB3GIVmMtN rZrorA+tgAuU6UUPeUEQXEsGClw0M4g1yeQOlGUXRG2MEoqLBlb+JQu1L2rexHOjLGVyiS Az9lay78lkCanihUDriKcqQ+74zpPvpNSc+XteCwdQwUT3KfckJQnudtOiPIfzWQbSf/Hf 2tnTfDjHrED04+/yesP/8kXExBc/Bxg5ZYVPaCBSkbzCX/YRvYifuOdb1KBzlyyN/BFX4S 9wVMCnLeCAEHE2VKF3jIlqdGVP+4t9dwwasom196HqkN1t/MncGjBhGPcVvvSg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214484; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sJhL1JXJSLkS6C1Jet8JHBa1fK8xmvDswgCHkE/GxMY=; b=CdM5TWHKGf1Sz7BJig0ScWyA72/VgHfeVydsTLVQg+uYGGZQb3hTjJqxx+pqSR44vlvcmp 9L+3MXhIxRAsPyDA== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 3/6] Kbuild: Fix cleanup of VPL Date: Tue, 20 Jun 2023 00:41:04 +0200 Message-Id: <20230619224107.284372-4-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean VPL artifacts like example vpl/u-boot-vpl are currently not removed by 'make clean'. We can clean them just as it's already done for SPL and TPL. Fixes: f86ca5ad8f78 ("Introduce Verifying Program Loader (VPL)") Signed-off-by: Tobias Deiminger --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 444baaefd0..febe9c31d9 100644 --- a/Makefile +++ b/Makefile @@ -2148,7 +2148,7 @@ CHANGELOG: # Directories & files removed with 'make clean' CLEAN_DIRS += $(MODVERDIR) \ - $(foreach d, spl tpl, $(patsubst %,$d/%, \ + $(foreach d, spl tpl vpl, $(patsubst %,$d/%, \ $(filter-out include, $(shell ls -1 $d 2>/dev/null)))) CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ @@ -2163,7 +2163,7 @@ CLEAN_FILES += include/bmp_logo.h include/bmp_logo_data.h \ idbloader-spi.img lib/efi_loader/helloworld_efi.S # Directories & files removed with 'make mrproper' -MRPROPER_DIRS += include/config include/generated spl tpl \ +MRPROPER_DIRS += include/config include/generated spl tpl vpl \ .tmp_objdiff doc/output include/asm # Remove include/asm symlink created by U-Boot before v2014.01 From patchwork Mon Jun 19 22:41:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796844 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=g/GWS7ld; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=1nyghWov; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPtg51Wnz20WT for ; Tue, 20 Jun 2023 08:43:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D237486342; Tue, 20 Jun 2023 00:42:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="g/GWS7ld"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1nyghWov"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B1A9D862AA; Tue, 20 Jun 2023 00:41:31 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3BF1A86024 for ; Tue, 20 Jun 2023 00:41:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oOiBzSRWv6PxGSSKejhFgJQo+0kA32dIoRIB30XXbuE=; b=g/GWS7ldB2wkfVDMXmSA7sGmu+pk18+ZVc3ubANbUuK0zlShrt5HitX4AAHr32rcYwBa+D tuu8gGdWxTMeEiASxl+C5apG7vtdWzrs18HyEvBNJiKoRujVy58jy1P+NX1aVTddRk+B5U u60nTj2z4TcO1BC3h4iYpjWCi4/ajNFLKHX4yKOD/X+CSalxd4AAjAb8orUu1z7prgHUvB wxhIJpQD4qs66G2CSnSsSt7rxnYUmfam05dKrtqQ4eKaCSgQHRpceiFTRPAotLUKxz+48g 2JqRTtRRMYRWMf2LxQtoWHgkDwVK2RQJuJTu+NWL7DzDfRXnydNnvboR1YyKHg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214488; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oOiBzSRWv6PxGSSKejhFgJQo+0kA32dIoRIB30XXbuE=; b=1nyghWovv10ZxPDlBLLcqt+TBi8QatCj9QTcNABEFKLf0d4QRJZdr1JdI9V+XUaFmIjyWw ru0W7NZLcL4bU+DA== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 4/6] Kbuild: Fix cleanup of *.dtb for some archs Date: Tue, 20 Jun 2023 00:41:05 +0200 Message-Id: <20230619224107.284372-5-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 'make clean' did not descend into arch/$ARCH/dts for arc, m68k, nios2, sh, xtensa. Fix it by adding the missing archs to the explicit clean-dirs list. Signed-off-by: Tobias Deiminger --- dts/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dts/Makefile b/dts/Makefile index cb31113829..3437e54033 100644 --- a/dts/Makefile +++ b/dts/Makefile @@ -63,4 +63,6 @@ spl_dtbs: $(obj)/dt-$(SPL_NAME).dtb clean-files := dt.dtb.S # Let clean descend into dts directories -subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/mips/dts ../arch/sandbox/dts ../arch/x86/dts ../arch/powerpc/dts ../arch/riscv/dts +subdir- += ../arch/arc/dts ../arch/arm/dts ../arch/m68k/dts ../arch/microblaze/dts \ + ../arch/mips/dts ../arch/nios2/dts ../arch/powerpc/dts ../arch/riscv/dts \ + ../arch/sandbox/dts ../arch/sh/dts ../arch/x86/dts ../arch/xtensa/dts From patchwork Mon Jun 19 22:41:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796845 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=Fg+a0qEs; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=rP9BOqpO; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPts6HnLz20WT for ; Tue, 20 Jun 2023 08:43:33 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 84E8C86354; Tue, 20 Jun 2023 00:42:53 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="Fg+a0qEs"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="rP9BOqpO"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81EB9861A1; Tue, 20 Jun 2023 00:41:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6939B861A1 for ; Tue, 20 Jun 2023 00:41:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W7ia0mluovkTXiVel4HsQgDS9Ej8drgaKwIOAGTQbIM=; b=Fg+a0qEsGh6HXcrXT3fhiwk9RalWwuv/1Tkbm41YRQ5UkUQkbDIkVWTqY0Hv56GEX5ZBG6 A8I7MpR6TFHCD4jNh7qkh7nM90q5gLDtf+2mP23k837eJdF1YIfMCNsgB8L2kyKuGuxKwi xoL+nu1jqT/xUDw8Bs1rgRUJYfyxUHO7Q1JRJmAz6Jf1aqe4vkmYSHr7JSLMwftx7OKRSV SPgVXdqsrOrMxjcyGtk6MnzaXtyJqfdZrkuYxWWmKsXDi/c4C+bm5j/0AuEp7WilQEwJ1U zb6XQNKFXFZtnXF71imzxQnB+94QtSg9c8+dtErWFXxI7Q3xZSrUnLw1JQ9JlQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214492; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=W7ia0mluovkTXiVel4HsQgDS9Ej8drgaKwIOAGTQbIM=; b=rP9BOqpO/KyXIlut9bCucG9eVIR4nfLoUA8F4podGyutwzFOd7hUmX0LHzi4WnNd59TpRH 7OhWncc/wObndoAQ== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 5/6] Kbuild: Fix cleanup of *.dtbo for sandbox Date: Tue, 20 Jun 2023 00:41:06 +0200 Message-Id: <20230619224107.284372-6-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean sandbox can generate DT overlays, but they were not cleaned. Extend the explicit clean-files list accordingly. Fixes: 95300f203f32 ("pytest: add sandbox test for "extension" command") Signed-off-by: Tobias Deiminger --- arch/sandbox/dts/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/sandbox/dts/Makefile b/arch/sandbox/dts/Makefile index b6a88479b2..f810b4752f 100644 --- a/arch/sandbox/dts/Makefile +++ b/arch/sandbox/dts/Makefile @@ -18,4 +18,4 @@ PHONY += dtbs dtbs: $(addprefix $(obj)/, $(dtb-y)) @: -clean-files := *.dtb +clean-files := *.dtb *.dtbo From patchwork Mon Jun 19 22:41:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Deiminger X-Patchwork-Id: 1796846 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.a=rsa-sha256 header.s=2020 header.b=UNxqkV+x; dkim=pass header.d=linutronix.de header.i=@linutronix.de header.a=ed25519-sha256 header.s=2020e header.b=6tCwCMLj; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4QlPv41VYdz20WT for ; Tue, 20 Jun 2023 08:43:44 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 584CB86366; Tue, 20 Jun 2023 00:42:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; secure) header.d=linutronix.de header.i=@linutronix.de header.b="UNxqkV+x"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6tCwCMLj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 33AAE86264; Tue, 20 Jun 2023 00:41:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7D54A862E9 for ; Tue, 20 Jun 2023 00:41:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=tdmg@linutronix.de From: Tobias Deiminger DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1687214496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zRVh4qe9ST8Nl4eJOpjwtP23GYFNFbjevFSyOCiQu6s=; b=UNxqkV+xbgkXtdRBE2s4HHFCl9lIsi3oNVApIi7iycMzpepcsFQIDofJR2iQO/zbH+r1lI SCOmrZZbsCnZzrPGaD/j1SurOZvJA2+uOfzu6G4qYJJekvGXust0M3+IE5U0pNAGljHdfh GHdwethXAZDAGnyV7OMU7umG1TXkZExHOENZkwLrJsk0PNbzqrFysb7uI+oG6vpv53z6Dr dULvSD9eg0P/V+n44XkxkM44Jwblz13vgMgjpfqcI4K7F73J4cjP/Dv8YbbgWapHTn0fE1 JARGsN44uxQcXC+bayDnmnfnumeHJt00AkDCbTqmGJGFz5OZvcc6lUvIUdAXww== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1687214496; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zRVh4qe9ST8Nl4eJOpjwtP23GYFNFbjevFSyOCiQu6s=; b=6tCwCMLjoriCdJjLctly6yyFNfEQFU/cv+8vam1Fu2CKAQTsrJlJU6PT+BGI/yTiGXddhR yGSqw3Z3bqKJmVCA== To: u-boot@lists.denx.de Cc: Simon Glass , tdmg@linutronix.de (Tobias Deiminger) Subject: [PATCH v2 6/6] test: Find leftovers after clean/mrproper Date: Tue, 20 Jun 2023 00:41:07 +0200 Message-Id: <20230619224107.284372-7-tdmg@linutronix.de> In-Reply-To: <20230619224107.284372-1-tdmg@linutronix.de> References: <20230619224107.284372-1-tdmg@linutronix.de> MIME-Version: 1.0 X-Mailman-Approved-At: Tue, 20 Jun 2023 00:42:39 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Docs describe 'make clean' to delete most generated files, 'make mrproper' to delete current configuration and all generated files. This test tries to assert it. Idea is to search remaining files by patterns in copies of the initial out-of-source build, which has two advantages: - looking in an out-of-source build dir allows to tell generated source code from committed source code - copying is fast (compared to rebuilding each time) which allows to do a "world clean" Signed-off-by: Tobias Deiminger --- test/py/tests/test_cleanup_build.py | 105 ++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 test/py/tests/test_cleanup_build.py diff --git a/test/py/tests/test_cleanup_build.py b/test/py/tests/test_cleanup_build.py new file mode 100644 index 0000000000..5206ff73ec --- /dev/null +++ b/test/py/tests/test_cleanup_build.py @@ -0,0 +1,105 @@ +# SPDX-License-Identifier: GPL-2.0 +# Copyright (c) 2023 Tobias Deiminger + +"""Test for unexpected leftovers after make clean""" + +import itertools +import os +import pathlib +import shutil +import sys + +import pytest + +# pylint: disable=redefined-outer-name + + +@pytest.fixture +def tmp_copy_of_builddir(u_boot_config, tmp_path): + """For each test, provide a temporary copy of the initial build directory.""" + shutil.copytree( + u_boot_config.build_dir, + tmp_path, + symlinks=True, + dirs_exist_ok=True, + ) + return tmp_path + + +@pytest.fixture(scope="module") +def run_make(u_boot_log): + """Provide function to run and log make without connecting to u-boot console.""" + runner = u_boot_log.get_runner("make", sys.stdout) + + def _run_make(build_dir, target): + cmd = ["make", f"O={build_dir}", target] + runner.run(cmd) + + yield _run_make + runner.close() + + +@pytest.fixture(scope="module") +def most_generated_files(): + """Path.glob style patterns to describe what should be removed by 'make clean'.""" + return ( + "**/*.c", + "**/*.dtb", + "**/*.dtbo", + "**/*.o", + "**/*.py", + "**/*.pyc", + "**/*.so", + "**/*.srec", + "u-boot*", + "[svt]pl/u-boot*", + ) + + +@pytest.fixture(scope="module") +def all_generated_files(most_generated_files): + """Path.glob style patterns to describe what should be removed by 'make mrproper'.""" + return most_generated_files + (".config", "**/*.h") + + +def find_files(search_dir, include_patterns, exclude_dirs=None): + """Find files matching include_patterns, unless it's in one of exclude_dirs. + + include_patterns -- Path.glob style pattern relative to search dir + exclude_dir -- directories to exclude, expected relative to search dir + """ + matches = [] + exclude_dirs = [] if exclude_dirs is None else exclude_dirs + for abs_path in itertools.chain.from_iterable( + pathlib.Path(search_dir).glob(pattern) for pattern in include_patterns + ): + if abs_path.is_dir(): + continue + rel_path = pathlib.Path(os.path.relpath(abs_path, search_dir)) + if not any( + rel_path.is_relative_to(exclude_dir) for exclude_dir in exclude_dirs + ): + matches.append(rel_path) + return matches + + +def test_clean(run_make, tmp_copy_of_builddir, most_generated_files): + """Test if 'make clean' deletes most generated files.""" + run_make(tmp_copy_of_builddir, "clean") + leftovers = find_files( + tmp_copy_of_builddir, + most_generated_files, + exclude_dirs=["scripts", "test/overlay"], + ) + assert not leftovers, f"leftovers: {', '.join(map(str, leftovers))}" + + +def test_mrproper(run_make, tmp_copy_of_builddir, all_generated_files): + """Test if 'make mrproper' deletes current configuration and all generated files.""" + run_make(tmp_copy_of_builddir, "mrproper") + leftovers = find_files( + tmp_copy_of_builddir, + all_generated_files, + exclude_dirs=["test/overlay"], + ) + assert not leftovers, f"leftovers: {', '.join(map(str, leftovers))}"