From patchwork Fri Dec 23 03:15:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9487169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5F753601D2 for ; Fri, 23 Dec 2016 03:15:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50E4A27D0C for ; Fri, 23 Dec 2016 03:15:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45A8227F0B; Fri, 23 Dec 2016 03:15:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 360DF27E3E for ; Fri, 23 Dec 2016 03:15:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941148AbcLWDPY (ORCPT ); Thu, 22 Dec 2016 22:15:24 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36463 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941136AbcLWDPX (ORCPT ); Thu, 22 Dec 2016 22:15:23 -0500 Received: by mail-pf0-f196.google.com with SMTP id c4so13192298pfb.3 for ; Thu, 22 Dec 2016 19:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=bOGDlEavHiuViptd2Bsqcp9DIfuQ2ib66Rl1dujUcvk=; b=lJhyYhiQoGAegGhJEizVdiIQPQF0agCs+87zsY7VxV2vACi7vj81kZkaU54sUtAdA6 h+4W7qBrkBDRYARB0ewNIvvxeqSOuWufJ4H36freH7eka66K9Bu49M8F/iqBfrRHy71J x0mIKt1dB9kLnERX+uynTmMCGXd/mNgxOXUOUway5CTwda5aKy8+ZAyjmS2ge4NgpYqx kIncFr5Kj71JBD9YL8Hkqc23Db3bGlRiYGa7lGhDY3vF3YsmYMrY3go5kFnmtVw1n/KS Y+cSc/AjT2RsSK1ub9pBVURvSJ5Xs1eqtnVSrBX20t/9baRaRP5HsUennNFBfKujZ2EO TN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=bOGDlEavHiuViptd2Bsqcp9DIfuQ2ib66Rl1dujUcvk=; b=JKrq5gjT3A9cT6+c/J5C0V3r3RO5/9VuqkmeMwtjJ7KEcUeHoVXTM3eM6oaRhlIQcD NS7nUcfCbaUXe4lyX3K8U6Rmqi8abJbMmGuebASSLofrFU6TUhLPAn5UD6wTl6PSRvjM hH/lk1gdWQipVRyyd3WL05IooeCdmN8hU+ugNLP7oiSMBk/PeZk0+pCrohW7E8iFcfUJ 6iigyRqHrmGTErbqJlaruizjh3OIjcIszuqwUcdNMJC5GCPv0ybRIvgr5Bh8KJYhYE1N IWLuE4RNxacXkSfrAllsqKvItmdU0jZPzVDxK+4kR9mMMqgXcgfNwd2jZFu3ZRIbModQ ybww== X-Gm-Message-State: AIkVDXLKi/kvMRIop7xwIkjKQiTB/7RsjwlX19v4npPPNplNkyyR1lX8NKPXEtaFBPeTTg== X-Received: by 10.98.212.23 with SMTP id a23mr8333502pfh.94.1482462922648; Thu, 22 Dec 2016 19:15:22 -0800 (PST) Received: from roar.au.ibm.com ([61.68.124.232]) by smtp.gmail.com with ESMTPSA id t3sm15260989pfb.60.2016.12.22.19.15.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Dec 2016 19:15:22 -0800 (PST) From: Nicholas Piggin To: Michal Marek Cc: Nicholas Piggin , linux-kbuild@vger.kernel.org, Francisco Blas Izquierdo Riera , Andrew Morton Subject: [PATCH] kbuild: Fix dependency checking for initramfs build Date: Fri, 23 Dec 2016 13:15:08 +1000 Message-Id: <20161223031508.30532-1-npiggin@gmail.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When using initramfs compression, the data file gets quotes pulled in from Kconfig, e.g., initramfs_data.cpio".gz" which make does not match a target and causes rebuild. Fix this by filtering out quotes from the Kconfig string. While we're here, set the target explicitly so the Makefile does not have to know about all the suffixes. Signed-off-by: Nicholas Piggin --- usr/Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr/Makefile b/usr/Makefile index 17a513268325..3116b23d44f8 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -5,8 +5,10 @@ klibcdirs:; PHONY += klibcdirs -suffix_y = $(CONFIG_INITRAMFS_COMPRESSION) -AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE="usr/initramfs_data.cpio$(suffix_y)" +suffix_y = $(subst $\",,$(CONFIG_INITRAMFS_COMPRESSION)) +datafile_y = initramfs_data.cpio$(suffix_y) +AFLAGS_initramfs_data.o += -DINITRAMFS_IMAGE=usr/$(datafile_y) + # Generate builtin.o based on initramfs_data.o obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o @@ -14,7 +16,7 @@ obj-$(CONFIG_BLK_DEV_INITRD) := initramfs_data.o # initramfs_data.o contains the compressed initramfs_data.cpio image. # The image is included using .incbin, a dependency which is not # tracked automatically. -$(obj)/initramfs_data.o: $(obj)/initramfs_data.cpio$(suffix_y) FORCE +$(obj)/initramfs_data.o: $(obj)/$(datafile_y) FORCE ##### # Generate the initramfs cpio archive @@ -38,10 +40,8 @@ endif quiet_cmd_initfs = GEN $@ cmd_initfs = $(initramfs) -o $@ $(ramfs-args) $(ramfs-input) -targets := initramfs_data.cpio.gz initramfs_data.cpio.bz2 \ - initramfs_data.cpio.lzma initramfs_data.cpio.xz \ - initramfs_data.cpio.lzo initramfs_data.cpio.lz4 \ - initramfs_data.cpio +targets := $(datafile_y) + # do not try to update files included in initramfs $(deps_initramfs): ; @@ -51,6 +51,6 @@ $(deps_initramfs): klibcdirs # 2) There are changes in which files are included (added or deleted) # 3) If gen_init_cpio are newer than initramfs_data.cpio # 4) arguments to gen_initramfs.sh changes -$(obj)/initramfs_data.cpio$(suffix_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs +$(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/.initramfs_data.cpio.d $(call if_changed,initfs)