Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2994091AbbEEQID (ORCPT ); Tue, 5 May 2015 12:08:03 -0400 Received: from mail-ie0-f173.google.com ([209.85.223.173]:34469 "EHLO mail-ie0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2993226AbbEEOnF (ORCPT ); Tue, 5 May 2015 10:43:05 -0400 MIME-Version: 1.0 In-Reply-To: <16612.1430836386@warthog.procyon.org.uk> References: <1430516505-4812-1-git-send-email-aricart@memnix.com> <1430559977.5803.12.camel@memnix.com> <16612.1430836386@warthog.procyon.org.uk> Date: Tue, 5 May 2015 07:43:03 -0700 X-Google-Sender-Auth: PH5bhXInAdjKuLfemtyMxxUMUFc Message-ID: Subject: Re: [PATCH] MODSIGN: Change default key details [ver #2] From: Linus Torvalds To: David Howells Cc: Abelardo Ricart III , Michal Marek , Linux Kernel Mailing List , Sedat Dilek , keyrings@linux-nfs.org, Rusty Russell , LSM List , James Morris , Greg Kroah-Hartman Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1736 Lines: 44 On Tue, May 5, 2015 at 7:33 AM, David Howells wrote: > Linus Torvalds wrote: > >> +define filechk_x509_list >> + echo $(X509_CERTIFICATES) >> +endef >> targets += $(obj)/.x509.list >> -$(obj)/.x509.list: >> - @echo $(X509_CERTIFICATES) >$@ >> +$(obj)/.x509.list: Makefile FORCE >> + $(call filechk,x509_list) > > How does that actually work? So the Makefile dependency is entirely fake, it's just that the "filechk" macro wants to have an input. The FORCE means that it ends up being done every time, regardless of whether the Makefile has changed or not. See scripts/Kbuild.include for details on the "filechk" macro, bit it basically takes another make macro (called "filechk_xyz"), runs that macro as a shell script and outputs it to a temporary file: $(filechk_$(1)) < $< > $@.tmp; (that "$<" is also why the rule wants a some input, in our case "Makefile"). It then does a move-if-changed of the temporary file to the target. So the end result is that we run that "filechk_x509_list" script, compare the output to the old target, and update the target iff it is different. That would seem to be exactly what we want. That said, as mentioned, the whole "X509_CERTIFICATES" thing is unstable, and ends up being "./signing_key.x509" or "signing_key.x509" depending on whether that file existed or not. That needs fixing, so that we get stable output. So some filtering required. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/