From patchwork Thu Dec 8 19:17:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 9467013 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 2EFA260459 for ; Thu, 8 Dec 2016 19:17:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E032285F1 for ; Thu, 8 Dec 2016 19:17:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1182B285F7; Thu, 8 Dec 2016 19:17:09 +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 8D8AB285F1 for ; Thu, 8 Dec 2016 19:17:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752633AbcLHTRH (ORCPT ); Thu, 8 Dec 2016 14:17:07 -0500 Received: from mail-io0-f178.google.com ([209.85.223.178]:35975 "EHLO mail-io0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752246AbcLHTRH (ORCPT ); Thu, 8 Dec 2016 14:17:07 -0500 Received: by mail-io0-f178.google.com with SMTP id a81so14612133ioe.3 for ; Thu, 08 Dec 2016 11:17:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=P6eSXL5QXFs5nayI515aGDffCTQdjvcDMQsF4KCjlKk=; b=HMzaJfaBvwFsPYIHOGMQv5G3zwePUE1D8VfEfdv/05f7ObeSLheL4zSWL5QiJF1FLo rrapD/bZtW5n4Ie75iEQ+tdSPF7Mt/BrOYiSvc2w3ymqAqSWZSmWJRNDfMSWAQroNCSp ViHjWO7JB+zTxUKciPksoConPLs3U+5hv/0UM= 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:user-agent :mime-version; bh=P6eSXL5QXFs5nayI515aGDffCTQdjvcDMQsF4KCjlKk=; b=eBinwt2dFel57gz/WRIpLqgZhH8wcmd4uRyi+CUaSExpDaZOIpog7tHN1X88ES0MAd VQu0qHojHRnBqMUm4Qsf88S/Tli/Eod3ODSVynDtcUJYz12p8KMw7ElpHJhhckqPv3fK RilzZ8hR5QOOMcPRIp84jDLaN2YT/ah262cnLOF0C92O77R+/22sJEzflGq/twJiI3z0 GKBXh7R0DoQTe7ZSnjJrNf+S5isqhP9Y04lDLjQAyZaDTmod01yQvG6ynGZ8eQGXyqKT j6r6zT7lzLA7z76TIwYus/YZC6vZ5tFjPrVCG+aZ/+hBkNAvGqKp02+1IollQIaEVhcP S2sg== X-Gm-Message-State: AKaTC02PfT3cl0i5k5FU/1UM9xC7u32sWGD3DlgnmooMCTiyvvp4jm2pdeqk8FMIWdIAOC5S X-Received: by 10.107.35.147 with SMTP id j141mr14475401ioj.41.1481224625026; Thu, 08 Dec 2016 11:17:05 -0800 (PST) Received: from xanadu.home ([2607:fa48:6e39:d410:feaa:14ff:fea7:ed77]) by smtp.gmail.com with ESMTPSA id j96sm13391751ioo.29.2016.12.08.11.17.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Dec 2016 11:17:04 -0800 (PST) Date: Thu, 8 Dec 2016 14:17:03 -0500 (EST) From: Nicolas Pitre To: Michal Marek cc: linux-kbuild@vger.kernel.org Subject: [PATCH] kbuild: fix scripts/adjust_autoksyms.sh* for the no modules case Message-ID: User-Agent: Alpine 2.20 (LFD 67 2015-01-07) MIME-Version: 1.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 CONFIG_TRIM_UNUSED_KSYMS=y and no modules are actually selected, the adjust_autoksyms.sh script fails with: sed: can't read .tmp_versions/*.mod: No such file or directory Let's cope with that case gracefully. Signed-off-by: Nicolas Pitre --- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index 8dc1918b67..513da1a4a2 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -59,6 +59,7 @@ cat > "$new_ksyms_file" << EOT */ EOT +[ "$(ls -A "$MODVERDIR")" ] && sed -ns -e '3{s/ /\n/g;/^$/!p;}' "$MODVERDIR"/*.mod | sort -u | while read sym; do if [ -n "$CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX" ]; then