From patchwork Tue Oct 8 12:05:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 175477 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp5609878ill; Tue, 8 Oct 2019 05:06:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqylS8GWvGLEDtzoFsLhhftEhV8NSseKjUgRmYrEVhqBg9yoZFW3XsL8okjC6qEJF9GOPLIZ X-Received: by 2002:a17:906:5847:: with SMTP id h7mr27702664ejs.218.1570536404987; Tue, 08 Oct 2019 05:06:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570536404; cv=none; d=google.com; s=arc-20160816; b=ncTdyJYjTXCB0wAf3cyCOzYp3ma/a0gX6FPggn9FrtZ3KQUHjObSSdQCl1LViQuRlz iQt2R3lCX49/3TfmoLMhCluqN11QOFdaPfIL/QLcjX5GM9ESupTP8X1T0svMRC7gguJe 4IYeKRt4aoYX1bJE4F4W7mtZnuDfQFL38CrE0kTY0EPpwe2DX1NaOwYU3Xc1Lz/IUP3Q Rqlf0BpSlK5WyHLx6mx/QQH4NnabQbs9CF77gi27b8DKa9HygESJezHoo/Oa5BH8uwT3 bWQmisebijOxyAyenxH6FvP3UEHS+ySfvJq2z7DSZJHHV/v+JVpBMDLHv4DXS1n0FElv N32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=PgC6Hu85mI6smUhbjGbKEy1lzgBgshSxS8+Ygx9AYwc=; b=VxHbfdjloc4kYi5sNsVWdiL+RkWVRkJ/GXdluxi3a3oOe1HJckozTaJUS5VS2Rc5Rh sSpBjPmrZLQQbXWhUI3k6zNticEvbW2WFV+N+4C+pV6xg4V2n+PXXCmoqPQnPRgrPYti 7kzi6DUkwzmqeeSLDQOfcQwSLCNWTk5X5YkZacuU9wxHbPHo3bfNmu/hPZXBMdABh/zW 9zwhCOQqAzPpoGjEW9wI8jzggDU9BQEUr0dqPNAU24ejacjxo5Z5nMFVAvxgncIYo2Df Mnd49/Qn+leW+g/cggywNhdC3c5lWwm8naQPXx9vmGp+5NXzNqS4Ur59rqOR+VZSDI5v B/hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="gHzP/IZA"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p23si7581617eju.435.2019.10.08.05.06.44; Tue, 08 Oct 2019 05:06:44 -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=@nifty.com header.s=dec2015msa header.b="gHzP/IZA"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730971AbfJHMGn (ORCPT + 26 others); Tue, 8 Oct 2019 08:06:43 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:28283 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730683AbfJHMGm (ORCPT ); Tue, 8 Oct 2019 08:06:42 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x98C6136021176; Tue, 8 Oct 2019 21:06:04 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x98C6136021176 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1570536364; bh=PgC6Hu85mI6smUhbjGbKEy1lzgBgshSxS8+Ygx9AYwc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gHzP/IZAEvhFKy7tFjejGrZpEytl4EnUKO5lhkb8JCB4OKcqTNh+GJBkd5w0uB2rG 5hFATSHxB6200o7GzxuBkDnAZ7xXS57bbjbDcbnrVjWhfZe5qfli5KhBwcsp5f9c3K m5K5K5dlBy8Ox7gUVzRzuRwVenmqdt5mESVs5bowYFfTi/l4yiCAFpFNhcrLbySN2o N1rHs6L4DjJ0tgm+PrT7JNd+4umTYSIrNq7R/z3eHIqdMbYEYhroX9TL34Mhf2izNC vpn7S//dTpL/y4IRjiVHsKdFoGrRZjX93TZLbGOiYb12G4h0gev9DxQu38DJ8CLPJB 2eodAtaQUdkUA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Greg KH , Joel Fernandes , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 4/5] kheaders: remove the last bashism to allow sh to run it Date: Tue, 8 Oct 2019 21:05:55 +0900 Message-Id: <20191008120556.4263-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191008120556.4263-1-yamada.masahiro@socionext.com> References: <20191008120556.4263-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'pushd' ... 'popd' is the last bash-specific code in this script. One way to avoid it is to run the code in a sub-shell. With that addressed, you can run this script with sh. I replaced $(BASH) with $(CONFIG_SHELL), and I changed the hashbang to #!/bin/sh. Signed-off-by: Masahiro Yamada --- kernel/Makefile | 2 +- kernel/gen_kheaders.sh | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/kernel/Makefile b/kernel/Makefile index daad787fb795..42557f251fea 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -128,7 +128,7 @@ $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz quiet_cmd_genikh = CHK $(obj)/kheaders_data.tar.xz - cmd_genikh = $(BASH) $(srctree)/kernel/gen_kheaders.sh $@ + cmd_genikh = $(CONFIG_SHELL) $(srctree)/kernel/gen_kheaders.sh $@ $(obj)/kheaders_data.tar.xz: FORCE $(call cmd,genikh) diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh index dd40a1b86f96..6c5f88f3ca2d 100755 --- a/kernel/gen_kheaders.sh +++ b/kernel/gen_kheaders.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # SPDX-License-Identifier: GPL-2.0 # This script generates an archive consisting of kernel headers @@ -57,11 +57,12 @@ rm -rf $cpio_dir mkdir $cpio_dir if [ "$building_out_of_srctree" ]; then - pushd $srctree > /dev/null - for f in $dir_list - do find "$f" -name "*.h"; - done | cpio --quiet -pd $cpio_dir - popd > /dev/null + ( + cd $srctree + for f in $dir_list + do find "$f" -name "*.h"; + done | cpio --quiet -pd $cpio_dir + ) fi # The second CPIO can complain if files already exist which can happen with out