linux-stable/scripts
Rasmus Villemoes 861c5ce033 scripts/setlocalversion: make git describe output more reliable
commit 548b8b5168 upstream.

When building for an embedded target using Yocto, we're sometimes
observing that the version string that gets built into vmlinux (and
thus what uname -a reports) differs from the path under /lib/modules/
where modules get installed in the rootfs, but only in the length of
the -gabc123def suffix. Hence modprobe always fails.

The problem is that Yocto has the concept of "sstate" (shared state),
which allows different developers/buildbots/etc. to share build
artifacts, based on a hash of all the metadata that went into building
that artifact - and that metadata includes all dependencies (e.g. the
compiler used etc.). That normally works quite well; usually a clean
build (without using any sstate cache) done by one developer ends up
being binary identical to a build done on another host. However, one
thing that can cause two developers to end up with different builds
[and thus make one's vmlinux package incompatible with the other's
kernel-dev package], which is not captured by the metadata hashing, is
this `git describe`: The output of that can be affected by

(1) git version: before 2.11 git defaulted to a minimum of 7, since
2.11 (git.git commit e6c587) the default is dynamic based on the
number of objects in the repo
(2) hence even if both run the same git version, the output can differ
based on how many remotes are being tracked (or just lots of local
development branches or plain old garbage)
(3) and of course somebody could have a core.abbrev config setting in
~/.gitconfig

So in order to avoid `uname -a` output relying on such random details
of the build environment which are rather hard to ensure are
consistent between developers and buildbots, make sure the abbreviated
sha1 always consists of exactly 12 hex characters. That is consistent
with the current rule for -stable patches, and is almost always enough
to identify the head commit unambigously - in the few cases where it
does not, the v5.4.3-00021- prefix would certainly nail it down.

[Adapt to `` vs $() differences between 5.4 and upstream.]
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-11-10 10:23:50 +01:00
..
basic
coccinelle fs: stream_open - opener for stream-like files so that read and write can run simultaneously without deadlock 2019-06-11 12:22:49 +02:00
dtc scripts/dtc: Remove redundant YYLOC global declaration 2020-04-02 17:20:33 +02:00
gcc-plugins gcc-common.h: Update for GCC 10 2020-05-27 16:41:43 +02:00
gdb scripts/gdb: fix debugging modules compiled with hot/cold partitioning 2019-12-05 15:34:10 +01:00
genksyms
kconfig kconfig: fix broken dependency in randconfig-generated .config 2020-02-28 15:42:22 +01:00
ksymoops
mod modpost: skip ELF local symbols during section mismatch check 2019-12-21 10:41:17 +01:00
package builddeb: Fix header package regarding dtc source links 2018-05-30 07:50:39 +02:00
selinux
tracing
.gitignore
adjust_autoksyms.sh kbuild: make scripts/adjust_autoksyms.sh robust against timestamp races 2018-05-30 07:50:37 +02:00
analyze_suspend.py
asn1_compiler.c
bloat-o-meter
bootgraph.pl
check-lc_ctype.c
check_extable.sh
checkincludes.pl
checkkconfigsymbols.py
checkpatch.pl checkpatch: fix the usage of capture group ( ... ) 2020-09-12 11:47:38 +02:00
checkstack.pl scripts/checkstack.pl: Fix arm64 wrong or unknown architecture 2019-07-10 09:55:31 +02:00
checksyscalls.sh
checkversion.pl
cleanfile
cleanpatch
coccicheck
config scripts/config: allow colons in option strings for sed 2020-05-10 10:28:01 +02:00
conmakehash.c
const_structs.checkpatch
decode_stacktrace.sh scripts/decode_stacktrace: strip basepath from all paths 2020-07-31 16:44:03 +02:00
decodecode scripts/decodecode: fix trapping instruction formatting 2020-05-20 08:15:29 +02:00
depmod.sh kbuild: make missing $DEPMOD a Warning instead of an Error 2018-09-15 09:43:01 +02:00
diffconfig
docproc.c
export_report.pl
extract-cert.c
extract-ikconfig
extract-module-sig.pl
extract-sys-certs.pl
extract-vmlinux
extract_xc3028.pl
faddr2line
gcc-goto.sh
gcc-ld
gcc-plugin.sh
gcc-version.sh
gcc-x86_32-has-stack-protector.sh
gcc-x86_64-has-stack-protector.sh
gen_initramfs_list.sh
get_dvb_firmware
get_maintainer.pl
gfp-translate
headerdep.pl
headers.sh
headers_check.pl
headers_install.sh
insert-sys-cert.c
kallsyms.c scripts/kallsyms: fix definitely-lost memory leak 2020-01-04 13:41:02 +01:00
Kbuild.include kbuild: improve cc-option to clean up all temporary files 2020-06-30 15:38:43 -04:00
kernel-doc
kernel-doc-xml-ref
ld-version.sh
Lindent
link-vmlinux.sh
Makefile
Makefile.asm-generic
Makefile.build kbuild: Add support to generate LLVM assembly files 2018-11-23 08:20:35 +01:00
Makefile.clean
Makefile.dtbinst
Makefile.extrawarn kbuild: Disable -Wpointer-to-enum-cast 2020-04-02 17:20:27 +02:00
Makefile.fwinst
Makefile.gcc-plugins
Makefile.headersinst
Makefile.help
Makefile.host kbuild: Add __cc-option macro 2018-11-23 08:20:35 +01:00
Makefile.kasan kasan: don't emit builtin calls when sanitization is off 2018-08-17 20:59:29 +02:00
Makefile.lib kbuild: fix asm-offset generation to work with clang 2018-11-23 08:20:35 +01:00
Makefile.modbuiltin
Makefile.modinst
Makefile.modpost kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules 2019-08-25 10:51:47 +02:00
Makefile.modsign
Makefile.ubsan
makelst
markup_oops.pl
mkcompile_h
mkmakefile
mksysmap mksysmap: Fix the mismatch of '.L' symbols in System.map 2020-06-30 15:38:23 -04:00
mkuboot.sh
mkversion
module-common.lds
namespace.pl namespace: fix namespace.pl script to support relative paths 2019-10-29 09:15:06 +01:00
objdiff
patch-kernel
pnmtologo.c
profile2linkerlist.pl
prune-kernel
recordmcount.c ARM: 8950/1: ftrace/recordmcount: filter relocation types 2020-01-29 10:24:38 +01:00
recordmcount.h recordmcount: Fix spurious mcount entries on powerpc 2019-08-04 09:33:38 +02:00
recordmcount.pl
setlocalversion scripts/setlocalversion: make git describe output more reliable 2020-11-10 10:23:50 +01:00
show_delta
sign-file.c
sortextable.c
sortextable.h
spelling.txt
stackdelta
stackusage
tags.sh
unifdef.c unifdef: use memcpy instead of strncpy 2018-12-08 13:05:05 +01:00
ver_linux
xen-hypercalls.sh
xz_wrap.sh