Skip to content

Commit fd2a118

Browse files
committed
kheaders: rename the 'cpio_dir' variable to 'tmpdir'
The next commit will get rid of the use of 'cpio' command, as there is no strong reason to use it just for copying files. Before that, this commit renames the 'cpio_dir' variable to 'tmpdir'. No functional changes are intended. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent de0cae9 commit fd2a118

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

kernel/gen_kheaders.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
sfile="$(readlink -f "$0")"
88
outdir="$(pwd)"
99
tarfile=$1
10-
cpio_dir=$outdir/${tarfile%/*}/.tmp_cpio_dir
10+
tmpdir=$outdir/${tarfile%/*}/.tmp_dir
1111

1212
dir_list="
1313
include/
@@ -65,39 +65,39 @@ fi
6565

6666
echo " GEN $tarfile"
6767

68-
rm -rf $cpio_dir
69-
mkdir $cpio_dir
68+
rm -rf "${tmpdir}"
69+
mkdir "${tmpdir}"
7070

7171
if [ "$building_out_of_srctree" ]; then
7272
(
7373
cd $srctree
7474
for f in $dir_list
7575
do find "$f" -name "*.h";
76-
done | cpio --quiet -pd $cpio_dir
76+
done | cpio --quiet -pd "${tmpdir}"
7777
)
7878
fi
7979

8080
# The second CPIO can complain if files already exist which can happen with out
8181
# of tree builds having stale headers in srctree. Just silence CPIO for now.
8282
for f in $dir_list;
8383
do find "$f" -name "*.h";
84-
done | cpio --quiet -pdu $cpio_dir >/dev/null 2>&1
84+
done | cpio --quiet -pdu "${tmpdir}" >/dev/null 2>&1
8585

8686
# Always exclude include/generated/utsversion.h
8787
# Otherwise, the contents of the tarball may vary depending on the build steps.
88-
rm -f "${cpio_dir}/include/generated/utsversion.h"
88+
rm -f "${tmpdir}/include/generated/utsversion.h"
8989

9090
# Remove comments except SDPX lines
91-
find $cpio_dir -type f -print0 |
91+
find "${tmpdir}" -type f -print0 |
9292
xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;'
9393

9494
# Create archive and try to normalize metadata for reproducibility.
9595
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
9696
--owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \
97-
-I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null
97+
-I $XZ -cf $tarfile -C "${tmpdir}/" . > /dev/null
9898

9999
echo $headers_md5 > kernel/kheaders.md5
100100
echo "$this_file_md5" >> kernel/kheaders.md5
101101
echo "$(md5sum $tarfile | cut -d ' ' -f1)" >> kernel/kheaders.md5
102102

103-
rm -rf $cpio_dir
103+
rm -rf "${tmpdir}"

0 commit comments

Comments
 (0)