Skip to content

Commit e2ab4ef

Browse files
committed
Merge tag 'kbuild-fixes-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull more Kbuild fixes from Masahiro Yamada: - fix a bashism of setlocalversion - do not use the too new --sort option of tar * tag 'kbuild-fixes-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kheaders: substituting --sort in archive creation scripts: setlocalversion: fix a bashism kbuild: update comment about KBUILD_ALLDIRS
2 parents 4fe34d6 + 700dea5 commit e2ab4ef

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ export KBUILD_VMLINUX_OBJS := $(head-y) $(init-y) $(core-y) $(libs-y2) \
10371037
export KBUILD_VMLINUX_LIBS := $(libs-y1)
10381038
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
10391039
export LDFLAGS_vmlinux
1040-
# used by scripts/package/Makefile
1040+
# used by scripts/Makefile.package
10411041
export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) LICENSES arch include scripts tools)
10421042

10431043
vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_OBJS) $(KBUILD_VMLINUX_LIBS)

kernel/gen_kheaders.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,13 @@ done | cpio --quiet -pd $cpio_dir >/dev/null 2>&1
7171
find $cpio_dir -type f -print0 |
7272
xargs -0 -P8 -n1 perl -pi -e 'BEGIN {undef $/;}; s/\/\*((?!SPDX).)*?\*\///smg;'
7373

74-
# Create archive and try to normalize metadata for reproducibility
75-
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
76-
--owner=0 --group=0 --sort=name --numeric-owner \
77-
-Jcf $tarfile -C $cpio_dir/ . > /dev/null
74+
# Create archive and try to normalize metadata for reproducibility.
75+
# For compatibility with older versions of tar, files are fed to tar
76+
# pre-sorted, as --sort=name might not be available.
77+
find $cpio_dir -printf "./%P\n" | LC_ALL=C sort | \
78+
tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \
79+
--owner=0 --group=0 --numeric-owner --no-recursion \
80+
-Jcf $tarfile -C $cpio_dir/ -T - > /dev/null
7881

7982
echo "$src_files_md5" > kernel/kheaders.md5
8083
echo "$obj_files_md5" >> kernel/kheaders.md5

scripts/setlocalversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ scm_version()
9393
# Check for mercurial and a mercurial repo.
9494
if test -d .hg && hgid=`hg id 2>/dev/null`; then
9595
# Do we have an tagged version? If so, latesttagdistance == 1
96-
if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then
96+
if [ "`hg log -r . --template '{latesttagdistance}'`" = "1" ]; then
9797
id=`hg log -r . --template '{latesttag}'`
9898
printf '%s%s' -hg "$id"
9999
else

0 commit comments

Comments
 (0)