27 Oct, 2020
1 commit
-
…nux/kernel/git/masahiroy/linux-kbuild") into android-mainline
Steps on the way to 5.10-rc1
Resolves conflicts in:
arch/arm64/kernel/vdso32/MakefileSigned-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ic9edce8127b3717469dc4fa96ca95166be419e9d
25 Sep, 2020
1 commit
-
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
~/.gitconfigSo 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.Signed-off-by: Rasmus Villemoes
Signed-off-by: Masahiro Yamada
28 Jul, 2020
1 commit
-
The new kernel release format is: w.x.y-zz-k where,
w.x.y are the current values
zzz is the Android Release value
k is the KMI Generation numberThis allows one to identify the kernel module interface version using
`uname -r`. The KMI Generation number is used to identify any KMI
changes that occur after the KMI freeze. This should only occur in an
unlikely event that a security patch requires a KMI update.Here is a local example:
5.4.51-android12-0-00153-ga972f59040e4-dirtySigned-off-by: Will McVicker
Bug: 159842160
Change-Id: I33f40e424ca967b85d810cdb12c6a2c58e4197b7
[willmcvicker: squash with commit 0c0d417747d8e289b2808c3fca32c845f82fd5e5]
11 Nov, 2019
1 commit
-
This patch replaces backquote to dollar parenthesis syntax for better
readability.Signed-off-by: Bhaskar Chowdhury
Acked-by: Randy Dunlap
Acked-by: Nico Schottelius
Signed-off-by: Masahiro Yamada
15 Oct, 2019
1 commit
-
Fix bashism reported by checkbashisms by using only one '=':
possible bashism in scripts/setlocalversion line 96 (should be 'b = a'):
if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; thenFixes: 38b3439d84f4 ("setlocalversion: update mercurial tag parsing")
Signed-off-by: Randy Dunlap
Cc: Mike Crowe
Signed-off-by: Masahiro Yamada
05 Oct, 2019
1 commit
-
Geert Uytterhoeven reports a strange side-effect of commit 858805b336be
("kbuild: add $(BASH) to run scripts with bash-extension"), which
inserts the contents of a localversion file in the build directory twice.[Steps to Reproduce]
$ echo bar > localversion
$ mkdir build
$ cd build/
$ echo foo > localversion
$ make -s -f ../Makefile defconfig include/config/kernel.release
$ cat include/config/kernel.release
5.4.0-rc1foofoobarThis comes down to the behavior change of local variables.
The 'man sh' on my Ubuntu machine, where sh is an alias to dash,
explains as follows:
When a variable is made local, it inherits the initial value and
exported and readonly flags from the variable with the same name
in the surrounding scope, if there is one. Otherwise, the variable
is initially unset.[Test Code]
foo ()
{
local res
echo "res: $res"
}res=1
foo[Result]
$ sh test.sh
res: 1
$ bash test.sh
res:So, scripts/setlocalversion correctly works only for bash in spite of
its hashbang being #!/bin/sh. Nobody had noticed it before because
CONFIG_SHELL was previously set to bash almost all the time.Now that CONFIG_SHELL is set to sh, we must write portable and correct
code. I gave the Fixes tag to the commit that uncovered the issue.Clear the variable 'res' in collect_files() to make it work for sh
(and it also works on distributions where sh is an alias to bash).Fixes: 858805b336be ("kbuild: add $(BASH) to run scripts with bash-extension")
Reported-by: Geert Uytterhoeven
Signed-off-by: Masahiro Yamada
Tested-by: Geert Uytterhoeven
21 Nov, 2018
1 commit
-
git-diff-index does not refresh the index for you, so using it for a
"-dirty" check can give misleading results. Commit 6147b1cf19651
("scripts/setlocalversion: git: Make -dirty check more robust") tried to
fix this by switching to git-status, but it overlooked the fact that
git-status also writes to the .git directory of the source tree, which
is definitely not kosher for an out-of-tree (O=) build. That is getting
reverted.Fortunately, git-status now supports avoiding writing to the index via
the --no-optional-locks flag, as of git 2.14. It still calculates an
up-to-date index, but it avoids writing it out to the .git directory.So, let's retry the solution from commit 6147b1cf19651 using this new
flag first, and if it fails, we assume this is an older version of git
and just use the old git-diff-index method.It's hairy to get the 'grep -vq' (inverted matching) correct by stashing
the output of git-status (you have to be careful about the difference
betwen "empty stdin" and "blank line on stdin"), so just pipe the output
directly to grep and use a regex that's good enough for both the
git-status and git-diff-index version.Cc: Christian Kujau
Cc: Guenter Roeck
Suggested-by: Alexander Kapshuk
Signed-off-by: Brian Norris
Tested-by: Genki Sky
Signed-off-by: Masahiro Yamada
11 Nov, 2018
1 commit
-
This reverts commit 6147b1cf19651c7de297e69108b141fb30aa2349.
The reverted patch results in attempted write access to the source
repository, even if that repository is mounted read-only.Output from "strace git status -uno --porcelain":
getcwd("/tmp/linux-test", 129) = 16
open("/tmp/linux-test/.git/index.lock", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0666) =
-1 EROFS (Read-only file system)While git appears to be able to handle this situation, a monitored
build environment (such as the one used for Chrome OS kernel builds)
may detect it and bail out with an access violation error. On top of
that, the attempted write access suggests that git _will_ write to the
file even if a build output directory is specified. Users may have the
reasonable expectation that the source repository remains untouched in
that situation.Fixes: 6147b1cf19651 ("scripts/setlocalversion: git: Make -dirty check more robust"
Cc: Genki Sky
Signed-off-by: Guenter Roeck
Reviewed-by: Brian Norris
Signed-off-by: Masahiro Yamada
01 Sep, 2018
1 commit
-
$(git diff-index) relies on the index being refreshed. This refreshing
of the index used to happen, but was removed in cdf2bc632ebc
("scripts/setlocalversion on write-protected source tree", 2013-06-14)
due to issues with a read-only filesystem.If the index is not refreshed, one runs into problems. E.g. as
described in [0], git stores the uid in its index, so even if just the
uid has changed (or git is tricked into thinking so), then we will
think the tree is dirty. So as in [1], if you package linux-git with a
system that uses fakeroot(1), you get a "-dirty" version. Unless you
manually $(git update-index --refresh) themselves.The simplest solution seems to be $(git status --porcelain), with an
additional flag saying "ignore untracked files". It seems clearer
about what it does, and avoids issues regarding cached indexes and
writable filesystems, but still has stable output for scripting.[0]: https://public-inbox.org/git/0190ae30-b6c8-2a8b-b1fb-fd9d84e6dfdf@oracle.com/
[1]: https://bbs.archlinux.org/viewtopic.php?id=236702Signed-off-by: Genki Sky
Signed-off-by: Masahiro Yamada
02 Nov, 2017
1 commit
-
Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.By default all files without license information are under the default
license of the kernel, which is GPL version 2.Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.How this work was done:
Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if
Reviewed-by: Philippe Ombredanne
Reviewed-by: Thomas Gleixner
Signed-off-by: Greg Kroah-Hartman
20 Jun, 2016
1 commit
-
I tried to use 'make O=...' from an unclean source tree. This triggered
the error path of setlocalversion. But by printing to STDOUT, it created
a broken localversion which then caused another (unrelated) error:"4.7.0-rc2Error: kernelrelease not valid - run make prepare to update it" exceeds 64 characters
After printing to STDERR, the true build error gets displayed later:
/home/wsa/Kernel/linux is not clean, please run 'make mrproper'
in the '/home/wsa/Kernel/linux' directory.Signed-off-by: Wolfram Sang
Signed-off-by: Michal Marek
03 Jan, 2014
1 commit
-
setlocalversion script was testing the presence of .git directory in
order to find out if git is used as SCM to track the current kernel
project. However in some cases, .git is not a directory but can be a
file: when the kernel is a git submodule part of a git super project for
example.This patch just fixes this by using 'git rev-parse --show-cdup' to check
that the current directory is the kernel git topdir. This has the
advantage to not test and rely on git internal infrastructure directly.Signed-off-by: Franck Bui-Huu
Signed-off-by: Michal Marek
24 Jun, 2013
1 commit
-
I just stumbled across another[0] issue when scripts/setlocalversion
operates on a write-protected source tree. Back then[0] the source tree
was on an read-only NFS share, so "test -w" was introduced before "git
update-index" was run.This time, the source tree is on read/write NFS share, but the permissions
are world-readable and only a specific user (or root) can write.
Thus, "test -w ." returns "0" and then runs "git update-index",
producing the following message (on a dirty tree):fatal: Unable to create '/usr/local/src/linux-git/.git/index.lock': Permission denied
While it says "fatal", compilation continues just fine.
However, I don't think a kernel compilation should alter the source
tree (or the .git directory) in any way and I don't see how removing
"git update-index" could do any harm. The Mercurial and SVN routines in
scripts/setlocalversion don't have any tree-modifying commands, AFAICS.
So, maybe the patch below would be acceptable.[0] https://patchwork.kernel.org/patch/29718/
Signed-off-by: Christian Kujau
Cc: Nico Schottelius
Signed-off-by: Michal Marek
22 Feb, 2013
1 commit
-
This patch allows the use of setlocalversion script regardless of the language
parameters. Otherwise, the `svn info 2>/dev/null | grep '^Last Changed Rev'`
returns nothing because for instance, in French the text 'Last Changed Rev'
is replaced by 'Révision de la dernière modification'Signed-off-by: Christophe Leroy
Signed-off-by: Michal Marek
27 Mar, 2012
1 commit
-
In some circumstances (eg when running a build in an emacs shell
buffer), I get a spew of messages likegrep: writing output: Broken pipe
from setlocalversion, because the "read" subshell apparently exits as
soon as it reads one line and gives EPIPE to grep. It's not clear to
me why this way of writing the check was used instead of just using
grep -q to suppress output, but unless there is some deep reason I
don't know, this way looks cleaner to me anyway, and gets rid of the
ugly message spew.(I double checked at http://pubs.opengroup.org/onlinepubs/009604499/utilities/grep.html
and "grep -q" is specified in POSIX / SuS, so hopefully even people
cross-compiling the kernel on some bizarre host OS can't complain
about this change)Signed-off-by: Roland Dreier
Signed-off-by: Michal Marek
15 Jan, 2011
1 commit
-
The tag output of hg doesn't quite match what setlocalversion currently
expects, so update it to handle the latest format.Signed-off-by: Mike Crowe
Signed-off-by: Mike Frysinger
Signed-off-by: Michal Marek
29 Oct, 2010
1 commit
-
* 'kbuild' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6:
initramfs: Fix build break on symbol-prefixed archs
initramfs: fix initramfs size calculation
initramfs: generalize initramfs_data.xxx.S variants
scripts/kallsyms: Enable error messages while hush up unnecessary warnings
scripts/setlocalversion: update comment
kbuild: Use a single clean rule for kernel and external modules
kbuild: Do not run make clean in $(srctree)
scripts/mod/modpost.c: fix commentary accordingly to last changes
kbuild: Really don't clean bounds.h and asm-offsets.h
06 Sep, 2010
1 commit
-
A tagged repository state isn't enough, git describe only
looks at signed or annotated tags (git tag -a/-s). This
documentation update makes sure the comment matches the
current behaviour.Signed-off-by: Michael Prokop
Signed-off-by: Michal Marek
21 Aug, 2010
1 commit
-
Dan McGee writes:
> Note that when in git, you get the appended "+" sign. If
> LOCALVERSION_AUTO is set, you will get something like
> "eee-gb01b08c-dirty" (whereas the copy of the tree in /tmp still
> returns "eee"). It doesn't matter whether the working tree is dirty or
> clean.
>
> Is there a way to disable this? I'm building from a clean tarball that
> just happens to be unpacked inside a git repository. One would think
> setting LOCALVERSION_AUTO to false would do it, but no such luck...Fix this by checking if the kernel source tree is the root of the git or
hg repository. No fix for svn: If the kernel source is not tracked in
the svn repository, it works as expected, otherwise determining the
'repository root' is not really a defined task.Reported-and-tested-by: Dan McGee
Signed-off-by: Michal Marek
13 Aug, 2010
1 commit
-
The manpage for cut says it will return all lines without the delimiter
unless -s is specified.When I backed up my mecurial tree to generate modules, I found that the
scm part of localversion was turning up blank.Signed-off-by: Milton Miller
Cc: Michal Marek
Cc: "Michał Górny"
Signed-off-by: Michal Marek
21 Jul, 2010
1 commit
-
make rpm was broken by commit 0915512:
make clean
set -e; cd ..; ln -sf /usr/src/iwlwifi-2.6 kernel-2.6.35rc4wl
/bin/sh /usr/src/iwlwifi-2.6/scripts/setlocalversion --scm-only >
/usr/src/iwlwifi-2.6/.scmversion
cat: .scmversion: input file is output file
make[1]: *** [rpm] Error 1Reported-and-tested-by: "Zheng, Jiajia"
Signed-off-by: Michal Marek
20 Jul, 2010
1 commit
-
The 'source' builtin is a bash alias to the '.' (dot) builtin. While the
former is supported only by bash, the latter is specified in POSIX and
works fine with all POSIX-compliant shells I am aware of.The '$_' special parameter is specific to bash. It is partially
supported in dash too but it always evaluates to the current script path
(which causes the script to enter a loop recursively re-executing
itself). This is why I have replaced the two occurences of '$_' with the
explicit parameter.The 'local' builtin is another example of bash-specific code. Although
it is supported by all POSIX-compliant shells I am aware of, it is not
part of POSIX specification and thus the code should not rely on it
assigning a specific value to the local variable. Moreover, the 'posh'
shell has a limited version of 'local' builtin not supporting direct
variable assignments. Thus, I have broken one of the 'local'
declarations down into a (non-POSIX) 'local' declaration and a plain
(POSIX-compliant) variable assignment.Signed-off-by: Michał Górny
Signed-off-by: Michal Marek
18 Jun, 2010
1 commit
-
Now that we run scripts/setlocalversion during every build, it makes
sense to move all the localversion logic there. This cleans up the
toplevel Makefile and also makes sure that the script is called only
once in 'make prepare' (previously, it would be called every time due to
a variable expansion in an ifneq statement). No user-visible change is
intended, unless one runs the setlocalversion script directly.Reported-by: Dmitry Torokhov
Cc: David Rientjes
Cc: Greg Thelen
Cc: Nico Schottelius
Signed-off-by: Michal Marek
15 Jun, 2009
1 commit
-
Do not update index on read only media.
Idea published by Christian Kujau .Cc: Nico Schottelius
Cc: Christian Kujau
20 May, 2009
1 commit
-
Produce correct output for
- tagged commit (v2.6.30-rc6)
- past tagged commit (v2.6.30-rc5-299-g7c7327d)
- no tagSigned-off-by: Linus Torvalds
01 May, 2009
1 commit
-
When using trees like wireless-testing, which have untagged tags,
scripts/setlocalversion does not display any git indication for
localversion.This patch fixes it: If git is available, but no usable tag is found,
it uses -g${head}. It skips the detection of unanottated tags via
git name-rev.Signed-off-by: Nico Schottelius
Signed-off-by: Sam Ravnborg
11 Apr, 2009
1 commit
-
Use the correct git syntax instead of the deprecated git-.
Signed-off-by: Peter Korsgaard
Signed-off-by: Sam Ravnborg
15 Feb, 2009
1 commit
-
Don't bother doing `svn st` as it takes a retarded amount of time when
the source is coldSigned-off-by: Mike Frysinger
Signed-off-by: Bryan Wu
Signed-off-by: Sam Ravnborg
04 Dec, 2008
2 commits
-
Print svn revision in addition to git info on git-svn repos.
Signed-off-by: Peter Korsgaard
Signed-off-by: Sam Ravnborg -
Output svn revision of latest change, instead of repo revision as thats
what we're interested in (especially when working on a branch/tag).Signed-off-by: Peter Korsgaard
Signed-off-by: Sam Ravnborg
30 Oct, 2008
2 commits
-
setlocalversion used to use an abbreviated git commit sha1 to generate the
tag. This was changed in commit d882421f4e08ddf0a94245cdbe516db260aa6f41
"kbuild: change CONFIG_LOCALVERSION_AUTO to use a git-describe-ish format"
to use git describe to come up with a tag. Which is nice, but git describe
sometimes can't describe the revision.
Commit 56b2f0706d82535fd8d85503f2dcc0be40c8e55d ("setlocalversion: do not
describe if there is nothing to describe") addressed this, but there is still
no tag generated.So, generate a plain abbreviated sha1 tag like setlocalversion used to when
git describe comes up short.Signed-off-by: Trent Piepho
CC: Jan Engelhardt
Signed-off-by: Sam Ravnborg -
The number of pending changes is pretty useless, so encoding it into the
version is just annoying by the constant shuffle in corresponding modules.Signed-off-by: Mike Frysinger
Signed-off-by: Sam Ravnborg
26 Jul, 2008
1 commit
-
Jan Engelhardt wrote:
> Just a note that when you run git-describe, you should probably quiten it.
>
> fatal: cannot describe 'bd7364a0fd5a4a2878fe4a224be1b142a4e6698e'
>
> This happens when tags are not present, which can happen if Linus's tree
> is sent upwards again, IOW:
>
> machine1$ git-clone torvalds/linux-2.6.git
> machine1$ git push elsewhere master
>
> machine2$ git-clone elsewhere:/linux
> machine2$ git-describe HEAD
> fatal: cannot describe thatSigned-off-by: Sebastian Siewior
Acked-by: Jan Engelhardt
Signed-off-by: Sam Ravnborg
03 Feb, 2008
1 commit
-
follow git and mercurial style, include uncommitted changes detect
Cc: Frans Pop
Signed-off-by: Bryan Wu
Signed-off-by: Sam Ravnborg
29 Jan, 2008
4 commits
-
make-kpkg modifies scripts/package/Makefile and deletes
scripts/package/builddeb as part of its build process. Ignore these
changes so the tree isn't marked as -dirty, when it is just an
artifact of make-kpkg. (make-kpkg clean restores the files to their
original state, and these helper scripts won't affect the final
compiled kernel in any way.)Signed-off-by: "Theodore Ts'o"
Signed-off-by: Sam Ravnborg -
If git's index file is out of date, and some files have been touched
such that their timestamp doesn't what is in the index, "git
diff-index HEAD" may show that a particular file is dirty, when in
fact it really isn't. Running "git update-index" will update the
index to avoid these false positives.Signed-off-by: "Theodore Ts'o"
Signed-off-by: Sam Ravnborg -
Change the automatic local version to have the form -nnnnn-gSHA1SUMID,
where 'nnnnn' is the number of commits since the last tag (i.e.,
2.6.21-rc7). This makes it much more likely that the package names created
for the kernel will look "newer" to a package manager.Signed-off-by: "Theodore Ts'o"
Signed-off-by: Sam Ravnborg -
This represents mercurial changesets similarly to git. For untagged
revisions, append the changeset id. If there are uncommitted changes,
append -dirty. For example, -hgc60016ba6237-dirtySigned-off-by: Aron Griffis
Signed-off-by: Sam Ravnborg
17 Jun, 2006
2 commits
-
Compare the working copy with the last commit, instead of the index.
Signed-off-by: Uwe Zeisberger
Acked-by: Ryan Anderson
Signed-off-by: Sam Ravnborg -
adds revision suffix for untagged commits that are reachable from a tag
I'm bisecting and don't get the -g...... suffix. The reason is, that
git name-rev --tags HEAD
returns e.g.
HEAD tags/v2.6.17-rc1^0~1067
which is currently good enough for setlocalversion to skip the suffix.
This introduces a dependecy to grep -E, which should be fine.Signed-off-by: Uwe Zeisberger
Acked-By: Ryan Anderson
Signed-off-by: Sam Ravnborg