From patchwork Mon Aug 15 17:36:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 9281653 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 A35B9607FD for ; Mon, 15 Aug 2016 17:36:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9445E28E04 for ; Mon, 15 Aug 2016 17:36:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 885E328E14; Mon, 15 Aug 2016 17:36:28 +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_SIGNED, 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 5D8EA28E10 for ; Mon, 15 Aug 2016 17:36:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752976AbcHORg0 (ORCPT ); Mon, 15 Aug 2016 13:36:26 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:35214 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbcHORgZ (ORCPT ); Mon, 15 Aug 2016 13:36:25 -0400 Received: by mail-pa0-f43.google.com with SMTP id i5so17898719pat.2 for ; Mon, 15 Aug 2016 10:36:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=WyU0OeEjdIYLL7Bwglxfvk47v4Fn1OWaXg4K0Spc9v4=; b=U/lJjg3QSxSFtESlGW+KEn7cVjYZgbVQFLRZA27IwX0V+W8+TrIvZYLRBW8Bq6rjjS F/gpN+ljmmBLZLeNqcwkqR6NsYOOk3NO3f6DOj/MZ9Od63gbz3wX+9Kgs0s1meeWdJOm Cd4dNm/fMmg/vmOqhxmMsDtcfNcG8B/jeJhW0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=WyU0OeEjdIYLL7Bwglxfvk47v4Fn1OWaXg4K0Spc9v4=; b=Ob/uT8CZ08pfAxX9xWqaslUfYS7DHJdx+codzQH9R8/HW+MzM6193KwoTXm2pY3e0N hc9YbMm5b9M+BKP3/YtlSMG/A08Oavc76PoYG8vDsE306SaRaQmOYfgoqWIasD57Spf0 OT0KoPV+cVVdERHALgxAepmk8HGSqzGuHXBSsqPMSzTnfNVBuOFFqmmnAzx47S9ONhDm BQFFjArnXihFmvnkuAkE1m8iiGobMweDewjSh23hO+uKdAByw7Cfoe1+/yOIEdLOgbeB L0AUWNUYpuu7/lFlDcwXJHELJCACBRcLXEUl047Wr3N6wpeMf7w6mKthujzwa7pi/4/H feYA== X-Gm-Message-State: AEkoouv5rshPUsl41iTA2D1Kahf45OwXia9NJDNqpksQo5qKs/LzvDdoM6o5WKuhfLvdvhL3 X-Received: by 10.66.76.9 with SMTP id g9mr55497119paw.51.1471282584749; Mon, 15 Aug 2016 10:36:24 -0700 (PDT) Received: from www.outflux.net ([2002:ada4:7085:0:ae16:2dff:fe07:4fb6]) by smtp.gmail.com with ESMTPSA id b134sm32891022pfb.55.2016.08.15.10.36.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Aug 2016 10:36:23 -0700 (PDT) Date: Mon, 15 Aug 2016 10:36:22 -0700 From: Kees Cook To: Michal Marek Cc: Frank Paulsen , Christian Kujau , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org Subject: [PATCH] builddeb: Skip gcc-plugins when not configured Message-ID: <20160815173622.GA24820@www.outflux.net> MIME-Version: 1.0 Content-Disposition: inline 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 attempting to build a Debian kernel package, the "scripts/gcc-plugins" directory does not exist in the output tree unless CONFIG_GCC_PLUGINS=y. To avoid errors when not defined, this wraps the failing "find" in a config test. Reported-by: Frank Paulsen Tested-by: Christian Kujau Signed-off-by: Kees Cook --- This should go into v4.8... --- scripts/package/builddeb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/package/builddeb b/scripts/package/builddeb index e1c09e2f9be7..8ea9fd2b6573 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -332,7 +332,9 @@ if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles" fi (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" -(cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles" +if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then + (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles" +fi destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" (cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)