summaryrefslogtreecommitdiff
path: root/kernel/gen_kheaders.sh
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2019-10-08 21:05:55 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-03 11:27:10 +0200
commit7caddaa9f88b37eb732c36bb9d9bd2fac84b02b5 (patch)
tree1314d975e2dc10d73893f6d5b4cc1f98d8a7e45a /kernel/gen_kheaders.sh
parent18f48708c3f597cdd1de2fec9b03213d06bbf365 (diff)
kheaders: remove the last bashism to allow sh to run it
commit 1463f74f492eea7191f0178e01f3d38371a48210 upstream. '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 <yamada.masahiro@socionext.com> Signed-off-by: Matthias Maennich <maennich@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/gen_kheaders.sh')
-rwxr-xr-xkernel/gen_kheaders.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/kernel/gen_kheaders.sh b/kernel/gen_kheaders.sh
index 0f7752dd93a6..dc5744b93f8c 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