Commit 1463f74f authored by Masahiro Yamada's avatar Masahiro Yamada

kheaders: remove the last bashism to allow sh to run it

'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: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent ea79e516
...@@ -128,7 +128,7 @@ $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE ...@@ -128,7 +128,7 @@ $(obj)/config_data.gz: $(KCONFIG_CONFIG) FORCE
$(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz $(obj)/kheaders.o: $(obj)/kheaders_data.tar.xz
quiet_cmd_genikh = CHK $(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 $(obj)/kheaders_data.tar.xz: FORCE
$(call cmd,genikh) $(call cmd,genikh)
......
#!/bin/bash #!/bin/sh
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# This script generates an archive consisting of kernel headers # This script generates an archive consisting of kernel headers
...@@ -57,11 +57,12 @@ rm -rf $cpio_dir ...@@ -57,11 +57,12 @@ rm -rf $cpio_dir
mkdir $cpio_dir mkdir $cpio_dir
if [ "$building_out_of_srctree" ]; then if [ "$building_out_of_srctree" ]; then
pushd $srctree > /dev/null (
for f in $dir_list cd $srctree
do find "$f" -name "*.h"; for f in $dir_list
done | cpio --quiet -pd $cpio_dir do find "$f" -name "*.h";
popd > /dev/null done | cpio --quiet -pd $cpio_dir
)
fi fi
# The second CPIO can complain if files already exist which can happen with out # The second CPIO can complain if files already exist which can happen with out
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment