Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6023688ybn; Sun, 29 Sep 2019 10:40:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqgnRndEKFZo2WbDbrOwPw3ZTmeT7GG5dMP6P94EgH70m2FrQ36UUub2iK/Bk/+BcV8+T7 X-Received: by 2002:a17:906:7e06:: with SMTP id e6mr16217397ejr.149.1569778810711; Sun, 29 Sep 2019 10:40:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569778810; cv=none; d=google.com; s=arc-20160816; b=zaSkblilFee2QjixRH8BmOjF0RNdGq8dn6DG3uqcTYyOwiRWC/D+g2W2y6Dg/0Lnmh 2xwFvxBwwzdRQoyqusyE/MT4fOsY9zS6sEi14yOYVPGWYzvh0Gv8HzFFLa2987T4JOo/ pJNeT/iTjXXCoWMpXrC1yUEgb3Z18jvhaS3sM0DnerdSwAf/Fr6jDh9X2DXLBuSIkMrm IVDtbK7Fw4fCFgFfyNd9kNfuXbE0Sb8zLQz8BfoTJclB70WvcPN0yr7typvo/RTv+IVN e4u1bGTVuLxXeYUxsUqfO5/RKpt6nRKUMTH95q3e+KPUNIYfev1Zy/n668I2sbovKtDq lCQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2FT6BNODAo2ljnMOmPaXUYJt57rSJf6ba6MmAkYbLP4=; b=Bux5yfh0Su5bGh7YE1zhba9pJzvRr4KTDIFHZrL1iB/iCIrb1+HJWyOu2wOubmagg5 DyaZ1r+jdVqfkmRYsCr0GHYgd0d3phGGs+20giWZT+G84FvyKXQU6Icc3COCT/6Sk0Qc AfGor1mTUwUpkMvyEyOY3LC2KCgdl8QfLgGnicpfjcfhKfxvJ4tt9q155VdPCEsUCE6Y eT4C4gPVU38XYjkF96SccLEVDBQFshfbYSXCNdYaRsFe0s5OCS4P6cR6IMIvXykaru5a 9123aUFJ2Y7DhealIcMleTfP6askIFj1AFPhuhVE+2dlFSFDg93sgRdxm8gEmygGGkxF 4htQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ALaVno1A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d32si5603370eda.266.2019.09.29.10.39.46; Sun, 29 Sep 2019 10:40:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ALaVno1A; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730364AbfI2Rj3 (ORCPT + 99 others); Sun, 29 Sep 2019 13:39:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:47376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730530AbfI2RfN (ORCPT ); Sun, 29 Sep 2019 13:35:13 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 55C0B21928; Sun, 29 Sep 2019 17:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569778513; bh=IyDHnK8MqzATXg9wnBUtcvenpx8QuaAiwj+xpIBD9tA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ALaVno1AKgrYxtIkrshICQCDdyYFW/GHeYSAuDqhT1I+nRnYIJ+ZmMhV5R5ydmIn9 vE8hw8i/C+T1Ns+BJpCZ5tpfsZmFf5fDK6mA8u93hWs16hypG4AzaDblpJHYltdvcx swmFDRwg/F8wUWkv4bSV+JTaTri/VV6EQIZ9GIyA= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Thelen , Nicholas Piggin , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH AUTOSEL 4.19 27/33] kbuild: clean compressed initramfs image Date: Sun, 29 Sep 2019 13:34:15 -0400 Message-Id: <20190929173424.9361-27-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190929173424.9361-1-sashal@kernel.org> References: <20190929173424.9361-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Thelen [ Upstream commit 6279eb3dd7946c69346a3b98473ed13d3a44adb5 ] Since 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig") "make clean" leaves behind compressed initramfs images. Example: $ make defconfig $ sed -i 's|CONFIG_INITRAMFS_SOURCE=""|CONFIG_INITRAMFS_SOURCE="/tmp/ir.cpio"|' .config $ make olddefconfig $ make -s $ make -s clean $ git clean -ndxf | grep initramfs Would remove usr/initramfs_data.cpio.gz clean rules do not have CONFIG_* context so they do not know which compression format was used. Thus they don't know which files to delete. Tell clean to delete all possible compression formats. Once patched usr/initramfs_data.cpio.gz and friends are deleted by "make clean". Link: http://lkml.kernel.org/r/20190722063251.55541-1-gthelen@google.com Fixes: 9e3596b0c653 ("kbuild: initramfs cleanup, set target from Kconfig") Signed-off-by: Greg Thelen Cc: Nicholas Piggin Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- usr/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/usr/Makefile b/usr/Makefile index 748f6a60bb1e0..138c18cefb529 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -11,6 +11,9 @@ datafile_y = initramfs_data.cpio$(suffix_y) datafile_d_y = .$(datafile_y).d AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/$(datafile_y)" +# clean rules do not have CONFIG_INITRAMFS_COMPRESSION. So clean up after all +# possible compression formats. +clean-files += initramfs_data.cpio* # Generate builtin.o based on initramfs_data.o obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o -- 2.20.1